Skip to content

Commit

Permalink
add missing godoc to make hound vJulian happy
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed May 20, 2022
1 parent d56bbd6 commit 9ac13e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/idp/pkg/backends/cs3/identifier/cs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var cs3SpportedScopes = []string{
lico.ScopeRawSubject,
}

// CS3 Backend holds the data for the CS3 identifier backend
type CS3Backend struct {
supportedScopes []string

Expand Down
1 change: 1 addition & 0 deletions extensions/idp/pkg/backends/cs3/identifier/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
11 changes: 11 additions & 0 deletions extensions/idp/pkg/backends/cs3/identifier/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,60 @@ 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()

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
}

0 comments on commit 9ac13e6

Please sign in to comment.