diff --git a/extensions/idp/pkg/backends/cs3/identifier/cs3.go b/extensions/idp/pkg/backends/cs3/identifier/cs3.go index 9b0bfa823..2370a0734 100644 --- a/extensions/idp/pkg/backends/cs3/identifier/cs3.go +++ b/extensions/idp/pkg/backends/cs3/identifier/cs3.go @@ -29,6 +29,7 @@ var cs3SpportedScopes = []string{ lico.ScopeRawSubject, } +// CS3 Backend holds the data for the CS3 identifier backend type CS3Backend struct { supportedScopes []string diff --git a/extensions/idp/pkg/backends/cs3/identifier/session.go b/extensions/idp/pkg/backends/cs3/identifier/session.go index aab650c2a..12ec61812 100644 --- a/extensions/idp/pkg/backends/cs3/identifier/session.go +++ b/extensions/idp/pkg/backends/cs3/identifier/session.go @@ -34,6 +34,7 @@ type cs3Session struct { when time.Time } +// User returns the cs3 user of the session func (s *cs3Session) User() *cs3user.User { return s.u } diff --git a/extensions/idp/pkg/backends/cs3/identifier/user.go b/extensions/idp/pkg/backends/cs3/identifier/user.go index a3fcbc44b..135bb3740 100644 --- a/extensions/idp/pkg/backends/cs3/identifier/user.go +++ b/extensions/idp/pkg/backends/cs3/identifier/user.go @@ -15,38 +15,47 @@ func newCS3User(u *cs3user.User) (*cs3User, error) { }, nil } +// Subject returns the cs3 users opaque id as sub func (u *cs3User) Subject() string { return u.u.GetId().GetOpaqueId() } +// Email returns the cs3 users email func (u *cs3User) Email() string { return u.u.GetMail() } +// EmailVerified returns the cs3 users email verified flag func (u *cs3User) EmailVerified() bool { return u.u.GetMailVerified() } +// Name returns the cs3 users displayname func (u *cs3User) Name() string { return u.u.GetDisplayName() } +// FamilyName always returns "" to fulfill the UserWithProfile interface func (u *cs3User) FamilyName() string { return "" } +// GivenName always returns "" to fulfill the UserWithProfile interface func (u *cs3User) GivenName() string { return "" } +// Username returns the cs3 users username func (u *cs3User) Username() string { return u.u.GetUsername() } +// UniqueID returns the cs3 users opaque id func (u *cs3User) UniqueID() string { return u.u.GetId().GetOpaqueId() } +// BackendClaims returns additional claims the cs3 users provides func (u *cs3User) BackendClaims() map[string]interface{} { claims := make(map[string]interface{}) claims[konnect.IdentifiedUserIDClaim] = u.u.GetId().GetOpaqueId() @@ -54,10 +63,12 @@ func (u *cs3User) BackendClaims() map[string]interface{} { return claims } +// BackendScopes returns nil to fulfill the UserFromBackend interface func (u *cs3User) BackendScopes() []string { return nil } +// RequiredScopes returns nil to fulfill the UserFromBackend interface func (u *cs3User) RequiredScopes() []string { return nil }