Add the backchannel logout event
This commit is contained in:
@@ -11,3 +11,9 @@ type FileEvent struct {
|
||||
// Only in case of sharing (refactor this into separate struct when more fields are needed)
|
||||
AffectedUserIDs []string `json:"affecteduserids"`
|
||||
}
|
||||
|
||||
// BackchannelLogout is emitted when the callback revived from the identity provider
|
||||
type BackchannelLogout struct {
|
||||
UserID string `json:"userid"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
@@ -159,6 +159,8 @@ func (cl *ClientlogService) processEvent(event events.Event) {
|
||||
fileEv("link-updated", &provider.Reference{ResourceId: e.ItemID})
|
||||
case events.LinkRemoved:
|
||||
fileEv("link-removed", &provider.Reference{ResourceId: e.ItemID})
|
||||
case events.BackchannelLogout:
|
||||
evType, users, data = backchannelLogoutEvent(e)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -287,3 +289,10 @@ func isRename(o, n *provider.Reference) bool {
|
||||
}
|
||||
return filepath.Base(o.GetPath()) != filepath.Base(n.GetPath())
|
||||
}
|
||||
|
||||
func backchannelLogoutEvent(e events.BackchannelLogout) (string, []string, BackchannelLogout) {
|
||||
return "backchannel-logout", []string{e.Executant.GetOpaqueId()}, BackchannelLogout{
|
||||
UserID: e.Executant.GetOpaqueId(),
|
||||
Timestamp: e.Timestamp.String(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user