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 (i InsecureStaticProvider) PerRPCCredentials() credentials.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).
type StaticProvider ¶ added in v0.83.0
type StaticProvider struct {
AccessToken string
}
StaticProvider is a secure implementation of Provider that returns a static access token and enforces TLS transport security. This provider is suitable for remote environments.
func NewStaticProvider ¶ added in v0.83.0
func NewStaticProvider(accessToken string) StaticProvider
func (StaticProvider) PerRPCCredentials ¶ added in v0.83.0
func (s StaticProvider) PerRPCCredentials() credentials.PerRPCCredentials
func (StaticProvider) TokenSource ¶ added in v0.83.0
func (s StaticProvider) TokenSource() oauth2.TokenSource
func (StaticProvider) TransportCredentials ¶ added in v0.83.0
func (s StaticProvider) TransportCredentials() credentials.TransportCredentials