auth_providers

package
v0.0.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 11

Documentation

Index

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"
	EnvKeyfactorAuthProvider = "KEYFACTOR_AUTH_PROVIDER"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	GetHttpClient() (*http.Client, error)
}

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 (*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 (*OAuthAuthenticatorBuilder) WithTokenUrl

func (b *OAuthAuthenticatorBuilder) WithTokenUrl(tokenUrl string) *OAuthAuthenticatorBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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