shared

package
v0.0.0-...-3c34c2e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 ConfigurationAuth

type ConfigurationAuth struct {
	Enabled bool
	Type    string
	Path    string
}

type ConfigurationExtensions

type ConfigurationExtensions struct {
	JWT         bool
	CookieJWT   bool
	UsersCreate bool
}

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

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

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 (a Response) Authenticated() bool

func (Response) GetHeaders

func (a Response) GetHeaders() []*pbEnvoyCoreV3.HeaderValueOption

type ResponseAuth

type ResponseAuth struct {
	User  string
	Roles []string

	Token *string
}

func (*ResponseAuth) Hash

func (a *ResponseAuth) Hash() string

type Token

type Token string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL