fix: remove comments
This commit is contained in:
parent
e0a44cacd0
commit
9c58deded3
3 changed files with 1 additions and 12 deletions
|
@ -34,8 +34,6 @@ type Client interface {
|
|||
AccessTokenType() AccessTokenType
|
||||
IDTokenLifetime() time.Duration
|
||||
DevMode() bool
|
||||
//AssertAdditionalIdTokenScopes() bool
|
||||
//AssertAdditionalAccessTokenScopes() bool
|
||||
RestrictAdditionalIdTokenScopes() func(scopes []string) []string
|
||||
RestrictAdditionalAccessTokenScopes() func(scopes []string) []string
|
||||
IsScopeAllowed(scope string) bool
|
||||
|
|
|
@ -171,13 +171,6 @@ func (c *ConfClient) DevMode() bool {
|
|||
func (c *ConfClient) AllowedScopes() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
//func (c *ConfClient) AssertAdditionalIdTokenScopes() bool {
|
||||
// return false
|
||||
//}
|
||||
//func (c *ConfClient) AssertAdditionalAccessTokenScopes() bool {
|
||||
// return false
|
||||
//}
|
||||
func (c *ConfClient) RestrictAdditionalIdTokenScopes() func(scopes []string) []string {
|
||||
return func(scopes []string) []string {
|
||||
return scopes
|
||||
|
|
|
@ -98,8 +98,7 @@ func CreateJWT(ctx context.Context, issuer string, tokenRequest TokenRequest, ex
|
|||
func CreateIDToken(ctx context.Context, issuer string, authReq AuthRequest, validity time.Duration, accessToken, code string, storage Storage, signer Signer, restictAdditionalScopesFunc func([]string) []string) (string, error) {
|
||||
exp := time.Now().UTC().Add(validity)
|
||||
claims := oidc.NewIDTokenClaims(issuer, authReq.GetSubject(), authReq.GetAudience(), exp, authReq.GetAuthTime(), authReq.GetNonce(), authReq.GetACR(), authReq.GetAMR(), authReq.GetClientID())
|
||||
scopes := authReq.GetScopes()
|
||||
|
||||
scopes := restictAdditionalScopesFunc(authReq.GetScopes())
|
||||
if accessToken != "" {
|
||||
atHash, err := oidc.ClaimHash(accessToken, signer.SignatureAlgorithm())
|
||||
if err != nil {
|
||||
|
@ -108,7 +107,6 @@ func CreateIDToken(ctx context.Context, issuer string, authReq AuthRequest, vali
|
|||
claims.SetAccessTokenHash(atHash)
|
||||
scopes = removeUserinfoScopes(scopes)
|
||||
}
|
||||
scopes = restictAdditionalScopesFunc(scopes)
|
||||
if len(scopes) > 0 {
|
||||
userInfo, err := storage.GetUserinfoFromScopes(ctx, authReq.GetSubject(), authReq.GetClientID(), scopes)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue