@@ -19,11 +19,11 @@ export type SessionExpanded = Omit<Session, 'user' | 'device'> & {
1919}
2020
2121export interface SessionRepository {
22- findSessionByToken ( token : string ) : Promise < Session | null >
22+ readSessionByToken ( token : string ) : Promise < Session | null >
2323 createOrRefreshSession ( userId : UserId , deviceId ?: string ) : Promise < Session >
24- removeSession ( token : string ) : Promise < Session | null >
25- removeSessionsForUser ( userId : UserId ) : Promise < number >
26- removeSessionsForDevice ( deviceId : DeviceId ) : Promise < number >
24+ deleteSession ( token : string ) : Promise < Session | null >
25+ deleteSessionsForUser ( userId : UserId ) : Promise < number >
26+ deleteSessionsForDevice ( deviceId : DeviceId ) : Promise < number >
2727}
2828
2929/**
@@ -82,6 +82,10 @@ export interface DeviceEnrollmentPolicy {
8282 * The identity provider user is the result of mapping a specific IDP account to a Mage user account.
8383 */
8484export type IdentityProviderUser = Pick < User , 'username' | 'displayName' | 'email' | 'phones' >
85+ & {
86+ idpAccountId ?: string
87+ idpAccountAttrs ?: Record < string , any >
88+ }
8589
8690/**
8791 * A user ingress binding is the bridge between a Mage user and an identity provider account. When a user attempts
@@ -90,6 +94,8 @@ export type IdentityProviderUser = Pick<User, 'username' | 'displayName' | 'emai
9094 */
9195export interface UserIngressBinding {
9296 idpId : IdentityProviderId
97+ created : Date
98+ updated : Date
9399 // TODO: evaluate for utility of disabling a single ingress/idp path for a user as opposed to the entire account
94100 // verified: boolean
95101 // enabled: boolean
@@ -124,8 +130,15 @@ export interface IdentityProviderRepository {
124130}
125131
126132export interface UserIngressBindingsRepository {
127- readBindingsForUser ( userId : UserId ) : Promise < UserIngressBindings >
133+ /**
134+ * Return null if the user has no persisted bindings entry.
135+ */
136+ readBindingsForUser ( userId : UserId ) : Promise < UserIngressBindings | null >
128137 readAllBindingsForIdp ( idpId : IdentityProviderId , paging ?: PagingParameters ) : Promise < PageOf < UserIngressBindings > >
138+ /**
139+ * Save the given ingress binding to the bindings dictionary for the given user, creating or updating as necessary.
140+ * Return the modified ingress bindings.
141+ */
129142 saveUserIngressBinding ( userId : UserId , binding : UserIngressBinding ) : Promise < UserIngressBindings | Error >
130143 /**
131144 * Return the binding that was deleted, or null if the user did not have a binding to the given IDP.
0 commit comments