oauth2

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenAuthClient

type GenAuthClient interface {
	RequestTokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...oauth2.RequestEditorFn) (*oauth2.RequestTokenResponse, error)
}

type Option

type Option func(*Service)

func WithAuthHeader

func WithAuthHeader(name, prefix string) Option

func WithClient

func WithClient(c GenAuthClient) Option

func WithTargetResolver

func WithTargetResolver(r TargetResolver) Option

type Service

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

func New

func New(cfg *config.Config, apiHTTP *http.Client, log *slog.Logger, opts ...Option) (*Service, error)

func (*Service) ClearCache

func (s *Service) ClearCache()

func (*Service) Editor

func (s *Service) Editor() authenticator.RequestEditor

func (*Service) Init

func (s *Service) Init(_ context.Context) error

func (*Service) Name

func (s *Service) Name() string

func (*Service) RetrieveTokenForAPI

func (s *Service) RetrieveTokenForAPI(ctx context.Context, target string) (string, error)

func (*Service) Token

func (s *Service) Token(ctx context.Context, target string) (string, error)

type TargetResolver

type TargetResolver func(*http.Request) string

Jump to

Keyboard shortcuts

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