Add the backchannel logout event

This commit is contained in:
Roman Perekhod
2024-06-25 12:13:24 +02:00
parent 721b32bd1e
commit eac5eaea8f
15 changed files with 194 additions and 56 deletions
+6
View File
@@ -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(),
}
}