Documentation
¶
Index ¶
- Constants
- type Authenticator
- type CommandAuthConfig
- type CommandAuthConfigBasic
- type OAuthAuthenticator
- type OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) Build() (Authenticator, error)
- func (b *OAuthAuthenticatorBuilder) WithAudience(audience string) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithCaCertificatePath(caCertificatePath string) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithCaCertificates(caCertificates []*x509.Certificate) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithClientId(clientId string) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithClientSecret(clientSecret string) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithScopes(scopes []string) *OAuthAuthenticatorBuilder
- func (b *OAuthAuthenticatorBuilder) WithTokenUrl(tokenUrl string) *OAuthAuthenticatorBuilder
Constants ¶
View Source
const ( DefaultCommandPort = "443" DefaultCommandAPIPath = "KeyfactorAPI" DefaultAPIVersion = "1" DefaultAPIClientName = "APIClient" DefaultProductVersion = "10.5.0.0" EnvKeyfactorHostName = "KEYFACTOR_HOSTNAME" EnvKeyfactorPort = "KEYFACTOR_PORT" EnvKeyfactorAPIPath = "KEYFACTOR_API_PATH" EnvKeyfactorSkipVerify = "KEYFACTOR_SKIP_VERIFY" EnvKeyfactorCACert = "KEYFACTOR_CA_CERT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type CommandAuthConfig ¶
type CommandAuthConfig struct {
// ConfigType is the type of configuration
ConfigType string `json:"config_type"`
// AuthHeader is the header to be used for authentication to Keyfactor Command API
AuthHeader string `json:"auth_header"`
// CommandHostName is the hostname of the Keyfactor Command API
CommandHostName string `json:"command_host_name"`
// CommandPort is the port of the Keyfactor Command API
CommandPort string `json:"command_port"`
// CommandAPIPath is the path of the Keyfactor Command API, default is "KeyfactorAPI"
CommandAPIPath string `json:"command_api_path"`
// CommandAPIVersion is the version of the Keyfactor Command API, default is "1"
CommandVersion string `json:"command_version"`
// CommandCACert is the CA certificate to be used for authentication to Keyfactor Command API for use with not widely trusted certificates. This can be a filepath or a string of the certificate in PEM format.
CommandCACert string `json:"command_ca_cert"`
// SkipVerify is a flag to skip verification of the server's certificate chain and host name. Default is false.
SkipVerify bool `json:"skip_verify"`
// HttpClient is the http client to be used for authentication to Keyfactor Command API
HttpClient *http.Client
}
CommandAuthConfig represents the base configuration needed for authentication to Keyfactor Command API.
func (*CommandAuthConfig) Authenticate ¶
func (c *CommandAuthConfig) Authenticate() error
Authenticate performs the authentication test to Keyfactor Command API and sets Command product version.
func (*CommandAuthConfig) SetClient ¶
func (c *CommandAuthConfig) SetClient(client *http.Client) *http.Client
SetClient sets the http client for authentication to Keyfactor Command API.
func (*CommandAuthConfig) ValidateAuthConfig ¶
func (c *CommandAuthConfig) ValidateAuthConfig() error
ValidateAuthConfig validates the authentication configuration for Keyfactor Command API.
type CommandAuthConfigBasic ¶
type CommandAuthConfigBasic struct {
// CommandAuthConfig is a reference to the base configuration needed for authentication to Keyfactor Command API
CommandAuthConfig
// Username is the username to be used for authentication to Keyfactor Command API
Username string `json:"username"`
// Password is the password to be used for authentication to Keyfactor Command API
Password string `json:"password"`
}
CommandAuthConfigBasic represents the base configuration needed for authentication to Keyfactor Command API.
type OAuthAuthenticator ¶
type OAuthAuthenticator struct {
// contains filtered or unexported fields
}
OAuthAuthenticator is an Authenticator that uses OAuth2 for authentication.
func (*OAuthAuthenticator) GetHttpClient ¶
func (a *OAuthAuthenticator) GetHttpClient() (*http.Client, error)
type OAuthAuthenticatorBuilder ¶
type OAuthAuthenticatorBuilder struct {
// contains filtered or unexported fields
}
func NewOAuthAuthenticatorBuilder ¶
func NewOAuthAuthenticatorBuilder() *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) Build ¶
func (b *OAuthAuthenticatorBuilder) Build() (Authenticator, error)
func (*OAuthAuthenticatorBuilder) WithAudience ¶
func (b *OAuthAuthenticatorBuilder) WithAudience(audience string) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithCaCertificatePath ¶
func (b *OAuthAuthenticatorBuilder) WithCaCertificatePath(caCertificatePath string) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithCaCertificates ¶
func (b *OAuthAuthenticatorBuilder) WithCaCertificates(caCertificates []*x509.Certificate) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithClientId ¶
func (b *OAuthAuthenticatorBuilder) WithClientId(clientId string) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithClientSecret ¶
func (b *OAuthAuthenticatorBuilder) WithClientSecret(clientSecret string) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithScopes ¶
func (b *OAuthAuthenticatorBuilder) WithScopes(scopes []string) *OAuthAuthenticatorBuilder
func (*OAuthAuthenticatorBuilder) WithTokenUrl ¶
func (b *OAuthAuthenticatorBuilder) WithTokenUrl(tokenUrl string) *OAuthAuthenticatorBuilder
Click to show internal directories.
Click to hide internal directories.