feat: get all claims (#209)

This commit is contained in:
Igor Morozov 2022-08-30 17:09:56 +03:00 committed by GitHub
parent 0e7949b1a0
commit fca6cf9433
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -140,6 +140,10 @@ func (i *introspectionResponse) GetClaim(key string) interface{} {
return i.claims[key] return i.claims[key]
} }
func (i *introspectionResponse) GetClaims() map[string]interface{} {
return i.claims
}
func (i *introspectionResponse) SetActive(active bool) { func (i *introspectionResponse) SetActive(active bool) {
i.Active = active i.Active = active
} }

View file

@ -15,6 +15,7 @@ type UserInfo interface {
UserInfoPhone UserInfoPhone
GetAddress() UserInfoAddress GetAddress() UserInfoAddress
GetClaim(key string) interface{} GetClaim(key string) interface{}
GetClaims() map[string]interface{}
} }
type UserInfoProfile interface { type UserInfoProfile interface {
@ -173,6 +174,10 @@ func (u *userinfo) GetClaim(key string) interface{} {
return u.claims[key] return u.claims[key]
} }
func (u *userinfo) GetClaims() map[string]interface{} {
return u.claims
}
func (u *userinfo) SetSubject(sub string) { func (u *userinfo) SetSubject(sub string) {
u.Subject = sub u.Subject = sub
} }