cert

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(client *golangsdk.ServiceClient, opts BindOpts) error

Bind SSL certificates to a domain

func BindCertToDomain

func BindCertToDomain(client *golangsdk.ServiceClient, opts AttachDomainOpts) error

BindCertToDomain binds an SSL certificate to domain names

func Delete

func Delete(client *golangsdk.ServiceClient, certID string) (err error)

func Unbind

func Unbind(client *golangsdk.ServiceClient, opts BindOpts) error

Unbind SSL certificates from a domain

func UnbindCertFromDomain

func UnbindCertFromDomain(client *golangsdk.ServiceClient, opts AttachDomainOpts) error

UnbindCertFromDomain unbinds an SSL certificate from domain names

Types

type AttachDomainInfo

type AttachDomainInfo struct {
	// Domain name
	Domain string `json:"domain" required:"true"`
	// Gateway IDs
	InstanceIDs []string `json:"instance_ids,omitempty"`
	// Whether to enable client certificate verification
	VerifiedClientCertificateEnabled *bool `json:"verified_client_certificate_enabled,omitempty"`
}

AttachDomainInfo represents the information for a domain to attach

type AttachDomainOpts

type AttachDomainOpts struct {
	CertificateID string `json:"-"`
	// Domain names the certificate is bound to
	Domains []AttachDomainInfo `json:"domains" required:"true"`
}

AttachDomainOpts contains the options for binding a certificate to domain names

type BindOpts

type BindOpts struct {
	// Gateway ID
	InstanceID string `json:"-"`
	// API group ID
	GroupID string `json:"-"`
	// Domain ID
	DomainID string `json:"-"`
	// Certificate IDs to attach
	CertificateIDs []string `json:"certificate_ids" required:"true"`
	// Whether to enable client certificate verification
	VerifiedClientCertificateEnabled *bool `json:"verified_client_certificate_enabled,omitempty"`
}

BindOpts contains the options for binding SSL certificates to a domain

type CertBase

type CertBase struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	Type               string   `json:"type"`
	InstanceID         string   `json:"instance_id"`
	ProjectID          string   `json:"project_id"`
	CommonName         string   `json:"common_name"`
	San                []string `json:"san"`
	NotAfter           string   `json:"not_after"`
	SignatureAlgorithm string   `json:"signature_algorithm"`
	CreateTime         string   `json:"create_time"`
	UpdateTime         string   `json:"update_time"`
	HasTrustedRootCA   bool     `json:"is_has_trusted_root_ca"`
}

CertBase represents the basic content of an SSL certificate

func ExtractCertificates

func ExtractCertificates(r pagination.NewPage) ([]CertBase, error)

ExtractCertificates extracts certificates from the response

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]CertBase, error)

List retrieves a list of SSL certificates

type CertificatePage

type CertificatePage struct {
	pagination.NewSinglePageBase
}

CertificatePage represents a single page of certificates

type CertificateResp

type CertificateResp struct {
	ID                 string   `json:"id"`
	Name               string   `json:"name"`
	Type               string   `json:"type"`
	InstanceID         string   `json:"instance_id"`
	ProjectID          string   `json:"project_id"`
	CommonName         string   `json:"common_name"`
	San                []string `json:"san"`
	NotAfter           string   `json:"not_after"`
	NotBefore          string   `json:"not_before"`
	SignatureAlgorithm string   `json:"signature_algorithm"`
	CreateTime         string   `json:"create_time"`
	UpdateTime         string   `json:"update_time"`
	HasTrustedRootCA   bool     `json:"is_has_trusted_root_ca"`
	Version            int      `json:"version"`
	Organization       []string `json:"organization"`
	OrganizationalUnit []string `json:"organizational_unit"`
	Locality           []string `json:"locality"`
	State              []string `json:"state"`
	Country            []string `json:"country"`
	SerialNumber       string   `json:"serial_number"`
	Issuer             []string `json:"issuer"`
}

CertificateResp represents the response from certificate creation

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*CertificateResp, error)

Create creates a new SSL certificate

func Get

func Get(client *golangsdk.ServiceClient, certificateID string) (*CertificateResp, error)

Get retrieves details of a specific SSL certificate

func Update

func Update(client *golangsdk.ServiceClient, certificateID string, opts UpdateOpts) (*CertificateResp, error)

Update modifies an existing SSL certificate

type CreateOpts

type CreateOpts struct {
	// Certificate name. It can contain 4 to 50 characters, starting with a letter.
	// Only letters, digits, and underscores (_) are allowed.
	Name string `json:"name" required:"true"`
	// Certificate content
	CertContent string `json:"cert_content" required:"true"`
	// Certificate private key
	PrivateKey string `json:"private_key" required:"true"`
	// Certificate scope (instance or global)
	Type string `json:"type,omitempty"`
	// Gateway ID. Required if type is set to instance
	InstanceID string `json:"instance_id,omitempty"`
	// Trusted root certificate (CA)
	TrustedRootCA string `json:"trusted_root_ca,omitempty"`
}

CreateOpts contains the options for creating a new SSL certificate

type ListOpts

type ListOpts struct {
	InstanceId string `q:"instance_id"`
	// Offset from which the query starts
	Offset *int64 `q:"offset"`
	// Number of items displayed on each page
	Limit *int `q:"limit"`
	// Certificate name
	Name string `q:"name"`
	// Certificate domain name
	CommonName string `q:"common_name"`
	// Certificate signature algorithm
	SignatureAlgorithm string `q:"signature_algorithm"`
	// Certificate scope (instance or global)
	Type string `q:"type"`
}

type UpdateOpts

type UpdateOpts struct {
	// Certificate name. It can contain 4 to 50 characters, starting with a letter.
	// Only letters, digits, and underscores (_) are allowed.
	Name string `json:"name" required:"true"`
	// Certificate content
	CertContent string `json:"cert_content" required:"true"`
	// Certificate private key
	PrivateKey string `json:"private_key" required:"true"`
	// Certificate scope
	Type string `json:"type,omitempty"`
	// Gateway ID. Required if type is set to instance
	InstanceID string `json:"instance_id,omitempty"`
	// Trusted root certificate (CA)
	TrustedRootCA string `json:"trusted_root_ca,omitempty"`
}

UpdateOpts contains the options for updating an SSL certificate

Jump to

Keyboard shortcuts

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