Documentation ¶
Index ¶
- Constants
- func IsAgentStopped(err error) bool
- type Agent
- func (a *Agent) AgentSocketPath() string
- func (a *Agent) CheckCertificate() bool
- func (a *Agent) Close()
- func (a *Agent) ControlSocketPath() string
- func (a *Agent) RequestCertificate(ctx context.Context, token string) error
- func (a *Agent) Running() bool
- func (a *Agent) UseCredential(c Credential) error
- type Credential
- type Option
Constants ¶
const CertExpirationFuzzWindow = 20
CertExpirationFuzzWindow is the time, in seconds that we ask for a new cert in before the current cert expires.
const DefaultTimeout = time.Second * 30
DefaultTimeout is the default timeout for http calls to the CA
const TokenSizeLimit = 4094
TokenSizeLimit is the Authentication token size limit
Variables ¶
This section is empty.
Functions ¶
func IsAgentStopped ¶
IsAgentStopped lets you test if an error indicates that the agent has been stopped
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent represents our agent
func (*Agent) AgentSocketPath ¶
AgentSocketPath returns the path for the SSH_AUTH_SOCKET
func (*Agent) CheckCertificate ¶ added in v0.0.12
CheckCertificate checks if the certificate is expired or invalid
func (*Agent) ControlSocketPath ¶
ControlSocketPath returns the path for the SSH_AUTH_SOCKET
func (*Agent) RequestCertificate ¶
RequestCertificate tries to convert a `{token, pubkey}` into a certificate
func (*Agent) UseCredential ¶
func (a *Agent) UseCredential(c Credential) error
UseCredential the credentials on the agemnt
type Credential ¶
type Credential struct { PrivateKey sshcert.RawPrivateKey Certificate sshcert.RawCertificate }
Credential contains the private key and certificate in pem form
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures the agent
func WithAgentSocketPath ¶
WithAgentSocketPath specifies the SSH_AUTH_SOCK path to create
func WithContext ¶
WithContext specifies a context.Context that agent will use and which can be cancelled, triggering the agent to stop. This context will also be used for outgoing requests to the CA
func WithControlSocketPath ¶
WithControlSocketPath specifies the control socket (API) for the agent