Documentation
¶
Overview ¶
Package ssh implements dynamic OpenSSH user certificate credentials (signed-key mode).
Index ¶
- type CertOptions
- type CredsRequest
- type CredsResult
- type Engine
- func (e *Engine) CleanupExpired(ctx context.Context, limit int) (int, error)
- func (e *Engine) GenerateCredentials(ctx context.Context, req CredsRequest) (*CredsResult, error)
- func (e *Engine) GetRole(ctx context.Context, name string) (*domainsecrets.SSHRole, error)
- func (e *Engine) Name() string
- func (e *Engine) Renew(ctx context.Context, leaseID string, ttlSeconds int) (*CredsResult, error)
- func (e *Engine) RenewExpiring(ctx context.Context, grace time.Duration, limit int) (int, error)
- func (e *Engine) RevokeLease(ctx context.Context, leaseID string) error
- func (e *Engine) SaveRole(ctx context.Context, cfg RoleConfig) error
- type RegistryAdapter
- type RoleConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertOptions ¶
type CertOptions struct {
KeyID string
Principals []string
ValidAfter time.Time
ValidBefore time.Time
Extensions map[string]string
CriticalOptions map[string]string
}
CertOptions configures an OpenSSH user certificate.
type CredsRequest ¶
type CredsRequest struct {
Role string
Username string
TTLSecond int
// TokenID is the hashed client token that issued the lease (cascade revoke).
TokenID string
// Tenant / TenantMode scope lease IDs (W64-01).
Tenant string
TenantMode bool
}
CredsRequest configures credential generation.
type CredsResult ¶
type CredsResult struct {
LeaseID string
Username string
PrivateKey string
SignedKey string
Role string
TTLSeconds int
MaxTTL int
ExpiresAt time.Time
Warnings []string
}
CredsResult contains generated SSH credentials and lease metadata.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine generates short-lived OpenSSH user certificates bound to leases.
func NewEngine ¶
func NewEngine( roles repository.SSHRoleRepository, leases repository.LeaseRepository, secrets repository.SecretRepository, cryptoSvc *crypto.Service, ) *Engine
NewEngine constructs an SSH credentials engine.
func (*Engine) CleanupExpired ¶
CleanupExpired revokes expired ssh leases.
func (*Engine) GenerateCredentials ¶
func (e *Engine) GenerateCredentials(ctx context.Context, req CredsRequest) (*CredsResult, error)
GenerateCredentials creates an ephemeral SSH key pair and signed user certificate.
func (*Engine) RenewExpiring ¶
RenewExpiring renews active leases expiring within grace (W42-06).
func (*Engine) RevokeLease ¶
RevokeLease revokes a lease and destroys stored credentials.
type RegistryAdapter ¶
type RegistryAdapter struct {
*Engine
}
RegistryAdapter wraps the ssh engine for engine.Registry registration.
func NewRegistryAdapter ¶
func NewRegistryAdapter(engine *Engine) RegistryAdapter
NewRegistryAdapter constructs a SecretEngine adapter for the ssh engine.