Documentation ¶
Index ¶
- Constants
- Variables
- func BadRequestError(errorDescription string) api.Error
- func ErrorWithErrorDescription(e string, err error) api.Error
- func ErrorWithoutDescription(err string) api.Error
- func InternalServerError(errorDescription string) api.Error
- func InvalidTokenError(errorDescription string) api.Error
- func OIDCError(oidcError, oidcErrorDescription string) api.Error
- func OIDCErrorFromBody(body []byte) (apiError api.Error, ok bool)
- func OIDCFlowIsInSlice(f OIDCFlow, s []OIDCFlow) bool
- type AudienceConf
- type GrantType
- func (g GrantType) AddToSliceIfNotFound(s *[]GrantType)
- func (g GrantType) MarshalJSON() ([]byte, error)
- func (g *GrantType) String() string
- func (g *GrantType) UnmarshalJSON(data []byte) error
- func (g *GrantType) UnmarshalText(data []byte) error
- func (g *GrantType) UnmarshalYAML(value *yaml.Node) error
- func (g *GrantType) Valid() bool
- type IPParseResult
- type KeyValue
- type KeyValues
- type OIDCFlow
- type Provider
- type Response
- type ResponseType
- func (r ResponseType) AddToSliceIfNotFound(s *[]ResponseType)
- func (r ResponseType) MarshalJSON() ([]byte, error)
- func (r *ResponseType) Scan(src interface{}) error
- func (r *ResponseType) String() string
- func (r *ResponseType) UnmarshalJSON(data []byte) error
- func (r *ResponseType) UnmarshalYAML(value *yaml.Node) error
- func (r *ResponseType) Valid() bool
- func (r ResponseType) Value() (driver.Value, error)
- type RestrictionClaim
- func (rc RestrictionClaim) MarshalJSON() ([]byte, error)
- func (rc *RestrictionClaim) String() string
- func (rc *RestrictionClaim) UnmarshalJSON(data []byte) error
- func (rc *RestrictionClaim) UnmarshalText(data []byte) error
- func (rc *RestrictionClaim) UnmarshalYAML(value *yaml.Node) error
- func (rc *RestrictionClaim) Valid() bool
- type RestrictionClaims
- type TokeninfoAction
- func (a TokeninfoAction) AddToSliceIfNotFound(s *[]TokeninfoAction)
- func (a TokeninfoAction) MarshalJSON() ([]byte, error)
- func (a *TokeninfoAction) String() string
- func (a *TokeninfoAction) UnmarshalJSON(data []byte) error
- func (a *TokeninfoAction) UnmarshalYAML(value *yaml.Node) error
- func (a *TokeninfoAction) Valid() bool
Constants ¶
const ( AttrScope = "scope" AttrAud = "audience" AttrCapability = "capability" )
Defined attributes
const ( AudienceParameterAudience = "audience" AudienceParameterResource = "resource" )
Constants for audience parameters
Variables ¶
var AllGrantTypes = api.AllGrantTypes
AllGrantTypes holds all defined GrantType strings
var AllRestrictionClaimStrings = api.AllRestrictionClaims
AllRestrictionClaimStrings holds all defined RestrictionClaim strings
var AllTokeninfoActions = api.AllTokeninfoActions
AllTokeninfoActions holds all defined TokenInfo strings
var Attributes = []string{ AttrScope, AttrAud, AttrCapability, }
Attributes holds all defined attributes
var ResponseNYI = Response{ Status: fiber.StatusNotImplemented, Response: api.ErrorNYI, }
ResponseNYI is the server response when something is not yet implemented
Functions ¶
func BadRequestError ¶ added in v0.10.0
func BadRequestError(errorDescription string) api.Error
BadRequestError creates an Error for bad request errors
func ErrorWithErrorDescription ¶ added in v0.10.0
ErrorWithErrorDescription creates an Error from an error string and golang error
func ErrorWithoutDescription ¶ added in v0.10.0
func ErrorWithoutDescription(err string) api.Error
ErrorWithoutDescription creates an Error from an error string
func InternalServerError ¶ added in v0.10.0
func InternalServerError(errorDescription string) api.Error
InternalServerError creates an Error for internal server errors
func InvalidTokenError ¶ added in v0.10.0
func InvalidTokenError(errorDescription string) api.Error
InvalidTokenError creates an Error for invalid token errors
func OIDCError ¶ added in v0.10.0
func OIDCError(oidcError, oidcErrorDescription string) api.Error
OIDCError creates an Error for oidc related errors
func OIDCErrorFromBody ¶ added in v0.10.0
OIDCErrorFromBody creates an Error for oidc related errors from the response of an oidc provider
func OIDCFlowIsInSlice ¶ added in v0.10.0
OIDCFlowIsInSlice checks if a OIDCFlow is present in a slice of OIDCFlows
Types ¶
type AudienceConf ¶ added in v0.10.0
type AudienceConf struct { RFC8707 bool `yaml:"use_rfc8707"` RequestParameter string `yaml:"request_parameter"` SpaceSeparateAuds bool `yaml:"space_separate_auds"` }
AudienceConf is a type for holding configuration about audience
type GrantType ¶ added in v0.10.0
type GrantType int
GrantType is an enum like type for grant types
const ( GrantTypeMytoken GrantType = iota GrantTypeOIDCFlow GrantTypePollingCode GrantTypeTransferCode GrantTypeSSH )
GrantTypes
func NewGrantType ¶ added in v0.10.0
NewGrantType creates a new GrantType from the grant type string
func (GrantType) AddToSliceIfNotFound ¶ added in v0.10.0
AddToSliceIfNotFound adds the GrantType to a slice s if it is not already there
func (GrantType) MarshalJSON ¶ added in v0.10.0
MarshalJSON implements the json.Marshaler interface
func (*GrantType) UnmarshalJSON ¶ added in v0.10.0
UnmarshalJSON implements the json.Unmarshaler interface
func (*GrantType) UnmarshalText ¶ added in v0.10.0
UnmarshalText implements the encoding.TextUnmarshaler interface
func (*GrantType) UnmarshalYAML ¶ added in v0.10.0
UnmarshalYAML implements the yaml.Unmarshaler interface
type IPParseResult ¶ added in v0.10.0
IPParseResult holds the result of ip parsing
type OIDCFlow ¶ added in v0.10.0
type OIDCFlow int
OIDCFlow is an enum like type for oidc flows
func NewOIDCFlow ¶ added in v0.10.0
NewOIDCFlow creates a new OIDCFlow from the flow string
func (OIDCFlow) AddToSliceIfNotFound ¶ added in v0.10.0
AddToSliceIfNotFound adds the OIDCFlow to a slice s if it is not already there
func (OIDCFlow) MarshalJSON ¶ added in v0.10.0
MarshalJSON implements the json.Marshaler interface
func (*OIDCFlow) UnmarshalJSON ¶ added in v0.10.0
UnmarshalJSON implements the json.Unmarshaler interface
func (*OIDCFlow) UnmarshalYAML ¶ added in v0.10.0
UnmarshalYAML implements the yaml.Unmarshaler interface
type Provider ¶ added in v0.10.0
type Provider interface { Name() string Issuer() string ClientID() string Scopes() []string Endpoints() *oauth2x.Endpoints Audience() *AudienceConf MaxMytokenLifetime() int64 AddClientAuthentication(r *resty.Request, endpoint string) *resty.Request GetAuthorizationURL( rlog log.Ext1FieldLogger, state, pkceChallenge string, scopeRestrictions, audRestrictions []string, ) (string, error) }
Provider is an interface type for OIDC providers
type Response ¶
type Response struct { // The Http Status code of the response Status int // The response body, will be marshalled as json Response interface{} // Cookies that should be set Cookies []*fiber.Cookie }
Response models a http server response
func BadRequestErrorResponse ¶ added in v0.10.0
BadRequestErrorResponse returns a error response for a not found error
func ErrorToBadRequestErrorResponse ¶
ErrorToBadRequestErrorResponse creates a bad request error response from a golang error
func ErrorToInternalServerErrorResponse ¶
ErrorToInternalServerErrorResponse creates an internal server error response from a golang error
func NotFoundErrorResponse ¶ added in v0.10.0
NotFoundErrorResponse returns a error response for a not found error
type ResponseType ¶ added in v0.10.0
type ResponseType int
ResponseType is an enum like type for response types
const ( ResponseTypeToken ResponseType = iota ResponseTypeShortToken ResponseTypeTransferCode )
ResponseTypes
func NewResponseType ¶ added in v0.10.0
func NewResponseType(s string) ResponseType
NewResponseType creates a new ResponseType from the given response type string
func (ResponseType) AddToSliceIfNotFound ¶ added in v0.10.0
func (r ResponseType) AddToSliceIfNotFound(s *[]ResponseType)
AddToSliceIfNotFound adds the ResponseType to a slice s if it is not already there
func (ResponseType) MarshalJSON ¶ added in v0.10.0
func (r ResponseType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*ResponseType) Scan ¶ added in v0.10.0
func (r *ResponseType) Scan(src interface{}) error
Scan implements the sql.Scanner interface.
func (*ResponseType) String ¶ added in v0.10.0
func (r *ResponseType) String() string
func (*ResponseType) UnmarshalJSON ¶ added in v0.10.0
func (r *ResponseType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
func (*ResponseType) UnmarshalYAML ¶ added in v0.10.0
func (r *ResponseType) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface
func (*ResponseType) Valid ¶ added in v0.10.0
func (r *ResponseType) Valid() bool
Valid checks that ResponseType is a defined flow
type RestrictionClaim ¶ added in v0.5.0
type RestrictionClaim int
RestrictionClaim is an enum like type for restriction keys
const ( RestrictionClaimNotBefore RestrictionClaim = iota RestrictionClaimExpiresAt RestrictionClaimScope RestrictionClaimAudiences RestrictionClaimHosts RestrictionClaimGeoIPAllow RestrictionClaimGeoIPDisallow RestrictionClaimUsagesAT RestrictionClaimUsagesOther )
RestrictionClaims
func NewRestrictionClaim ¶ added in v0.5.0
func NewRestrictionClaim(s string) RestrictionClaim
NewRestrictionClaim creates a new RestrictionClaim from the grant type string
func (RestrictionClaim) MarshalJSON ¶ added in v0.5.0
func (rc RestrictionClaim) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*RestrictionClaim) String ¶ added in v0.5.0
func (rc *RestrictionClaim) String() string
func (*RestrictionClaim) UnmarshalJSON ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
func (*RestrictionClaim) UnmarshalText ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface
func (*RestrictionClaim) UnmarshalYAML ¶ added in v0.5.0
func (rc *RestrictionClaim) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface
func (*RestrictionClaim) Valid ¶ added in v0.5.0
func (rc *RestrictionClaim) Valid() bool
Valid checks that RestrictionClaim is a defined grant type
type RestrictionClaims ¶ added in v0.5.0
type RestrictionClaims []RestrictionClaim
RestrictionClaims is a slice of RestrictionClaim
var AllRestrictionClaims RestrictionClaims
AllRestrictionClaims holds all defined RestrictionClaims
func (RestrictionClaims) Disable ¶ added in v0.5.0
func (rks RestrictionClaims) Disable(disable RestrictionClaims) (left RestrictionClaims)
Disable subtracts the passed RestrictionClaims from this RestrictionClaims and returns the left RestrictionClaims
func (RestrictionClaims) Has ¶ added in v0.5.0
func (rks RestrictionClaims) Has(rk RestrictionClaim) bool
Has checks if a RestrictionClaim is in a RestrictionClaims
type TokeninfoAction ¶ added in v0.10.0
type TokeninfoAction int
TokeninfoAction is an enum like type for tokeninfo actions
const ( TokeninfoActionIntrospect TokeninfoAction = iota TokeninfoActionEventHistory TokeninfoActionSubtokenTree TokeninfoActionListMytokens TokeninfoActionNotifications )
TokeninfoActions
func NewTokeninfoAction ¶ added in v0.10.0
func NewTokeninfoAction(s string) TokeninfoAction
NewTokeninfoAction creates a new TokeninfoAction from the tokeninfo action string
func (TokeninfoAction) AddToSliceIfNotFound ¶ added in v0.10.0
func (a TokeninfoAction) AddToSliceIfNotFound(s *[]TokeninfoAction)
AddToSliceIfNotFound adds the TokeninfoAction to a slice s if it is not already there
func (TokeninfoAction) MarshalJSON ¶ added in v0.10.0
func (a TokeninfoAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (*TokeninfoAction) String ¶ added in v0.10.0
func (a *TokeninfoAction) String() string
func (*TokeninfoAction) UnmarshalJSON ¶ added in v0.10.0
func (a *TokeninfoAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface
func (*TokeninfoAction) UnmarshalYAML ¶ added in v0.10.0
func (a *TokeninfoAction) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the yaml.Unmarshaler interface
func (*TokeninfoAction) Valid ¶ added in v0.10.0
func (a *TokeninfoAction) Valid() bool
Valid checks that TokeninfoAction is a defined tokeninfo action