server

package
v0.59.134 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClaims

func GetClaims(ctx context.Context) (*types.TokenClaims, bool)

GetClaims extracts OAuth claims from a request context

func HasScope

func HasScope(ctx context.Context, requiredScope string) bool

HasScope checks if the current request has a specific OAuth scope

func RequireScope

func RequireScope(scope string) func(http.Handler) http.Handler

RequireScope creates a middleware that requires a specific OAuth scope

Types

type OAuth2Server

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

OAuth2Server implements an OAuth 2.1 resource server

func NewOAuth2Server

func NewOAuth2Server(config *types.OAuth2Config, baseURL string, logger *logrus.Logger) (*OAuth2Server, error)

NewOAuth2Server creates a new OAuth 2.1 server

func (*OAuth2Server) AuthenticateRequest

func (s *OAuth2Server) AuthenticateRequest(ctx context.Context, r *http.Request) *types.AuthenticationResult

AuthenticateRequest authenticates an HTTP request using OAuth 2.1

func (*OAuth2Server) CreateMiddleware

func (s *OAuth2Server) CreateMiddleware() func(http.Handler) http.Handler

CreateMiddleware creates an HTTP middleware for OAuth 2.1 authentication

func (*OAuth2Server) RegisterHandlers

func (s *OAuth2Server) RegisterHandlers(mux *http.ServeMux)

RegisterHandlers registers OAuth 2.1 endpoints with an HTTP mux

Jump to

Keyboard shortcuts

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