Documentation ¶
Index ¶
- Constants
- func ExtractToken(request *http.Request) string
- func GetOidcTokenCtx(ctx context.Context) *oidc.IDToken
- func GetOidcTokenReq(r *http.Request) *oidc.IDToken
- func GetOidcTokenStrCtx(ctx context.Context) string
- func GetOidcTokenStrReq(r *http.Request) string
- func JwtAuth(ctx context.Context, jwtToken string, oidcConfig OIDCConfig) (token *oidc.IDToken, err error)
- func UseAuth(next http.HandlerFunc) http.HandlerFunc
- func UseIdToken(next http.HandlerFunc) http.HandlerFunc
- func UseOidcToken(next http.HandlerFunc, oidcConfig OIDCConfig) http.HandlerFunc
- func UseOidcTokenStr(next http.HandlerFunc) http.HandlerFunc
- type IdToken
- type OIDCConfig
Constants ¶
View Source
const IdTokenKey = "idToken"
View Source
const OidcTokenKey = "oidcToken"
View Source
const OidcTokenStrKey = "oidcTokenStr"
Variables ¶
This section is empty.
Functions ¶
func ExtractToken ¶
func GetOidcTokenCtx ¶
func GetOidcTokenReq ¶
func GetOidcTokenStrCtx ¶
func GetOidcTokenStrReq ¶
func JwtAuth ¶
func JwtAuth(ctx context.Context, jwtToken string, oidcConfig OIDCConfig) (token *oidc.IDToken, err error)
func UseAuth ¶
func UseAuth(next http.HandlerFunc) http.HandlerFunc
func UseIdToken ¶
func UseIdToken(next http.HandlerFunc) http.HandlerFunc
func UseOidcToken ¶
func UseOidcToken(next http.HandlerFunc, oidcConfig OIDCConfig) http.HandlerFunc
func UseOidcTokenStr ¶
func UseOidcTokenStr(next http.HandlerFunc) http.HandlerFunc
Types ¶
type IdToken ¶
type IdToken struct { // this is used for identification Subject string `json:"sub"` // candidate for docker user name PreferredUsername string `json:"preferred_username"` // candidate for docker user name Email string `json:"email"` Name string `json:"name"` }
IdToken harbour expects
func GetIdTokenCtx ¶
func GetIdTokenReq ¶
func IdTokenFromToken ¶
IdTokenFromToken transforms a oidc.IDToken to a harbour IDToken
type OIDCConfig ¶
OIDCConfig is the required minimum for token validation
func DefaultConfig ¶
func DefaultConfig() OIDCConfig
func ParseViperConfig ¶
func ParseViperConfig() OIDCConfig
ParseViperConfig tries to map a viper configuration
Click to show internal directories.
Click to hide internal directories.