clientcredentials

package
v0.110.0 Latest Latest
Warning

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

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

Documentation

Overview

Package clientcredentials provides OAuth2 client credentials flow authentication for Canton gRPC connections. This flow is designed for machine-to-machine authentication and is intended for CI/CD environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements authentication.Provider using the OAuth2 client credentials flow.

func NewDiscoveryProvider

func NewDiscoveryProvider(
	ctx context.Context,
	authorizationServerURL, clientID, clientSecret string,
	options ...ProviderOption,
) (*Provider, error)

NewDiscoveryProvider creates a provider using OAuth2 Authorization Server Metadata discovery (RFC 8414).

func NewProvider

func NewProvider(
	ctx context.Context,
	tokenURL, clientID, clientSecret string,
	options ...ProviderOption,
) (*Provider, error)

NewProvider creates a provider that fetches tokens using the OAuth2 client credentials flow.

func (Provider) PerRPCCredentials

func (p Provider) PerRPCCredentials() credentials.PerRPCCredentials

func (Provider) TokenSource

func (p Provider) TokenSource() oauth2.TokenSource

func (Provider) TransportCredentials

func (p Provider) TransportCredentials() credentials.TransportCredentials

type ProviderOption

type ProviderOption func(*clientCredentialsProviderConfig)

ProviderOption configures the client credentials Provider.

func WithScopes

func WithScopes(scopes ...string) ProviderOption

WithScopes configures the scopes requested from the authorization server.

func WithTransportCredentials

func WithTransportCredentials(creds credentials.TransportCredentials) ProviderOption

WithTransportCredentials configures transport credentials for gRPC connections.

Jump to

Keyboard shortcuts

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