chore(linting): apply gofumpt & goimports to all .go files (#225)
This commit is contained in:
parent
c4b7ef9160
commit
b5da6ec29b
45 changed files with 539 additions and 479 deletions
|
@ -9,33 +9,34 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
//GrantTypeCode defines the grant_type `authorization_code` used for the Token Request in the Authorization Code Flow
|
||||
// GrantTypeCode defines the grant_type `authorization_code` used for the Token Request in the Authorization Code Flow
|
||||
GrantTypeCode GrantType = "authorization_code"
|
||||
|
||||
//GrantTypeRefreshToken defines the grant_type `refresh_token` used for the Token Request in the Refresh Token Flow
|
||||
// GrantTypeRefreshToken defines the grant_type `refresh_token` used for the Token Request in the Refresh Token Flow
|
||||
GrantTypeRefreshToken GrantType = "refresh_token"
|
||||
|
||||
//GrantTypeClientCredentials defines the grant_type `client_credentials` used for the Token Request in the Client Credentials Token Flow
|
||||
// GrantTypeClientCredentials defines the grant_type `client_credentials` used for the Token Request in the Client Credentials Token Flow
|
||||
GrantTypeClientCredentials GrantType = "client_credentials"
|
||||
|
||||
//GrantTypeBearer defines the grant_type `urn:ietf:params:oauth:grant-type:jwt-bearer` used for the JWT Authorization Grant
|
||||
// GrantTypeBearer defines the grant_type `urn:ietf:params:oauth:grant-type:jwt-bearer` used for the JWT Authorization Grant
|
||||
GrantTypeBearer GrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
|
||||
|
||||
//GrantTypeTokenExchange defines the grant_type `urn:ietf:params:oauth:grant-type:token-exchange` used for the OAuth Token Exchange Grant
|
||||
// GrantTypeTokenExchange defines the grant_type `urn:ietf:params:oauth:grant-type:token-exchange` used for the OAuth Token Exchange Grant
|
||||
GrantTypeTokenExchange GrantType = "urn:ietf:params:oauth:grant-type:token-exchange"
|
||||
|
||||
//GrantTypeImplicit defines the grant type `implicit` used for implicit flows that skip the generation and exchange of an Authorization Code
|
||||
// GrantTypeImplicit defines the grant type `implicit` used for implicit flows that skip the generation and exchange of an Authorization Code
|
||||
GrantTypeImplicit GrantType = "implicit"
|
||||
|
||||
//ClientAssertionTypeJWTAssertion defines the client_assertion_type `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`
|
||||
//used for the OAuth JWT Profile Client Authentication
|
||||
// ClientAssertionTypeJWTAssertion defines the client_assertion_type `urn:ietf:params:oauth:client-assertion-type:jwt-bearer`
|
||||
// used for the OAuth JWT Profile Client Authentication
|
||||
ClientAssertionTypeJWTAssertion = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"
|
||||
)
|
||||
|
||||
var AllGrantTypes = []GrantType{
|
||||
GrantTypeCode, GrantTypeRefreshToken, GrantTypeClientCredentials,
|
||||
GrantTypeBearer, GrantTypeTokenExchange, GrantTypeImplicit,
|
||||
ClientAssertionTypeJWTAssertion}
|
||||
ClientAssertionTypeJWTAssertion,
|
||||
}
|
||||
|
||||
type GrantType string
|
||||
|
||||
|
@ -60,12 +61,12 @@ func (a *AccessTokenRequest) GrantType() GrantType {
|
|||
return GrantTypeCode
|
||||
}
|
||||
|
||||
//SetClientID implements op.AuthenticatedTokenRequest
|
||||
// SetClientID implements op.AuthenticatedTokenRequest
|
||||
func (a *AccessTokenRequest) SetClientID(clientID string) {
|
||||
a.ClientID = clientID
|
||||
}
|
||||
|
||||
//SetClientSecret implements op.AuthenticatedTokenRequest
|
||||
// SetClientSecret implements op.AuthenticatedTokenRequest
|
||||
func (a *AccessTokenRequest) SetClientSecret(clientSecret string) {
|
||||
a.ClientSecret = clientSecret
|
||||
}
|
||||
|
@ -85,12 +86,12 @@ func (a *RefreshTokenRequest) GrantType() GrantType {
|
|||
return GrantTypeRefreshToken
|
||||
}
|
||||
|
||||
//SetClientID implements op.AuthenticatedTokenRequest
|
||||
// SetClientID implements op.AuthenticatedTokenRequest
|
||||
func (a *RefreshTokenRequest) SetClientID(clientID string) {
|
||||
a.ClientID = clientID
|
||||
}
|
||||
|
||||
//SetClientSecret implements op.AuthenticatedTokenRequest
|
||||
// SetClientSecret implements op.AuthenticatedTokenRequest
|
||||
func (a *RefreshTokenRequest) SetClientSecret(clientSecret string) {
|
||||
a.ClientSecret = clientSecret
|
||||
}
|
||||
|
@ -148,55 +149,55 @@ func (j *JWTTokenRequest) GetCustomClaim(key string) interface{} {
|
|||
return j.private[key]
|
||||
}
|
||||
|
||||
//GetIssuer implements the Claims interface
|
||||
// GetIssuer implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetIssuer() string {
|
||||
return j.Issuer
|
||||
}
|
||||
|
||||
//GetAudience implements the Claims and TokenRequest interfaces
|
||||
// GetAudience implements the Claims and TokenRequest interfaces
|
||||
func (j *JWTTokenRequest) GetAudience() []string {
|
||||
return j.Audience
|
||||
}
|
||||
|
||||
//GetExpiration implements the Claims interface
|
||||
// GetExpiration implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetExpiration() time.Time {
|
||||
return time.Time(j.ExpiresAt)
|
||||
}
|
||||
|
||||
//GetIssuedAt implements the Claims interface
|
||||
// GetIssuedAt implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetIssuedAt() time.Time {
|
||||
return time.Time(j.IssuedAt)
|
||||
}
|
||||
|
||||
//GetNonce implements the Claims interface
|
||||
// GetNonce implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetNonce() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
//GetAuthenticationContextClassReference implements the Claims interface
|
||||
// GetAuthenticationContextClassReference implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetAuthenticationContextClassReference() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
//GetAuthTime implements the Claims interface
|
||||
// GetAuthTime implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetAuthTime() time.Time {
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
//GetAuthorizedParty implements the Claims interface
|
||||
// GetAuthorizedParty implements the Claims interface
|
||||
func (j *JWTTokenRequest) GetAuthorizedParty() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
//SetSignatureAlgorithm implements the Claims interface
|
||||
// SetSignatureAlgorithm implements the Claims interface
|
||||
func (j *JWTTokenRequest) SetSignatureAlgorithm(_ jose.SignatureAlgorithm) {}
|
||||
|
||||
//GetSubject implements the TokenRequest interface
|
||||
// GetSubject implements the TokenRequest interface
|
||||
func (j *JWTTokenRequest) GetSubject() string {
|
||||
return j.Subject
|
||||
}
|
||||
|
||||
//GetScopes implements the TokenRequest interface
|
||||
// GetScopes implements the TokenRequest interface
|
||||
func (j *JWTTokenRequest) GetScopes() []string {
|
||||
return j.Scopes
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue