Documentation ¶
Index ¶
- func HasRoles(holder TokenRoles, clientId string, roles ...string) bool
- func WithJwtContext(ctx context.Context, realmUrl string, jwtContext JwtContext) context.Context
- func WithJwtContextStorage(ctx context.Context) context.Context
- type JwtContext
- type JwtContextImpl
- func (c *JwtContextImpl) ExchangeToken(ctx context.Context, token string, fromClient string, toClient string) (*oauth2.Token, error)deprecated
- func (c *JwtContextImpl) ExchangeTokenWithConfig(ctx context.Context, token string, toClient string, oauthConfig oauth2.Config) (*oauth2.Token, error)deprecated
- func (c *JwtContextImpl) GetToken(ctx context.Context, client string, username string, pwd string) (*oauth2.Token, error)
- func (c *JwtContextImpl) GetTokenFromLiteralAccessToken(ctx context.Context, literalAccessToken, clientId string, ...) (*oauth2.Token, error)
- func (c *JwtContextImpl) GetTokenFromLiteralAccessTokenWithConfig(ctx context.Context, literalAccessToken string, withOfflineRefresh bool, ...) (*oauth2.Token, error)
- func (c *JwtContextImpl) OAuthConfig(ctx context.Context, clientId string, clientSecret string) (*oauth2.Config, error)
- func (c *JwtContextImpl) OAuthEndpoint(ctx context.Context) (*oauth2.Endpoint, error)
- func (c *JwtContextImpl) RefreshToken(ctx context.Context, refreshToken string, client string) (*oauth2.Token, error)
- func (c *JwtContextImpl) RefreshTokenWithConfig(ctx context.Context, refreshToken string, oauthConfig oauth2.Config) (*oauth2.Token, error)
- func (c *JwtContextImpl) Sourcify(ctx context.Context, token *oauth2.Token, client string) (oauth2.TokenSource, error)
- func (c *JwtContextImpl) VerifyToken(ctx context.Context, token string, clientId string) (TokenRoles, error)
- func (c *JwtContextImpl) VerifyTokenWithConfig(ctx context.Context, token string, config oidc.Config) (TokenRoles, error)
- type TokenRoles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithJwtContext ¶
Types ¶
type JwtContext ¶
type JwtContext interface { VerifyTokenWithConfig(ctx context.Context, token string, config oidc.Config) (TokenRoles, error) VerifyToken(ctx context.Context, token string, clientId string) (TokenRoles, error) OAuthConfig(ctx context.Context, clientId string, clientSecret string) (*oauth2.Config, error) ExchangeToken(ctx context.Context, token string, fromClient string, toClient string) (*oauth2.Token, error) ExchangeTokenWithConfig(ctx context.Context, token string, toClient string, oauthConfig oauth2.Config) (*oauth2.Token, error) GetToken(ctx context.Context, client string, username string, pwd string) (*oauth2.Token, error) GetTokenFromLiteralAccessToken(ctx context.Context, literalAccessToken, clientId string, withOfflineRefresh bool) (*oauth2.Token, error) GetTokenFromLiteralAccessTokenWithConfig(ctx context.Context, literalAccessToken string, withOfflineRefresh bool, oauthConfig oauth2.Config) (*oauth2.Token, error) RefreshToken(ctx context.Context, refreshToken string, client string) (*oauth2.Token, error) RefreshTokenWithConfig(ctx context.Context, refreshToken string, oauthConfig oauth2.Config) (*oauth2.Token, error) Sourcify(ctx context.Context, token *oauth2.Token, client string) (oauth2.TokenSource, error) OAuthEndpoint(ctx context.Context) (*oauth2.Endpoint, error) }
func JwtContextFromContext ¶
func JwtContextFromContext(ctx context.Context, realmUrl string) JwtContext
type JwtContextImpl ¶
func (*JwtContextImpl) ExchangeToken
deprecated
func (*JwtContextImpl) GetTokenFromLiteralAccessToken ¶
func (*JwtContextImpl) GetTokenFromLiteralAccessTokenWithConfig ¶
func (*JwtContextImpl) OAuthConfig ¶
func (*JwtContextImpl) OAuthEndpoint ¶
func (*JwtContextImpl) RefreshToken ¶
func (*JwtContextImpl) RefreshTokenWithConfig ¶
func (*JwtContextImpl) Sourcify ¶
func (c *JwtContextImpl) Sourcify(ctx context.Context, token *oauth2.Token, client string) (oauth2.TokenSource, error)
func (*JwtContextImpl) VerifyToken ¶
func (c *JwtContextImpl) VerifyToken(ctx context.Context, token string, clientId string) (TokenRoles, error)
func (*JwtContextImpl) VerifyTokenWithConfig ¶
func (c *JwtContextImpl) VerifyTokenWithConfig(ctx context.Context, token string, config oidc.Config) (TokenRoles, error)
type TokenRoles ¶
func TokenRolesFromKeycloakTokenPayload ¶
func TokenRolesFromKeycloakTokenPayload(oidcToken *oidc.IDToken) (TokenRoles, error)
Click to show internal directories.
Click to hide internal directories.