certificates

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package certificates manages TLS certificates on KraftCloud.

Index

Constants

View Source
const Endpoint = "/certificates"

Endpoint is the public path for the certificates service.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificatesService

type CertificatesService interface {
	kcclient.ServiceClient[CertificatesService]

	// Create creates a new certificate.
	//
	// See: https://docs.kraft.cloud/api/v1/certificates/#uploading-an-existing-certificate
	Create(ctx context.Context, req *CreateRequest) (*kcclient.ServiceResponse[CreateResponseItem], error)

	// Get returns the current status and the properties of one or more certificate(s).
	//
	// See: https://docs.kraft.cloud/api/v1/certificates/#getting-the-status-of-a-certificate
	Get(ctx context.Context, uuids ...string) (*kcclient.ServiceResponse[GetResponseItem], error)

	// Delete deletes one or more certificate(s).
	//
	// See: https://docs.kraft.cloud/api/v1/certificates/#deleting-a-certificate
	Delete(ctx context.Context, uuids ...string) (*kcclient.ServiceResponse[DeleteResponseItem], error)

	// List all existing certificates.
	//
	// See: https://docs.kraft.cloud/api/v1/certificates/#list-existing-certificates
	List(ctx context.Context) (*kcclient.ServiceResponse[GetResponseItem], error)
}

func NewCertificatesClientFromOptions

func NewCertificatesClientFromOptions(opts *options.Options) CertificatesService

NewCertificatesClientFromOptions instantiates a new certificates service client based on the provided pre-existing options.

type CreateRequest added in v0.5.9

type CreateRequest struct {
	Name  string `json:"name,omitempty"`
	CN    string `json:"cn"`
	Chain string `json:"chain"`
	PKey  string `json:"pkey"`
}

CreateRequest is a data structure for a request to a POST /certificates request. https://docs.kraft.cloud/api/v1/certificates/#uploading-an-existing-certificate

type CreateResponseItem added in v0.5.9

type CreateResponseItem struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`

	kcclient.APIResponseCommon
}

CreateResponseItem is a data item from a response to a POST /certificates request. https://docs.kraft.cloud/api/v1/certificates/#uploading-an-existing-certificate

type DeleteResponseItem

type DeleteResponseItem struct {
	Status string `json:"status"`
	UUID   string `json:"uuid"`
	Name   string `json:"name"`

	kcclient.APIResponseCommon
}

DeleteResponseItem is a data item from a response to a DELETE /certificates request. https://docs.kraft.cloud/api/v1/certificates/#deleting-a-certificate

type GetResponseItem

type GetResponseItem struct {
	Status        string                    `json:"status"`
	UUID          string                    `json:"uuid"`
	Name          string                    `json:"name"`
	CreatedAt     string                    `json:"created_at"`
	CommonName    string                    `json:"common_name"`
	State         string                    `json:"state"`
	Validation    *GetResponseValidation    `json:"validation"`
	Subject       string                    `json:"subject"`
	Issuer        string                    `json:"issuer"`
	SerialNumber  string                    `json:"serial_number"`
	NotBefore     string                    `json:"not_before"`
	NotAfter      string                    `json:"not_after"`
	ServiceGroups []GetResponseServiceGroup `json:"service_groups"`

	kcclient.APIResponseCommon
}

GetResponseItem is a data item from a response to a GET /certificates request. https://docs.kraft.cloud/api/v1/certificates/#getting-the-status-of-a-certificate

type GetResponseServiceGroup

type GetResponseServiceGroup struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`
}

type GetResponseValidation added in v0.5.2

type GetResponseValidation struct {
	Attempt int    `json:"attempt"`
	Next    string `json:"next"`
}

type ListResponseItem

type ListResponseItem struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`

	kcclient.APIResponseCommon
}

ListResponseItem is a data item from a response to a GET /certificates/list request. https://docs.kraft.cloud/api/v1/certificates/#list-existing-certificates

Jump to

Keyboard shortcuts

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