authentication

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InsecureStaticProvider

type InsecureStaticProvider struct {
	AccessToken string
}

InsecureStaticProvider is an insecure implementation of Provider that always returns the same static access token and does not provide/enforce transport security. This provider is only suitable for testing against LocalNet or other non-production environments.

func NewInsecureStaticProvider

func NewInsecureStaticProvider(accessToken string) InsecureStaticProvider

func (InsecureStaticProvider) PerRPCCredentials

func (InsecureStaticProvider) TokenSource

func (i InsecureStaticProvider) TokenSource() oauth2.TokenSource

func (InsecureStaticProvider) TransportCredentials

func (i InsecureStaticProvider) TransportCredentials() credentials.TransportCredentials

type Provider

type Provider interface {
	// TokenSource returns an oauth2.TokenSource that can be used to retrieve access tokens for authenticating with the participant's API endpoints.
	TokenSource() oauth2.TokenSource
	// TransportCredentials returns gRPC transport credentials to be used when connecting to the participant's RPC endpoints.
	TransportCredentials() credentials.TransportCredentials
	// PerRPCCredentials returns gRPC per-RPC credentials to be used when connecting to the participant's gRPC endpoints.
	PerRPCCredentials() credentials.PerRPCCredentials
}

Provider provides authentication credentials for connecting to a Canton participant's API endpoints. The Provider acts as both a raw token-source for HTTP API authentication, and a gRPC credentials provider for gRPC endpoint authentication.

Implementations of this interface can implement different means of fetching and refreshing authentication tokens, as well as enforcing different levels of transport security. The specific implementation of the Provider should be chosen based on the environment being connected to (e.g. LocalNet vs. production, i.e. CI/OIDC).

Jump to

Keyboard shortcuts

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