dcr

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	AuthorizationEndpoint string    `json:"authorizationEndpoint,omitempty"`
	AuthorizationServer   string    `json:"authorizationServer,omitempty"`
	ClientID              string    `json:"clientId,omitempty"`
	ClientName            string    `json:"clientName,omitempty"`
	ProviderName          string    `json:"providerName"`
	RedirectURI           string    `json:"redirectUri,omitempty"`
	RegisteredAt          time.Time `json:"registeredAt"`
	RequiredScopes        []string  `json:"requiredScopes,omitempty"`
	ResourceURL           string    `json:"resourceUrl,omitempty"`
	ScopesSupported       []string  `json:"scopesSupported,omitempty"`
	ServerName            string    `json:"serverName"`
	TokenEndpoint         string    `json:"tokenEndpoint,omitempty"`
}

Client represents a dynamically registered OAuth client Simplified from Pinata - removed State field (not needed for CE mode)

func DiscoverAndRegister added in v0.40.4

func DiscoverAndRegister(ctx context.Context, serverName string, scopes string, redirectURI string) (Client, error)

DiscoverAndRegister performs OAuth discovery and DCR for a server, returning the resulting Client without persisting it. Callers are responsible for storing the client in the appropriate backend (credential helper, docker pass, etc.). This is the storage-agnostic core of PerformDiscoveryAndRegistration.

type Credentials

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

Credentials provides storage for DCR client metadata via credential helper

func NewCredentials

func NewCredentials(credentialHelper credentials.Helper) *Credentials

NewCredentials creates a new DCR credentials store

func (*Credentials) DeleteClient

func (c *Credentials) DeleteClient(serverName string) error

DeleteClient removes a DCR client from the credential helper

func (*Credentials) ListClients

func (c *Credentials) ListClients() (map[string]Client, error)

ListClients returns all stored DCR clients

func (*Credentials) RetrieveClient

func (c *Credentials) RetrieveClient(serverName string) (Client, error)

RetrieveClient retrieves a DCR client from the credential helper

func (*Credentials) SaveClient

func (c *Credentials) SaveClient(serverName string, client Client) error

SaveClient stores a DCR client in the credential helper

type Manager

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

Manager orchestrates Dynamic Client Registration flows

func NewManager

func NewManager(credentialHelper credentials.Helper, redirectURI string) *Manager

NewManager creates a new DCR manager with the specified redirect URI

func (*Manager) Credentials

func (m *Manager) Credentials() *Credentials

Credentials returns the credentials store

func (*Manager) DeleteDCRClient

func (m *Manager) DeleteDCRClient(serverName string) error

DeleteDCRClient removes a DCR client from storage

func (*Manager) GetDCRClient

func (m *Manager) GetDCRClient(serverName string) (Client, error)

GetDCRClient retrieves a DCR client from storage

func (*Manager) ListDCRClients

func (m *Manager) ListDCRClients() (map[string]Client, error)

ListDCRClients returns all stored DCR clients

func (*Manager) PerformDiscoveryAndRegistration

func (m *Manager) PerformDiscoveryAndRegistration(ctx context.Context, serverName string, scopes string) error

PerformDiscoveryAndRegistration executes OAuth discovery and DCR for a server This is called when no DCR client exists or when it needs re-registration

Jump to

Keyboard shortcuts

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