oauth

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenToHeader

func TokenToHeader(token string) http.Header

Types

type AuthorizationError

type AuthorizationError struct{}

func (*AuthorizationError) Error

func (e *AuthorizationError) Error() string

type ErrorInvalidPayload

type ErrorInvalidPayload struct {
	// contains filtered or unexported fields
}

func NewErrorInvalidPayload

func NewErrorInvalidPayload(message string) *ErrorInvalidPayload

func (*ErrorInvalidPayload) Error

func (e *ErrorInvalidPayload) Error() string

func (*ErrorInvalidPayload) Unwrap

func (e *ErrorInvalidPayload) Unwrap() error

type IntrospectResponse

type IntrospectResponse struct {
	Status  string                         `json:"status"`
	Data    user.OAuthUserImplementationV2 `json:"data"`
	Message string                         `json:"message"`
}

type OAuthServicesConfig

type OAuthServicesConfig struct {
	Client           http.Config
	ClientId         string
	ClientSecret     string
	IntrospectRoute  string
	AuthorizeRoute   string
	TokenRoute       string
	LogoutRoute      string
	RedirectRoute    string
	PermissionsRoute string
	Scope            string
}

type Service added in v1.2.0

type Service struct {
	RoleSystem permissions.RoleSystem
	// contains filtered or unexported fields
}

func New

func New(config OAuthServicesConfig, cache cache.Cache) *Service

func (*Service) GetAllRoles added in v1.2.0

func (s *Service) GetAllRoles(token string) (permissions.RoleSystem, error)

func (*Service) GetAuthorizeRoute added in v1.2.0

func (s *Service) GetAuthorizeRoute() string

func (*Service) GetLogoutRoute added in v1.2.0

func (s *Service) GetLogoutRoute(intended string) string

func (*Service) GetTokenFromAuthorizationCode added in v1.2.0

func (s *Service) GetTokenFromAuthorizationCode(code string) (string, error)

func (*Service) Introspect added in v1.2.0

func (s *Service) Introspect(token string) (user.User, error)

func (*Service) MustInvalidateRolesCache added in v1.2.0

func (s *Service) MustInvalidateRolesCache() error

type UnauthorizedError

type UnauthorizedError struct{}

func (*UnauthorizedError) Error

func (e *UnauthorizedError) Error() string

func (*UnauthorizedError) Unwrap

func (e *UnauthorizedError) Unwrap() error

type UnknownError

type UnknownError struct {
	// contains filtered or unexported fields
}

func NewUnknownError

func NewUnknownError(message string) *UnknownError

func (*UnknownError) Error

func (e *UnknownError) Error() string

func (*UnknownError) Unwrap

func (e *UnknownError) Unwrap() error

Jump to

Keyboard shortcuts

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