Documentation
¶
Overview ¶
Package certificate provides CA certificate management operations. Supports listing system and custom CA certificates, and managing custom certificates in /usr/local/share/ca-certificates/. Delegates file writes to the file provider for SHA tracking, idempotency, and template rendering.
Index ¶
- type CreateResult
- type Darwin
- type Debian
- func (d *Debian) Create(ctx context.Context, entry Entry) (*CreateResult, error)
- func (d *Debian) Delete(ctx context.Context, name string) (*DeleteResult, error)
- func (d *Debian) List(ctx context.Context) ([]Entry, error)
- func (d *Debian) Update(ctx context.Context, entry Entry) (*UpdateResult, error)
- type DeleteResult
- type Entry
- type Linux
- type Provider
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateResult ¶
type CreateResult struct {
Name string `json:"name"`
Changed bool `json:"changed"`
Error string `json:"error,omitempty"`
}
CreateResult represents the outcome of a CA certificate creation.
type Darwin ¶
type Darwin struct{}
Darwin implements the Provider interface for Darwin (macOS). All methods return ErrUnsupported as certificate management is not available on macOS.
func NewDarwinProvider ¶
func NewDarwinProvider() *Darwin
NewDarwinProvider factory to create a new Darwin instance.
type Debian ¶
type Debian struct {
provider.FactsAware
// contains filtered or unexported fields
}
Debian implements the Provider interface for Debian-family systems. It delegates file writes to a FileDeployer for SHA tracking and idempotency. Managed files are identified by their presence in the file-state KV with an osapi- filename prefix.
func NewDebianProvider ¶
func NewDebianProvider( logger *slog.Logger, fs avfs.VFS, fileDeployer file.Deployer, stateKV jetstream.KeyValue, execManager exec.Manager, hostname string, ) *Debian
NewDebianProvider factory to create a new Debian instance.
type DeleteResult ¶
type DeleteResult struct {
Name string `json:"name"`
Changed bool `json:"changed"`
Error string `json:"error,omitempty"`
}
DeleteResult represents the outcome of a CA certificate deletion.
type Entry ¶
type Entry struct {
Name string `json:"name"`
Source string `json:"source,omitempty"`
Object string `json:"object,omitempty"`
}
Entry represents a CA certificate entry.
type Linux ¶
type Linux struct{}
Linux implements the Provider interface for generic Linux. All methods return ErrUnsupported as this is a generic Linux stub.
func NewLinuxProvider ¶
func NewLinuxProvider() *Linux
NewLinuxProvider factory to create a new Linux instance.
type Provider ¶
type Provider interface {
// List returns all system and osapi-managed CA certificates.
List(ctx context.Context) ([]Entry, error)
// Create deploys a new CA certificate via the file provider.
Create(ctx context.Context, entry Entry) (*CreateResult, error)
// Update redeploys an existing CA certificate via the file provider.
Update(ctx context.Context, entry Entry) (*UpdateResult, error)
// Delete undeploys a CA certificate via the file provider.
Delete(ctx context.Context, name string) (*DeleteResult, error)
}
Provider implements the methods to manage CA certificates.
type UpdateResult ¶
type UpdateResult struct {
Name string `json:"name"`
Changed bool `json:"changed"`
Error string `json:"error,omitempty"`
}
UpdateResult represents the outcome of a CA certificate update.