Documentation ¶
Index ¶
- Constants
- func AccessFileToTls(accessFile WssdConfig) ([]byte, tls.Certificate, error)
- func GetWssdConfigLocation() string
- func PrintAccessFile(accessFile WssdConfig) error
- func SaveToken(tokenStr string) error
- func TransportCredentialsFromFile(wssdConfigLocation string, server string) credentials.TransportCredentials
- func TransportCredentialsFromNode(tlsCert tls.Certificate, serverCertificate []byte, server string) credentials.TransportCredentials
- type Authorizer
- type BearerAuthorizer
- type EnvironmentSettings
- type JwtTokenProvider
- type LoginConfig
- type ManagedIdentityConfig
- type WssdConfig
Constants ¶
View Source
const ( ClientTokenName = ".token" ClientCertName = "wssd.pem" ClientTokenPath = "WSSD_CLIENT_TOKEN" WssdConfigPath = "WSSD_CONFIG_PATH" DefaultWSSDFolder = ".wssd" AccessFileDefaultName = "cloudconfig" ServerName = "ServerName" )
Variables ¶
This section is empty.
Functions ¶
func AccessFileToTls ¶
func AccessFileToTls(accessFile WssdConfig) ([]byte, tls.Certificate, error)
func GetWssdConfigLocation ¶
func GetWssdConfigLocation() string
func PrintAccessFile ¶
func PrintAccessFile(accessFile WssdConfig) error
func TransportCredentialsFromFile ¶
func TransportCredentialsFromFile(wssdConfigLocation string, server string) credentials.TransportCredentials
func TransportCredentialsFromNode ¶
func TransportCredentialsFromNode(tlsCert tls.Certificate, serverCertificate []byte, server string) credentials.TransportCredentials
Types ¶
type Authorizer ¶
type Authorizer interface { WithTransportAuthorization() credentials.TransportCredentials WithRPCAuthorization() credentials.PerRPCCredentials }
func NewAuthorizerForAuth ¶
func NewAuthorizerForAuth(tokenString string, certificate string, server string) (Authorizer, error)
func NewAuthorizerFromEnvironment ¶
func NewAuthorizerFromEnvironment(serverName string) (Authorizer, error)
func NewAuthorizerFromInput ¶
func NewAuthorizerFromInput(tlsCert tls.Certificate, serverCertificate []byte, server string) (Authorizer, error)
type BearerAuthorizer ¶
type BearerAuthorizer struct {
// contains filtered or unexported fields
}
BearerAuthorizer implements the bearer authorization
func NewBearerAuthorizer ¶
func NewBearerAuthorizer(tp JwtTokenProvider, tc credentials.TransportCredentials) *BearerAuthorizer
NewBearerAuthorizer crates a BearerAuthorizer using the given token provider
func (*BearerAuthorizer) WithRPCAuthorization ¶
func (ba *BearerAuthorizer) WithRPCAuthorization() credentials.PerRPCCredentials
func (*BearerAuthorizer) WithTransportAuthorization ¶
func (ba *BearerAuthorizer) WithTransportAuthorization() credentials.TransportCredentials
type EnvironmentSettings ¶
EnvironmentSettings contains the available authentication settings.
func GetSettingsFromEnvironment ¶
func GetSettingsFromEnvironment(serverName string) (s EnvironmentSettings, err error)
func (EnvironmentSettings) GetAuthorizer ¶
func (settings EnvironmentSettings) GetAuthorizer() (Authorizer, error)
func (EnvironmentSettings) GetManagedIdentityConfig ¶
func (settings EnvironmentSettings) GetManagedIdentityConfig() ManagedIdentityConfig
type JwtTokenProvider ¶
type JwtTokenProvider struct {
RawData string `json:"rawdata"`
}
func TokenProviderFromFile ¶
func TokenProviderFromFile(tokenLocation string) JwtTokenProvider
func (JwtTokenProvider) GetRequestMetadata ¶
func (JwtTokenProvider) RequireTransportSecurity ¶
func (c JwtTokenProvider) RequireTransportSecurity() bool
type LoginConfig ¶
type ManagedIdentityConfig ¶
type ManagedIdentityConfig struct { ClientTokenPath string WssdConfigPath string ServerName string }
func (ManagedIdentityConfig) Authorizer ¶
func (mc ManagedIdentityConfig) Authorizer() (Authorizer, error)
type WssdConfig ¶
func GenerateClientKey ¶
func GenerateClientKey(loginconfig LoginConfig) ([]byte, WssdConfig, error)
Click to show internal directories.
Click to hide internal directories.