producer

package
v0.0.0-...-85427ea Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package producer implements Let's Encrypt certificate automation using Akeyless Dynamic Secrets.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingSubClaim = fmt.Errorf("email sub-claim is required")

ErrMissingSubClaim is returned when the original user doesn't have an "email" sub-claim in their access credentials.

Functions

This section is empty.

Types

type ClientInfo

type ClientInfo struct {
	AccessID  string              `json:"access_id"`
	SubClaims map[string][]string `json:"sub_claims"`
}

ClientInfo wraps original user information, such as Access ID or sub-claims.

type CreateRequest

type CreateRequest struct {
	Payload    string     `json:"payload"`
	ClientInfo ClientInfo `json:"client_info"`
	Input      Input      `json:"input,omitempty"`
}

CreateRequest represents requests to /sync/create endpoint to create temporary credentials.

type CreateResponse

type CreateResponse struct {
	ID       string      `json:"id"`
	Response interface{} `json:"response"`
}

CreateResponse is returned by "create" operation.

type Input

type Input struct {
	UseStaging bool   `json:"use_staging"`
	Domain     string `json:"domain"`
}

Input includes variables specific to Let's Encrypt producer. The input should be provided with `get-dynamic-secret-value` operation.

func (*Input) UnmarshalJSON

func (i *Input) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Option

type Option func(*producer)

Option is a single configuration parameter used by this producer.

func WithDryRunDomain

func WithDryRunDomain(domain string) Option

WithDryRunDomain configures this webhook to use the provided domain during dry-run requests to Let's Encrypt service. Regular, "production" calls use the domain provided alongside `get-dynamic-secret-value` operation.

func WithDryRunEmail

func WithDryRunEmail(email string) Option

WithDryRunEmail configures this webhook to use the provided email during dry-run requests to Let's Encrypt service. Regular, "production" calls use the email of an end user that initiated the operation (called `get-dynamic-secret-value` command).

type Producer

type Producer interface {
	Create(*CreateRequest) (*CreateResponse, error)
	Revoke(*RevokeRequest) (*RevokeResponse, error)
}

Producer is an implementation of Akeyless Custom Producer.

func New

func New(opts ...Option) (Producer, error)

New creates a new Producer with the provided options.

type RevokeRequest

type RevokeRequest struct {
	Payload string   `json:"payload"`
	IDs     []string `json:"ids"`
}

RevokeRequest represents revocation requests made by Akeyless Custom Producer. In case of Let's Encrypt producer, revoke operation does nothing, but still it has to be implemented.

type RevokeResponse

type RevokeResponse struct {
	Revoked []string `json:"revoked"`
	Message string   `json:"message,omitempty"`
}

RevokeResponse is returned by revoke operation.

Jump to

Keyboard shortcuts

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