clientmanager

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotFound = errors.New("client not found")
)

Functions

This section is empty.

Types

type ClientMetadata

type ClientMetadata struct {
	ID                      string
	Name                    string
	URI                     string
	RedirectURIs            []string
	GrantTypes              []string
	ResponseTypes           []string
	Scope                   string
	LogoURI                 string
	Contacts                []string
	TermsOfServiceURI       string
	PolicyURI               string
	JSONWebKeysURI          string
	JSONWebKeys             map[string]interface{}
	SoftwareID              string
	SoftwareVersion         string
	TokenEndpointAuthMethod string
}

ClientMetadata contains the metadata for an OAuth2 client.

type Config

type Config struct {
	Store          store
	ProfileService profileService
}

Config defines configuration for client manager.

type Manager

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

Manager implements functionality to manage OAuth2 clients.

func New

func New(config *Config) *Manager

New creates a new Manager instance.

func (*Manager) Create

func (m *Manager) Create(
	ctx context.Context,
	profileID, profileVersion string,
	data *ClientMetadata,
) (*oauth2client.Client, error)

Create creates an OAuth2 client and inserts it into the store.

func (*Manager) Get added in v1.2.0

func (m *Manager) Get(ctx context.Context, id string) (fosite.Client, error)

Get returns the fosite client with the given id.

type ServiceInterface

type ServiceInterface interface {
	Create(ctx context.Context, profileID, profileVersion string, data *ClientMetadata) (*oauth2client.Client, error) //nolint:lll // *rfc7591.Error
	Get(ctx context.Context, id string) (fosite.Client, error)
}

ServiceInterface defines an interface for OAuth2 client manager.

Jump to

Keyboard shortcuts

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