authorizer

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 6 modules, 8 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

This section is empty.

Types

type Command

type Command struct {
	OAuthConfig
	AuthFlow    string                        `json:"authFlow"`
	Scopes      []string                      `json:"scopes"`
	Secrets     map[string]string             `json:"secrets"`
	SecretsURL  string                        `json:"secretsURL"`
	UsePKCE     bool                          `json:"usePKCE"`
	NewEndpoint func() (flow.Endpoint, error) `json:"-" yaml:"-"`
}

Command represents a command to authorize

type OAuthConfig added in v0.23.0

type OAuthConfig struct {
	Config    *oauth2.Config `json:"config"`
	ConfigURL string         `json:"configURL"`
}

type Service

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

Service is a secretsService that provides authorization functionality

func New

func New() *Service

func (*Service) Authorize

func (s *Service) Authorize(ctx context.Context, command *Command) (*oauth2.Token, error)

Authorize authorizes a command using the provided context and command

func (*Service) AuthorizeSessionTokenPayload added in v0.30.0

func (s *Service) AuthorizeSessionTokenPayload(ctx context.Context, command *Command) (*SessionTokenPayload, error)

AuthorizeSessionTokenPayload performs authorization and normalizes the result into a serializable token payload for downstream session establishment.

func (*Service) EnsureConfig added in v0.23.0

func (s *Service) EnsureConfig(ctx context.Context, config *OAuthConfig) error

func (*Service) IDClient added in v0.25.0

func (s *Service) IDClient(ctx context.Context, command *Command) (*http.Client, error)

IDClient returns identity token HTTP config

func (*Service) RefreshToken added in v0.25.0

func (s *Service) RefreshToken(ctx context.Context, refreshToken *oauth2.Token, config *OAuthConfig) (*oauth2.Token, error)

RefreshToken refresh token using the provided context, refresh token, and config

type SessionTokenPayload added in v0.30.0

type SessionTokenPayload struct {
	AccessToken  string
	IDToken      string
	RefreshToken string
	ExpiresAt    string
}

SessionTokenPayload is a transport-friendly representation of an OAuth token bundle suitable for handing off to another trusted service for session creation and token persistence.

Jump to

Keyboard shortcuts

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