Documentation
¶
Index ¶
- Constants
- func ExtractRequestCookies(request *pbEnvoyAuthV3.CheckRequest) util.Filter[*goHttp.Cookie]
- func FilterCookiesHeader(cookies []*goHttp.Cookie, filter ...func(cookie *goHttp.Cookie) bool) []*pbEnvoyCoreV3.HeaderValueOption
- func NewCustomStaticResponse(in *pbEnvoyAuthV3.CheckResponse) error
- type AuthHandler
- type Configuration
- type ConfigurationAuth
- type ConfigurationExtensions
- type CustomResponse
- type CustomStaticResponse
- type DeniedMessage
- type DeniedResponse
- type Factory
- type FactoryGen
- type Helper
- type HelperFunc
- type HelperInterface
- type Response
- type ResponseAuth
- type Token
Constants ¶
View Source
const ( Name = "envoy.auth.v3" AuthConfigKeywordTrue = "true" AuthConfigKeywordFalse = "false" AuthConfigNamespace = "platform.arangodb.com" AuthConfigAuthNamespace = "auth." + AuthConfigNamespace AuthConfigTypeKey = AuthConfigNamespace + "/type" AuthConfigTypeValue = "ArangoDBPlatform" AuthConfigAuthRequiredKey = AuthConfigAuthNamespace + "/required" AuthConfigAuthPassModeKey = AuthConfigAuthNamespace + "/pass_mode" AuthUsernameHeader = "arangodb-platform-user" AuthAuthenticatedHeader = "arangodb-platform-authenticated" AuthorizationHeader = "Authorization" CookieHeader = "Cookie" DefaultLifetime = time.Minute * 5 DefaultTTL = time.Minute )
Variables ¶
This section is empty.
Functions ¶
func ExtractRequestCookies ¶
func ExtractRequestCookies(request *pbEnvoyAuthV3.CheckRequest) util.Filter[*goHttp.Cookie]
func FilterCookiesHeader ¶
func FilterCookiesHeader(cookies []*goHttp.Cookie, filter ...func(cookie *goHttp.Cookie) bool) []*pbEnvoyCoreV3.HeaderValueOption
func NewCustomStaticResponse ¶
func NewCustomStaticResponse(in *pbEnvoyAuthV3.CheckResponse) error
Types ¶
type AuthHandler ¶
type AuthHandler interface {
Handle(ctx context.Context, request *pbEnvoyAuthV3.CheckRequest, current *Response) error
}
type Configuration ¶
type Configuration struct {
Enabled bool
integrationsShared.Endpoint
integrationsShared.Database
Extensions ConfigurationExtensions
Auth ConfigurationAuth
}
type ConfigurationAuth ¶
type ConfigurationExtensions ¶
type CustomResponse ¶
type CustomResponse interface {
Response() (*pbEnvoyAuthV3.CheckResponse, error)
}
type CustomStaticResponse ¶
type CustomStaticResponse struct {
CheckResponse *pbEnvoyAuthV3.CheckResponse
}
func (CustomStaticResponse) Error ¶
func (d CustomStaticResponse) Error() string
func (CustomStaticResponse) Response ¶
func (d CustomStaticResponse) Response() (*pbEnvoyAuthV3.CheckResponse, error)
type DeniedMessage ¶
type DeniedMessage struct {
Message string `json:"message,omitempty"`
}
type DeniedResponse ¶
type DeniedResponse struct {
Code int32
Headers map[string]string
Message *DeniedMessage
}
func (DeniedResponse) Error ¶
func (d DeniedResponse) Error() string
func (DeniedResponse) Response ¶
func (d DeniedResponse) Response() (*pbEnvoyAuthV3.CheckResponse, error)
type Factory ¶
type Factory interface {
Render(ctx context.Context, configuration Configuration) AuthHandler
}
func NewFactory ¶
func NewFactory(gen ...FactoryGen) Factory
type FactoryGen ¶
type FactoryGen func(ctx context.Context, configuration Configuration) (AuthHandler, bool)
type Helper ¶
type Helper[K comparable] cache.Cache[K, Token]
func NewHelper ¶
func NewHelper[K comparable](f HelperFunc[K]) Helper[K]
func NewHelperInterface ¶
func NewHelperInterface[K comparable](f HelperInterface[K]) Helper[K]
type HelperFunc ¶
type HelperFunc[K comparable] func(ctx context.Context, in K) (Token, error)
type HelperInterface ¶
type HelperInterface[K comparable] interface { Token(ctx context.Context, in K) (Token, error) }
type Response ¶
type Response struct {
User *ResponseAuth
Headers, ResponseHeaders []*pbEnvoyCoreV3.HeaderValueOption
}
func (Response) AsResponse ¶
func (a Response) AsResponse() *pbEnvoyAuthV3.CheckResponse
func (Response) Authenticated ¶
func (Response) GetHeaders ¶
func (a Response) GetHeaders() []*pbEnvoyCoreV3.HeaderValueOption
type ResponseAuth ¶
func (*ResponseAuth) Hash ¶
func (a *ResponseAuth) Hash() string
Click to show internal directories.
Click to hide internal directories.