auth

package
v1.3.0-rc.0...-ffe52cf Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAuthorization                = "Authorization"
	HeaderAuthorizationBearerPrefix    = "Bearer "
	HeaderAuthorizationBasicAuthPrefix = "Basic "
)
View Source
const (
	LOGIN checkType = iota
	TRY_LOGIN
	BASICAUTH
	TOKEN
	NONE
)
View Source
const (
	CtxKeyOauth2JwtKeyPayload = "oauth2-jwt-token-payload"
)

Variables

This section is empty.

Functions

func GetSessionRefresh

func GetSessionRefresh(ctx context.Context) *identitypb.SessionRefresh

func WithSessionRefresh

func WithSessionRefresh(ctx context.Context, refresh *identitypb.SessionRefresh) context.Context

Types

type Auth

type Auth struct {
	UserAuth     domain.UserAuthFacade
	OAuth2Server *oauth2.OAuth2Server
	TokenService tokenpb.TokenServiceServer
	Settings     settings.OpenapiSettings
}

func NewAuth

func NewAuth(oauth2server *oauth2.OAuth2Server, token tokenpb.TokenServiceServer,
	settings settings.OpenapiSettings) (*Auth, error)

func (*Auth) Auth

func (a *Auth) Auth(spec *spec.Spec, req *http.Request) domain.UserAuthResult

type OAuth2APISpec

type OAuth2APISpec interface {
	MatchPath(path string) bool
	PathVars(temp, path string) map[string]string
	Method() string
	Scheme() string
}

OAuth2APISpec .

type OpenapiSpec

type OpenapiSpec struct {
	*spec.Spec
}

OpenapiSpec .

func (*OpenapiSpec) MatchPath

func (s *OpenapiSpec) MatchPath(path string) bool

func (*OpenapiSpec) Method

func (s *OpenapiSpec) Method() string

func (*OpenapiSpec) PathVars

func (s *OpenapiSpec) PathVars(template, path string) map[string]string

func (*OpenapiSpec) Scheme

func (s *OpenapiSpec) Scheme() string

type TokenClient

type TokenClient struct {
	ClientID   string
	ClientName string
}

func VerifyAccessKey

func VerifyAccessKey(tokenService tokenpb.TokenServiceServer, r *http.Request) (TokenClient, error)

func VerifyOpenapiOAuth2Token

func VerifyOpenapiOAuth2Token(o *oauth2.OAuth2Server, spec OAuth2APISpec, r *http.Request) (TokenClient, error)

Jump to

Keyboard shortcuts

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