Documentation
¶
Index ¶
- func Verify(pubkey sshcert.RawPublicKey, token, signature string) error
- type AuthToken
- type CA
- func (c *CA) BootstrapURL() string
- func (c *CA) PolicyURL() string
- func (c *CA) PublicKey() sshcert.RawPublicKey
- func (c *CA) RequestPolicy(ctx context.Context, token string, conn policy.Connection) (*PolicyResponse, error)
- func (c *CA) Sign(value string) (signature string, err error)
- func (c *CA) SignPublicKey(rawPubKey sshcert.RawPublicKey, params *CertParams) (sshcert.RawCertificate, error)
- type CertParams
- type Option
- type PolicyError
- type PolicyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthToken ¶
AuthToken is the token passed from the plugin through to the CA (and to the ca verifier plugin matching Provider) Token is opaque and can hold whatever the plugins need it to
type CA ¶
type CA struct {
// contains filtered or unexported fields
}
CA performs CA operations
func (*CA) BootstrapURL ¶ added in v0.5.1
BootstrapURL returns the cached bootstrap URL learned from the policy server. Returns empty string if not yet learned.
func (*CA) PublicKey ¶
func (c *CA) PublicKey() sshcert.RawPublicKey
PublicKey returns the ssh on-disk format public key for the CA
func (*CA) RequestPolicy ¶
func (c *CA) RequestPolicy(ctx context.Context, token string, conn policy.Connection) (*PolicyResponse, error)
RequestPolicy requests policy from the policy url
func (*CA) SignPublicKey ¶
func (c *CA) SignPublicKey(rawPubKey sshcert.RawPublicKey, params *CertParams) (sshcert.RawCertificate, error)
SignPublicKey signs a key to generate a certificate
type CertParams ¶
type CertParams struct {
Identity string `json:"identity"`
Names []string `json:"principals"`
Expiration time.Duration `json:"expiration"`
Extensions map[string]string `json:"extensions"`
}
CertParams are options which can be set on a certificate
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures the CA
func WithHTTPClient ¶
WithHTTPClient configures the CA to use the specified HTTP Client
func WithLogger ¶ added in v0.3.3
WithLogger configures the CA to use the specified logger
func WithTLSConfig ¶ added in v0.1.4
WithTLSConfig creates an HTTP client with the specified TLS configuration
type PolicyError ¶ added in v0.1.1
type PolicyError struct {
StatusCode int
Message string
DiscoveryURL string // Resolved discovery URL from Link header
BootstrapURL string // Resolved bootstrap URL from Link header
}
PolicyError represents an error from the policy server. The CA server should return the same status code to the client.
func (*PolicyError) Error ¶ added in v0.1.1
func (e *PolicyError) Error() string
type PolicyResponse ¶ added in v0.1.1
type PolicyResponse struct {
CertParams CertParams `json:"certParams"`
Policy policy.Policy `json:"policy"`
DiscoveryURL string `json:"-"` // Resolved URL from Link header
BootstrapURL string `json:"-"` // Resolved URL from Link header
}
PolicyResponse is the response from the policy server, containing both the certificate parameters and the policy