cps

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Package cps provides access to the Akamai CPS APIs

Index

Constants

View Source
const (
	// AcknowledgementAcknowledge parameter value
	AcknowledgementAcknowledge = "acknowledge"
	// AcknowledgementDeny parameter value
	AcknowledgementDeny = "deny"
)

Variables

View Source
var (
	// ErrGetChangeManagementInfo is returned when GetChangeManagementInfo fails
	ErrGetChangeManagementInfo = errors.New("get change management info")
	// ErrGetChangeDeploymentInfo is returned when GetChangeDeploymentInfo fails
	ErrGetChangeDeploymentInfo = errors.New("get change deployment info")
	// ErrAcknowledgeChangeManagement is returned when AcknowledgeChangeManagement fails
	ErrAcknowledgeChangeManagement = errors.New("acknowledging change management")
)
View Source
var (
	// ErrGetChangeStatus is returned when GetChangeStatus fails
	ErrGetChangeStatus = errors.New("fetching change")
	// ErrCancelChange is returned when CancelChange fails
	ErrCancelChange = errors.New("canceling change")
	// ErrUpdateChange is returned when UpdateChange fails
	ErrUpdateChange = errors.New("updating change")
)
View Source
var (
	// ErrGetDeploymentSchedule is returned when GetDeploymentSchedule fails
	ErrGetDeploymentSchedule = errors.New("get deployment schedule")
	// ErrUpdateDeploymentSchedule is returned when UpdateDeploymentSchedule fails
	ErrUpdateDeploymentSchedule = errors.New("update deployment schedule")
)
View Source
var (
	// ErrListDeployments is returned when ListDeployments fails
	ErrListDeployments = errors.New("list deployments")
	// ErrGetProductionDeployment is returned when GetProductionDeployment fails
	ErrGetProductionDeployment = errors.New("get production deployment")
	// ErrGetStagingDeployment is returned when GetStagingDeployment fails
	ErrGetStagingDeployment = errors.New("get staging deployment")
)
View Source
var (
	// ErrGetChangeLetsEncryptChallenges is returned when GetChangeLetsEncryptChallenges fails
	ErrGetChangeLetsEncryptChallenges = errors.New("fetching change for lets-encrypt-challenges")
	// ErrAcknowledgeLetsEncryptChallenges when AcknowledgeDVChallenges fails
	ErrAcknowledgeLetsEncryptChallenges = errors.New("acknowledging lets-encrypt-challenges")
)
View Source
var (
	// ErrListEnrollments is returned when ListEnrollments fails
	ErrListEnrollments = errors.New("fetching enrollments")
	// ErrGetEnrollment is returned when GetEnrollment fails
	ErrGetEnrollment = errors.New("fetching enrollment")
	// ErrCreateEnrollment is returned when CreateEnrollment fails
	ErrCreateEnrollment = errors.New("create enrollment")
	// ErrUpdateEnrollment is returned when UpdateEnrollment fails
	ErrUpdateEnrollment = errors.New("update enrollment")
	// ErrRemoveEnrollment is returned when RemoveEnrollment fails
	ErrRemoveEnrollment = errors.New("remove enrollment")
)
View Source
var (
	// ErrGetDVHistory is returned when GetDVHistory fails
	ErrGetDVHistory = errors.New("get dv history")
	// ErrGetCertificateHistory is returned when GetDVHistory fails
	ErrGetCertificateHistory = errors.New("get certificate history")
	// ErrGetChangeHistory is returned when GetDVHistory fails
	ErrGetChangeHistory = errors.New("get change history")
)
View Source
var (
	// ErrGetChangePostVerificationWarnings is returned when GetChangePostVerificationWarnings fails
	ErrGetChangePostVerificationWarnings = errors.New("get post-verification-warnings")
	// ErrAcknowledgePostVerificationWarnings is returned when AcknowledgePostVerificationWarnings fails
	ErrAcknowledgePostVerificationWarnings = errors.New("acknowledging post-verification-warnings")
)
View Source
var (
	// ErrGetChangePreVerificationWarnings is returned when GetChangeLetsEncryptChallenges fails
	ErrGetChangePreVerificationWarnings = errors.New("fetching pre-verification-warnings")
	// ErrAcknowledgePreVerificationWarnings when AcknowledgeDVChallenges fails
	ErrAcknowledgePreVerificationWarnings = errors.New("acknowledging pre-verification-warnings")
)
View Source
var (
	// ErrGetChangeThirdPartyCSR is returned when GetChangeThirdPartyCSR fails
	ErrGetChangeThirdPartyCSR = errors.New("get change third-party csr")
	// ErrUploadThirdPartyCertAndTrustChain is returned when UploadThirdPartyCertAndTrustChain fails
	ErrUploadThirdPartyCertAndTrustChain = errors.New("upload third-party cert and trust chain")
)
View Source
var AllowedInputContentTypeHeader = map[AllowedInputType]string{
	AllowedInputTypeChangeManagementACK:            "application/vnd.akamai.cps.acknowledgement-with-hash.v1+json",
	AllowedInputTypeLetsEncryptChallengesCompleted: "application/vnd.akamai.cps.acknowledgement.v1+json",
	AllowedInputTypePostVerificationWarningsACK:    "application/vnd.akamai.cps.acknowledgement.v1+json",
	AllowedInputTypePreVerificationWarningsACK:     "application/vnd.akamai.cps.acknowledgement.v1+json",
	AllowedInputTypeThirdPartyCertAndTrustChain:    "application/vnd.akamai.cps.certificate-and-trust-chain.v1+json",
}

AllowedInputContentTypeHeader maps content type headers to specific allowed input type params

View Source
var (
	// ErrInvalidLocation is returned when there was an error while fetching ID from location response object
	ErrInvalidLocation = errors.New("location URL is invalid")
)
View Source
var (
	// ErrStructValidation is returned returned when given struct validation failed
	ErrStructValidation = errors.New("struct validation")
)

Functions

func GetIDFromLocation

func GetIDFromLocation(location string) (int, error)

GetIDFromLocation parse the link and returns the id

Types

type Acknowledgement

type Acknowledgement struct {
	Acknowledgement string `json:"acknowledgement"`
}

Acknowledgement is a request body of acknowledgement request

func (Acknowledgement) Validate

func (a Acknowledgement) Validate() error

Validate validates Acknowledgement

type AcknowledgementRequest

type AcknowledgementRequest struct {
	Acknowledgement
	EnrollmentID int
	ChangeID     int
}

AcknowledgementRequest contains params and body required to send acknowledgement. It is the same for all acknowledgement types (dv, pre-verification-warnings etc.)

func (AcknowledgementRequest) Validate

func (a AcknowledgementRequest) Validate() error

Validate validates AcknowledgementRequest

type AllowedInput

type AllowedInput struct {
	Info              string `json:"info"`
	RequiredToProceed bool   `json:"requiredToProceed"`
	Type              string `json:"type"`
	Update            string `json:"update"`
}

AllowedInput contains the resource locations (path) of data inputs allowed by this Change

type AllowedInputType

type AllowedInputType string

AllowedInputType represents allowedInputTypeParam used for fetching and updating changes

const (
	// AllowedInputTypeChangeManagementACK parameter value
	AllowedInputTypeChangeManagementACK AllowedInputType = "change-management-ack"
	// AllowedInputTypeLetsEncryptChallengesCompleted parameter value
	AllowedInputTypeLetsEncryptChallengesCompleted AllowedInputType = "lets-encrypt-challenges-completed"
	// AllowedInputTypePostVerificationWarningsACK parameter value
	AllowedInputTypePostVerificationWarningsACK AllowedInputType = "post-verification-warnings-ack"
	// AllowedInputTypePreVerificationWarningsACK parameter value
	AllowedInputTypePreVerificationWarningsACK AllowedInputType = "pre-verification-warnings-ack"
	// AllowedInputTypeThirdPartyCertAndTrustChain parameter value
	AllowedInputTypeThirdPartyCertAndTrustChain AllowedInputType = "third-party-cert-and-trust-chain"
)

type AuthenticationOptions

type AuthenticationOptions struct {
	OCSP               *OCSP `json:"ocsp,omitempty"`
	SendCAListToClient *bool `json:"sendCaListToClient,omitempty"`
}

AuthenticationOptions contain the configuration options for the selected trust chain

type CPS

CPS is the cps api interface

func Client

func Client(sess session.Session, opts ...Option) CPS

Client returns a new cps Client instance with the specified controller

type CSR

type CSR struct {
	C                   string   `json:"c,omitempty"`
	CN                  string   `json:"cn"`
	L                   string   `json:"l,omitempty"`
	O                   string   `json:"o,omitempty"`
	OU                  string   `json:"ou,omitempty"`
	PreferredTrustChain string   `json:"preferredTrustChain,omitempty"`
	SANS                []string `json:"sans,omitempty"`
	ST                  string   `json:"st,omitempty"`
}

CSR is a Certificate Signing Request object

func (CSR) Validate

func (c CSR) Validate() error

Validate performs validation on Enrollment

type CancelChangeRequest

type CancelChangeRequest struct {
	EnrollmentID int
	ChangeID     int
}

CancelChangeRequest contains params required to send CancelChange request

func (CancelChangeRequest) Validate

func (c CancelChangeRequest) Validate() error

Validate validates CancelChangeRequest

type CancelChangeResponse

type CancelChangeResponse struct {
	Change string `json:"change"`
}

CancelChangeResponse is a response object returned from CancelChange request

type CertSigningRequest

type CertSigningRequest struct {
	CSR          string `json:"csr"`
	KeyAlgorithm string `json:"keyAlgorithm"`
}

CertSigningRequest holds CSR

type Certificate

type Certificate struct {
	Certificate string `json:"certificate"`
	TrustChain  string `json:"trustChain,omitempty"`
}

Certificate is a digital certificate object

func (Certificate) Validate

func (c Certificate) Validate() error

Validate validates Certificate

type CertificateAndTrustChain

type CertificateAndTrustChain struct {
	Certificate  string `json:"certificate"`
	TrustChain   string `json:"trustChain,omitempty"`
	KeyAlgorithm string `json:"keyAlgorithm"`
}

CertificateAndTrustChain contains single certificate with associated trust chain

func (CertificateAndTrustChain) Validate

func (r CertificateAndTrustChain) Validate() error

Validate validates CertificateAndTrustChain

type CertificateChangeHistory

type CertificateChangeHistory struct {
	Certificate  string `json:"certificate"`
	TrustChain   string `json:"trustChain"`
	CSR          string `json:"csr"`
	KeyAlgorithm string `json:"keyAlgorithm"`
}

CertificateChangeHistory represents certificate returned in GetChangeHistory operation

type CertificateObject

type CertificateObject struct {
	Certificate  string `json:"certificate"`
	Expiry       string `json:"expiry"`
	KeyAlgorithm string `json:"keyAlgorithm"`
	TrustChain   string `json:"trustChain"`
}

CertificateObject represent certificate for enrollment

type CertificateOrderDetails

type CertificateOrderDetails struct {
	OrderID string `json:"orderId"`
}

CertificateOrderDetails represents CA order details for a Change

type Challenge

type Challenge struct {
	Error             string             `json:"error"`
	FullPath          string             `json:"fullPath"`
	RedirectFullPath  string             `json:"redirectFullPath"`
	ResponseBody      string             `json:"responseBody"`
	Status            string             `json:"status"`
	Token             string             `json:"token"`
	Type              string             `json:"type"`
	ValidationRecords []ValidationRecord `json:"validationRecords"`
}

Challenge contains domain information of a specific domain to be validated

type Change

type Change struct {
	AllowedInput []AllowedInput `json:"allowedInput"`
	StatusInfo   *StatusInfo    `json:"statusInfo"`
}

Change contains change status information

type ChangeDeploymentInfoResponse

type ChangeDeploymentInfoResponse Deployment

ChangeDeploymentInfoResponse contains response from GetChangeDeploymentInfo

type ChangeHistory

type ChangeHistory struct {
	Action                         string                     `json:"action"`
	ActionDescription              string                     `json:"actionDescription"`
	BusinessCaseID                 string                     `json:"businessCaseId"`
	CreatedBy                      string                     `json:"createdBy"`
	CreatedOn                      string                     `json:"createdOn"`
	LastUpdated                    string                     `json:"lastUpdated"`
	MultiStackedCertificates       []CertificateChangeHistory `json:"multiStackedCertificates"`
	PrimaryCertificate             CertificateChangeHistory   `json:"primaryCertificate"`
	PrimaryCertificateOrderDetails CertificateOrderDetails    `json:"primaryCertificateOrderDetails"`
	RA                             string                     `json:"ra"`
	Status                         string                     `json:"status"`
}

ChangeHistory represents a piece of enrollment's history for a single change for GetChangeHistory operation

type ChangeManagementInfo

type ChangeManagementInfo interface {
	// GetChangeManagementInfo gets information about acknowledgement status,
	// and may include warnings about potential conflicts that may occur if you proceed with acknowledgement
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangeManagementInfo(ctx context.Context, params GetChangeRequest) (*ChangeManagementInfoResponse, error)

	// GetChangeDeploymentInfo gets deployment currently deployed to the staging network
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangeDeploymentInfo(ctx context.Context, params GetChangeRequest) (*ChangeDeploymentInfoResponse, error)

	// AcknowledgeChangeManagement sends acknowledgement request to CPS to proceed deploying the certificate to the production network
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	AcknowledgeChangeManagement(context.Context, AcknowledgementRequest) error
}

ChangeManagementInfo is a CPS API enabling change management

type ChangeManagementInfoResponse

type ChangeManagementInfoResponse struct {
	AcknowledgementDeadline *string           `json:"acknowledgementDeadline"`
	ValidationResultHash    string            `json:"validationResultHash"`
	PendingState            PendingState      `json:"pendingState"`
	ValidationResult        *ValidationResult `json:"validationResult"`
}

ChangeManagementInfoResponse contains response from GetChangeManagementInfo

type ChangeOperations

type ChangeOperations interface {
	// GetChangeStatus fetches change status for given enrollment and change ID
	//
	// See: https://techdocs.akamai.com/cps/reference/get-enrollment-change
	GetChangeStatus(context.Context, GetChangeStatusRequest) (*Change, error)

	// CancelChange cancels a pending change
	//
	// See: https://techdocs.akamai.com/cps/reference/delete-enrollment-change
	CancelChange(context.Context, CancelChangeRequest) (*CancelChangeResponse, error)

	// UpdateChange updates a pending change
	// Deprecated: this function will be removed in a future release. Use one of:
	// AcknowledgeChangeManagement(), AcknowledgePostVerificationWarnings(),
	// AcknowledgePreVerificationWarnings(), UploadThirdPartyCertAndTrustChain()
	// or AcknowledgeDVChallenges()
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	UpdateChange(context.Context, UpdateChangeRequest) (*UpdateChangeResponse, error)
}

ChangeOperations is a CPS change API interface

type ClientFunc

type ClientFunc func(sess session.Session, opts ...Option) CPS

ClientFunc is a cps client new method, this can used for mocking

type ClientMutualAuthentication

type ClientMutualAuthentication struct {
	AuthenticationOptions *AuthenticationOptions `json:"authenticationOptions,omitempty"`
	SetID                 string                 `json:"setId,omitempty"`
}

ClientMutualAuthentication specifies the trust chain that is used to verify client certificates and some configuration options

type Contact

type Contact struct {
	AddressLineOne   string `json:"addressLineOne,omitempty"`
	AddressLineTwo   string `json:"addressLineTwo,omitempty"`
	City             string `json:"city,omitempty"`
	Country          string `json:"country,omitempty"`
	Email            string `json:"email,omitempty"`
	FirstName        string `json:"firstName,omitempty"`
	LastName         string `json:"lastName,omitempty"`
	OrganizationName string `json:"organizationName,omitempty"`
	Phone            string `json:"phone,omitempty"`
	PostalCode       string `json:"postalCode,omitempty"`
	Region           string `json:"region,omitempty"`
	Title            string `json:"title,omitempty"`
}

Contact contains contact information

type CreateEnrollmentRequest

type CreateEnrollmentRequest struct {
	Enrollment
	ContractID       string
	DeployNotAfter   string
	DeployNotBefore  string
	AllowDuplicateCN bool
}

CreateEnrollmentRequest contains request body and path parameters used to create an enrollment

func (CreateEnrollmentRequest) Validate

func (e CreateEnrollmentRequest) Validate() error

Validate performs validation on CreateEnrollmentRequest

type CreateEnrollmentResponse

type CreateEnrollmentResponse struct {
	ID         int
	Enrollment string   `json:"enrollment"`
	Changes    []string `json:"changes"`
}

CreateEnrollmentResponse contains response body returned after successful enrollment creation

type DNSNameSettings

type DNSNameSettings struct {
	CloneDNSNames bool     `json:"cloneDnsNames"`
	DNSNames      []string `json:"dnsNames,omitempty"`
}

DNSNameSettings contain DNS name setting in given network configuration

type DV

type DV struct {
	Challenges         []Challenge `json:"challenges"`
	Domain             string      `json:"domain"`
	Error              string      `json:"error"`
	Expires            string      `json:"expires"`
	RequestTimestamp   string      `json:"requestTimestamp"`
	Status             string      `json:"status"`
	ValidatedTimestamp string      `json:"validatedTimestamp"`
	ValidationStatus   string      `json:"validationStatus"`
}

DV is a Domain Validation entity

type DVArray

type DVArray struct {
	DV []DV `json:"dv"`
}

DVArray is an array of DV objects

type DVChallenges

type DVChallenges interface {
	// GetChangeLetsEncryptChallenges gets detailed information about Domain Validation challenges
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangeLetsEncryptChallenges(context.Context, GetChangeRequest) (*DVArray, error)

	// AcknowledgeDVChallenges sends acknowledgement request to CPS informing that the validation is completed
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	AcknowledgeDVChallenges(context.Context, AcknowledgementRequest) error
}

DVChallenges is a CPS DV challenges API interface

type Deployment

type Deployment struct {
	OCSPStapled              *bool                          `json:"ocspStapled"`
	OCSPURIs                 []string                       `json:"ocspUris"`
	NetworkConfiguration     DeploymentNetworkConfiguration `json:"networkConfiguration"`
	PrimaryCertificate       DeploymentCertificate          `json:"primaryCertificate"`
	MultiStackedCertificates []DeploymentCertificate        `json:"multiStackedCertificates"`
}

Deployment represents details of production or staging deployment

type DeploymentCertificate

type DeploymentCertificate struct {
	Certificate        string `json:"certificate"`
	Expiry             string `json:"expiry"`
	KeyAlgorithm       string `json:"keyAlgorithm"`
	SignatureAlgorithm string `json:"signatureAlgorithm"`
	TrustChain         string `json:"trustChain"`
}

DeploymentCertificate represents certificate in context of deployment operation

type DeploymentNetworkConfiguration

type DeploymentNetworkConfiguration struct {
	Geography             string   `json:"geography"`
	MustHaveCiphers       string   `json:"mustHaveCiphers"`
	OCSPStapling          string   `json:"ocspStapling"`
	PreferredCiphers      string   `json:"preferredCiphers"`
	QUICEnabled           bool     `json:"quicEnabled"`
	SecureNetwork         string   `json:"secureNetwork"`
	SNIOnly               bool     `json:"sniOnly"`
	DisallowedTLSVersions []string `json:"disallowedTlsVersions"`
	DNSNames              []string `json:"dnsNames"`
}

DeploymentNetworkConfiguration represents network configuration in context of deployment operation

type DeploymentSchedule

type DeploymentSchedule struct {
	NotAfter  *string `json:"notAfter,omitempty"`
	NotBefore *string `json:"notBefore,omitempty"`
}

DeploymentSchedule contains the schedule for when you want this change deploy

type DeploymentSchedules

type DeploymentSchedules interface {
	// GetDeploymentSchedule fetches the current deployment schedule settings describing when a change deploys to the network
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-deployment-schedule
	GetDeploymentSchedule(context.Context, GetDeploymentScheduleRequest) (*DeploymentSchedule, error)

	// UpdateDeploymentSchedule updates the current deployment schedule
	//
	// See: https://techdocs.akamai.com/cps/reference/put-change-deployment-schedule
	UpdateDeploymentSchedule(context.Context, UpdateDeploymentScheduleRequest) (*UpdateDeploymentScheduleResponse, error)
}

DeploymentSchedules is a CPS deployment schedules API interface

type Deployments

type Deployments interface {
	// ListDeployments fetches deployments for given enrollment
	//
	// See: https://techdocs.akamai.com/cps/reference/get-deployments
	ListDeployments(context.Context, ListDeploymentsRequest) (*ListDeploymentsResponse, error)

	// GetProductionDeployment fetches production deployment for given enrollment
	//
	// See: https://techdocs.akamai.com/cps/reference/get-deployments-production
	GetProductionDeployment(context.Context, GetDeploymentRequest) (*GetProductionDeploymentResponse, error)

	// GetStagingDeployment fetches staging deployment for given enrollment
	//
	// See: https://techdocs.akamai.com/cps/reference/get-deployment-staging
	GetStagingDeployment(context.Context, GetDeploymentRequest) (*GetStagingDeploymentResponse, error)
}

Deployments is a CPS deployments API interface

type DomainHistory

type DomainHistory struct {
	Domain             string             `json:"domain"`
	Challenges         []Challenge        `json:"challenges"`
	Error              string             `json:"error"`
	Expires            string             `json:"expires"`
	FullPath           string             `json:"fullPath"`
	RedirectFullPath   string             `json:"redirectFullPath"`
	RequestTimestamp   string             `json:"requestTimestamp"`
	ResponseBody       string             `json:"responseBody"`
	Status             string             `json:"status"`
	Token              string             `json:"token"`
	ValidatedTimestamp string             `json:"validatedTimestamp"`
	ValidationRecords  []ValidationRecord `json:"validationRecords"`
	ValidationStatus   string             `json:"validationStatus"`
}

DomainHistory represents a history for single domain for GetDVHistory operation

type Enrollment

type Enrollment struct {
	AdminContact                   *Contact              `json:"adminContact"`
	AutoRenewalStartTime           string                `json:"autoRenewalStartTime,omitempty"`
	CertificateChainType           string                `json:"certificateChainType,omitempty"`
	CertificateType                string                `json:"certificateType"`
	ChangeManagement               bool                  `json:"changeManagement"`
	CSR                            *CSR                  `json:"csr"`
	EnableMultiStackedCertificates bool                  `json:"enableMultiStackedCertificates"`
	Location                       string                `json:"location,omitempty"`
	MaxAllowedSanNames             int                   `json:"maxAllowedSanNames,omitempty"`
	MaxAllowedWildcardSanNames     int                   `json:"maxAllowedWildcardSanNames,omitempty"`
	NetworkConfiguration           *NetworkConfiguration `json:"networkConfiguration"`
	Org                            *Org                  `json:"org"`
	PendingChanges                 []PendingChange       `json:"pendingChanges,omitempty"`
	RA                             string                `json:"ra"`
	SignatureAlgorithm             string                `json:"signatureAlgorithm,omitempty"`
	TechContact                    *Contact              `json:"techContact"`
	ThirdParty                     *ThirdParty           `json:"thirdParty,omitempty"`
	ValidationType                 string                `json:"validationType"`
}

Enrollment represents a CPS enrollment object. It is used both as a request body for enrollment creation and response body while fetching enrollment by ID

func (Enrollment) Validate

func (e Enrollment) Validate() error

Validate performs validation on Enrollment

type Enrollments

type Enrollments interface {
	// ListEnrollments fetches all enrollments with given contractId
	//
	// See https://techdocs.akamai.com/cps/reference/get-enrollments
	ListEnrollments(context.Context, ListEnrollmentsRequest) (*ListEnrollmentsResponse, error)

	// GetEnrollment fetches enrollment object with given ID
	//
	// See: https://techdocs.akamai.com/cps/reference/get-enrollment
	GetEnrollment(context.Context, GetEnrollmentRequest) (*Enrollment, error)

	// CreateEnrollment creates a new enrollment
	//
	// See: https://techdocs.akamai.com/cps/reference/post-enrollment
	CreateEnrollment(context.Context, CreateEnrollmentRequest) (*CreateEnrollmentResponse, error)

	// UpdateEnrollment updates a single enrollment entry with given ID
	//
	// See: https://techdocs.akamai.com/cps/reference/put-enrollment
	UpdateEnrollment(context.Context, UpdateEnrollmentRequest) (*UpdateEnrollmentResponse, error)

	// RemoveEnrollment removes an enrollment with given ID
	//
	// See: https://techdocs.akamai.com/cps/reference/delete-enrollment
	RemoveEnrollment(context.Context, RemoveEnrollmentRequest) (*RemoveEnrollmentResponse, error)
}

Enrollments is a CPS enrollments API interface

type Error

type Error struct {
	Type          string          `json:"type"`
	Title         string          `json:"title"`
	Detail        string          `json:"detail"`
	Instance      string          `json:"instance,omitempty"`
	BehaviorName  string          `json:"behaviorName,omitempty"`
	ErrorLocation string          `json:"errorLocation,omitempty"`
	StatusCode    int             `json:"statusCode,omitempty"`
	Errors        json.RawMessage `json:"errors,omitempty"`
	Warnings      json.RawMessage `json:"warnings,omitempty"`
}

Error is a cps error interface

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Is handles error comparisons

type GetCertificateHistoryRequest

type GetCertificateHistoryRequest struct {
	EnrollmentID int
}

GetCertificateHistoryRequest represents request for GetCertificateHistory operation

func (GetCertificateHistoryRequest) Validate

func (r GetCertificateHistoryRequest) Validate() error

Validate validates GetCertificateHistoryRequest

type GetCertificateHistoryResponse

type GetCertificateHistoryResponse struct {
	Certificates []HistoryCertificate `json:"certificates"`
}

GetCertificateHistoryResponse represents response for GetCertificateHistory operation

type GetChangeHistoryRequest

type GetChangeHistoryRequest struct {
	EnrollmentID int
}

GetChangeHistoryRequest represents request for GetChangeHistory operation

func (GetChangeHistoryRequest) Validate

func (r GetChangeHistoryRequest) Validate() error

Validate validates GetChangeHistoryRequest

type GetChangeHistoryResponse

type GetChangeHistoryResponse struct {
	Changes []ChangeHistory `json:"changes"`
}

GetChangeHistoryResponse represents response for GetChangeHistory operation

type GetChangeRequest

type GetChangeRequest struct {
	EnrollmentID int
	ChangeID     int
}

GetChangeRequest contains params required to fetch a specific change (e.g. DV challenges) It is the same for all GET change requests

func (GetChangeRequest) Validate

func (c GetChangeRequest) Validate() error

Validate validates GetChangeRequest

type GetChangeStatusRequest

type GetChangeStatusRequest struct {
	EnrollmentID int
	ChangeID     int
}

GetChangeStatusRequest contains params required to perform GetChangeStatus

func (GetChangeStatusRequest) Validate

func (c GetChangeStatusRequest) Validate() error

Validate validates GetChangeStatusRequest

type GetDVHistoryRequest

type GetDVHistoryRequest struct {
	EnrollmentID int
}

GetDVHistoryRequest represents request for GetDVHistory operation

func (GetDVHistoryRequest) Validate

func (r GetDVHistoryRequest) Validate() error

Validate validates GetDVHistoryRequest

type GetDVHistoryResponse

type GetDVHistoryResponse struct {
	Results []HistoryResult `json:"results"`
}

GetDVHistoryResponse represents response for GetDVHistory operation

type GetDeploymentRequest

type GetDeploymentRequest struct {
	EnrollmentID int
}

GetDeploymentRequest contains parameters for GetProductionDeployment and GetStagingDeployment

func (GetDeploymentRequest) Validate

func (c GetDeploymentRequest) Validate() error

Validate validates GetDeploymentsRequest

type GetDeploymentScheduleRequest

type GetDeploymentScheduleRequest struct {
	ChangeID     int
	EnrollmentID int
}

GetDeploymentScheduleRequest contains parameters for GetDeploymentSchedule

func (GetDeploymentScheduleRequest) Validate

func (c GetDeploymentScheduleRequest) Validate() error

Validate validates GetDeploymentScheduleRequest

type GetEnrollmentRequest

type GetEnrollmentRequest struct {
	EnrollmentID int
}

GetEnrollmentRequest contains ID of an enrollment that is to be fetched with GetEnrollment

func (GetEnrollmentRequest) Validate

func (e GetEnrollmentRequest) Validate() error

Validate performs validation on GetEnrollmentRequest

type GetProductionDeploymentResponse

type GetProductionDeploymentResponse Deployment

GetProductionDeploymentResponse contains response for GetProductionDeployment

type GetStagingDeploymentResponse

type GetStagingDeploymentResponse Deployment

GetStagingDeploymentResponse contains response for GetStagingDeployment

type History

type History interface {
	// GetDVHistory is a domain name validation history for the enrollment
	//
	// See: https://techdocs.akamai.com/cps/reference/get-dv-history
	GetDVHistory(context.Context, GetDVHistoryRequest) (*GetDVHistoryResponse, error)

	// GetCertificateHistory views the certificate history.
	//
	// See: https://techdocs.akamai.com/cps/reference/get-history-certificates
	GetCertificateHistory(context.Context, GetCertificateHistoryRequest) (*GetCertificateHistoryResponse, error)

	// GetChangeHistory views the change history for enrollment.
	//
	// See: https://techdocs.akamai.com/cps/reference/get-history-changes
	GetChangeHistory(context.Context, GetChangeHistoryRequest) (*GetChangeHistoryResponse, error)
}

History is a CPS interface for History management

type HistoryCertificate

type HistoryCertificate struct {
	DeploymentStatus         string              `json:"deploymentStatus"`
	Geography                string              `json:"geography"`
	MultiStackedCertificates []CertificateObject `json:"multiStackedCertificates"`
	PrimaryCertificate       CertificateObject   `json:"primaryCertificate"`
	RA                       string              `json:"ra"`
	Slots                    []int               `json:"slots"`
	StagingStatus            string              `json:"stagingStatus"`
	Type                     string              `json:"type"`
}

HistoryCertificate represents a piece of enrollment's certificate history for GetCertificateHistory operation

type HistoryResult

type HistoryResult struct {
	Domain        string          `json:"domain"`
	DomainHistory []DomainHistory `json:"domainHistory"`
}

HistoryResult represents a piece of history for GetDVHistory operation

type ListDeploymentsRequest

type ListDeploymentsRequest struct {
	EnrollmentID int
}

ListDeploymentsRequest contains parameters for ListDeployments

func (ListDeploymentsRequest) Validate

func (c ListDeploymentsRequest) Validate() error

Validate validates ListDeploymentsRequest

type ListDeploymentsResponse

type ListDeploymentsResponse struct {
	Production *Deployment `json:"production"`
	Staging    *Deployment `json:"staging"`
}

ListDeploymentsResponse contains response for ListDeployments

type ListEnrollmentsRequest

type ListEnrollmentsRequest struct {
	ContractID string
}

ListEnrollmentsRequest contains Contract ID of enrollments that are to be fetched with ListEnrollments

func (ListEnrollmentsRequest) Validate

func (e ListEnrollmentsRequest) Validate() error

Validate performs validation on ListEnrollmentRequest

type ListEnrollmentsResponse

type ListEnrollmentsResponse struct {
	Enrollments []Enrollment `json:"enrollments"`
}

ListEnrollmentsResponse represents list of CPS enrollment objects under given contractId. It is used as a response body while fetching enrollments by contractId

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) AcknowledgeChangeManagement

func (m *Mock) AcknowledgeChangeManagement(ctx context.Context, r AcknowledgementRequest) error

func (*Mock) AcknowledgeDVChallenges

func (m *Mock) AcknowledgeDVChallenges(ctx context.Context, r AcknowledgementRequest) error

func (*Mock) AcknowledgePostVerificationWarnings

func (m *Mock) AcknowledgePostVerificationWarnings(ctx context.Context, r AcknowledgementRequest) error

func (*Mock) AcknowledgePreVerificationWarnings

func (m *Mock) AcknowledgePreVerificationWarnings(ctx context.Context, r AcknowledgementRequest) error

func (*Mock) CancelChange

func (m *Mock) CancelChange(ctx context.Context, r CancelChangeRequest) (*CancelChangeResponse, error)

func (*Mock) CreateEnrollment

func (*Mock) GetChangeDeploymentInfo

func (m *Mock) GetChangeDeploymentInfo(ctx context.Context, r GetChangeRequest) (*ChangeDeploymentInfoResponse, error)

func (*Mock) GetChangeHistory

func (*Mock) GetChangeLetsEncryptChallenges

func (m *Mock) GetChangeLetsEncryptChallenges(ctx context.Context, r GetChangeRequest) (*DVArray, error)

func (*Mock) GetChangeManagementInfo

func (m *Mock) GetChangeManagementInfo(ctx context.Context, r GetChangeRequest) (*ChangeManagementInfoResponse, error)

func (*Mock) GetChangePostVerificationWarnings

func (m *Mock) GetChangePostVerificationWarnings(ctx context.Context, r GetChangeRequest) (*PostVerificationWarnings, error)

func (*Mock) GetChangePreVerificationWarnings

func (m *Mock) GetChangePreVerificationWarnings(ctx context.Context, r GetChangeRequest) (*PreVerificationWarnings, error)

func (*Mock) GetChangeStatus

func (m *Mock) GetChangeStatus(ctx context.Context, r GetChangeStatusRequest) (*Change, error)

func (*Mock) GetChangeThirdPartyCSR

func (m *Mock) GetChangeThirdPartyCSR(ctx context.Context, r GetChangeRequest) (*ThirdPartyCSRResponse, error)

func (*Mock) GetDVHistory

func (m *Mock) GetDVHistory(ctx context.Context, r GetDVHistoryRequest) (*GetDVHistoryResponse, error)

func (*Mock) GetDeploymentSchedule

func (m *Mock) GetDeploymentSchedule(ctx context.Context, r GetDeploymentScheduleRequest) (*DeploymentSchedule, error)

func (*Mock) GetEnrollment

func (m *Mock) GetEnrollment(ctx context.Context, r GetEnrollmentRequest) (*Enrollment, error)

func (*Mock) GetProductionDeployment

func (m *Mock) GetProductionDeployment(ctx context.Context, r GetDeploymentRequest) (*GetProductionDeploymentResponse, error)

func (*Mock) GetStagingDeployment

func (m *Mock) GetStagingDeployment(ctx context.Context, r GetDeploymentRequest) (*GetStagingDeploymentResponse, error)

func (*Mock) ListDeployments

func (*Mock) ListEnrollments

func (*Mock) RemoveEnrollment

func (*Mock) UpdateChange

func (m *Mock) UpdateChange(ctx context.Context, r UpdateChangeRequest) (*UpdateChangeResponse, error)

func (*Mock) UpdateEnrollment

func (*Mock) UploadThirdPartyCertAndTrustChain

func (m *Mock) UploadThirdPartyCertAndTrustChain(ctx context.Context, r UploadThirdPartyCertAndTrustChainRequest) error

type NetworkConfiguration

type NetworkConfiguration struct {
	ClientMutualAuthentication *ClientMutualAuthentication `json:"clientMutualAuthentication,omitempty"`
	DisallowedTLSVersions      []string                    `json:"disallowedTlsVersions,omitempty"`
	DNSNameSettings            *DNSNameSettings            `json:"dnsNameSettings,omitempty"`
	Geography                  string                      `json:"geography,omitempty"`
	MustHaveCiphers            string                      `json:"mustHaveCiphers,omitempty"`
	OCSPStapling               OCSPStapling                `json:"ocspStapling,omitempty"`
	PreferredCiphers           string                      `json:"preferredCiphers,omitempty"`
	QuicEnabled                bool                        `json:"quicEnabled"`
	SecureNetwork              string                      `json:"secureNetwork,omitempty"`
	SNIOnly                    bool                        `json:"sniOnly"`
}

NetworkConfiguration contains settings that specify any network information and TLS Metadata you want CPS to use to push the completed certificate to the network

func (NetworkConfiguration) Validate

func (n NetworkConfiguration) Validate() error

Validate performs validation on NetworkConfiguration

type OCSP

type OCSP struct {
	Enabled *bool `json:"enabled,omitempty"`
}

OCSP specifies whether you want to enable ocsp stapling for client certificates

type OCSPStapling

type OCSPStapling string

OCSPStapling is used to enable OCSP stapling for an enrollment

const (
	// OCSPStaplingOn parameter value
	OCSPStaplingOn OCSPStapling = "on"
	// OCSPStaplingOff parameter value
	OCSPStaplingOff OCSPStapling = "off"
	// OCSPStaplingNotSet parameter value
	OCSPStaplingNotSet OCSPStapling = "not-set"
)

type Option

type Option func(*cps)

Option defines a CPS option

type Org

type Org struct {
	AddressLineOne string `json:"addressLineOne,omitempty"`
	AddressLineTwo string `json:"addressLineTwo,omitempty"`
	City           string `json:"city,omitempty"`
	Country        string `json:"country,omitempty"`
	Name           string `json:"name,omitempty"`
	Phone          string `json:"phone,omitempty"`
	PostalCode     string `json:"postalCode,omitempty"`
	Region         string `json:"region,omitempty"`
}

Org represents organization information

type PendingCertificate

type PendingCertificate struct {
	CertificateType    string   `json:"certificateType"`
	FullCertificate    string   `json:"fullCertificate"`
	OCSPStapled        string   `json:"ocspStapled"`
	OCSPURIs           []string `json:"ocspUris"`
	SignatureAlgorithm string   `json:"signatureAlgorithm"`
	KeyAlgorithm       string   `json:"keyAlgorithm"`
}

PendingCertificate contains the snapshot of the pending certificate for the enrollment

type PendingChange

type PendingChange struct {
	ChangeType string `json:"changeType,omitempty"`
	Location   string `json:"location,omitempty"`
}

PendingChange represents pending change information

type PendingNetworkConfiguration

type PendingNetworkConfiguration struct {
	DNSNameSettings       *DNSNameSettings `json:"dnsNameSettings"`
	MustHaveCiphers       string           `json:"mustHaveCiphers"`
	NetworkType           string           `json:"networkType"`
	OCSPStapling          string           `json:"ocspStapling"`
	PreferredCiphers      string           `json:"preferredCiphers"`
	QUICEnabled           string           `json:"quicEnabled"`
	SNIOnly               string           `json:"sniOnly"`
	DisallowedTLSVersions []string         `json:"disallowedTlsVersions"`
}

PendingNetworkConfiguration contains the snapshot of the pending network configuration for the enrollment

type PendingState

type PendingState struct {
	PendingCertificates         []PendingCertificate        `json:"pendingCertificates"`
	PendingNetworkConfiguration PendingNetworkConfiguration `json:"pendingNetworkConfiguration"`
}

PendingState contains the snapshot of the pending state for the enrollment

type PostVerification

type PostVerification interface {
	// GetChangePostVerificationWarnings gets information about post verification warnings
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangePostVerificationWarnings(ctx context.Context, params GetChangeRequest) (*PostVerificationWarnings, error)
	// AcknowledgePostVerificationWarnings sends acknowledgement request to CPS informing that the warnings should be ignored
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	AcknowledgePostVerificationWarnings(context.Context, AcknowledgementRequest) error
}

PostVerification is a CPS API enabling management of post-verification-warnings

type PostVerificationWarnings

type PostVerificationWarnings struct {
	Warnings string `json:"warnings"`
}

PostVerificationWarnings is a response object containing all warnings encountered during enrollment post-verification

type PreVerification

type PreVerification interface {
	// GetChangePreVerificationWarnings gets detailed information about Domain Validation challenges
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangePreVerificationWarnings(ctx context.Context, params GetChangeRequest) (*PreVerificationWarnings, error)

	// AcknowledgePreVerificationWarnings sends acknowledgement request to CPS informing that the warnings should be ignored
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	AcknowledgePreVerificationWarnings(context.Context, AcknowledgementRequest) error
}

PreVerification is a CPS API enabling management of pre-verification-warnings

type PreVerificationWarnings

type PreVerificationWarnings struct {
	Warnings string `json:"warnings"`
}

PreVerificationWarnings is a response object containing all warnings encountered during enrollment pre-verification

type RemoveEnrollmentRequest

type RemoveEnrollmentRequest struct {
	EnrollmentID              int
	AllowCancelPendingChanges *bool
	DeployNotAfter            string
	DeployNotBefore           string
}

RemoveEnrollmentRequest contains parameters necessary to send a RemoveEnrollment request

func (RemoveEnrollmentRequest) Validate

func (e RemoveEnrollmentRequest) Validate() error

Validate performs validation on RemoveEnrollmentRequest

type RemoveEnrollmentResponse

type RemoveEnrollmentResponse struct {
	Enrollment string   `json:"enrollment"`
	Changes    []string `json:"changes"`
}

RemoveEnrollmentResponse contains response body returned after successful enrollment deletion

type StatusInfo

type StatusInfo struct {
	DeploymentSchedule *DeploymentSchedule `json:"deploymentSchedule"`
	Description        string              `json:"description"`
	Error              *StatusInfoError    `json:"error,omitempty"`
	State              string              `json:"state"`
	Status             string              `json:"status"`
}

StatusInfo contains the status for this Change at this time

type StatusInfoError

type StatusInfoError struct {
	Code        string `json:"code"`
	Description string `json:"description"`
	Timestamp   string `json:"timestamp"`
}

StatusInfoError contains error information for this Change

type ThirdParty

type ThirdParty struct {
	ExcludeSANS bool `json:"excludeSans"`
}

ThirdParty specifies that you want to use a third party certificate

type ThirdPartyCSR

type ThirdPartyCSR interface {
	// GetChangeThirdPartyCSR gets certificate signing request
	//
	// See: https://techdocs.akamai.com/cps/reference/get-change-allowed-input-param
	GetChangeThirdPartyCSR(ctx context.Context, params GetChangeRequest) (*ThirdPartyCSRResponse, error)

	// UploadThirdPartyCertAndTrustChain uploads signed certificate and trust chain to cps
	//
	// See: https://techdocs.akamai.com/cps/reference/post-change-allowed-input-param
	UploadThirdPartyCertAndTrustChain(context.Context, UploadThirdPartyCertAndTrustChainRequest) error
}

ThirdPartyCSR is a CPS API enabling management of third-party certificates

type ThirdPartyCSRResponse

type ThirdPartyCSRResponse struct {
	CSRs []CertSigningRequest `json:"csrs"`
}

ThirdPartyCSRResponse is a response object containing list of csrs

type ThirdPartyCertificates

type ThirdPartyCertificates struct {
	CertificatesAndTrustChains []CertificateAndTrustChain `json:"certificatesAndTrustChains"`
}

ThirdPartyCertificates contains certificates information

func (ThirdPartyCertificates) Validate

func (r ThirdPartyCertificates) Validate() error

Validate validates ThirdPartyCertificates

type UpdateChangeRequest

type UpdateChangeRequest struct {
	Certificate
	EnrollmentID          int
	ChangeID              int
	AllowedInputTypeParam AllowedInputType
}

UpdateChangeRequest contains params and body required to send UpdateChange request

func (UpdateChangeRequest) Validate

func (c UpdateChangeRequest) Validate() error

Validate validates UpdateChangeRequest

type UpdateChangeResponse

type UpdateChangeResponse struct {
	Change string `json:"change"`
}

UpdateChangeResponse is a response object returned from UpdateChange request

type UpdateDeploymentScheduleRequest

type UpdateDeploymentScheduleRequest struct {
	ChangeID     int
	EnrollmentID int
	DeploymentSchedule
}

UpdateDeploymentScheduleRequest contains parameters for UpdateDeploymentSchedule

func (UpdateDeploymentScheduleRequest) Validate

Validate validates UpdateDeploymentScheduleRequest

type UpdateDeploymentScheduleResponse

type UpdateDeploymentScheduleResponse struct {
	Change string `json:"change"`
}

UpdateDeploymentScheduleResponse contains response for UpdateDeploymentSchedule

type UpdateEnrollmentRequest

type UpdateEnrollmentRequest struct {
	Enrollment
	EnrollmentID              int
	AllowCancelPendingChanges *bool
	AllowStagingBypass        *bool
	DeployNotAfter            string
	DeployNotBefore           string
	ForceRenewal              *bool
	RenewalDateCheckOverride  *bool
}

UpdateEnrollmentRequest contains request body and path parameters used to update an enrollment

func (UpdateEnrollmentRequest) Validate

func (e UpdateEnrollmentRequest) Validate() error

Validate performs validation on UpdateEnrollmentRequest

type UpdateEnrollmentResponse

type UpdateEnrollmentResponse struct {
	ID         int
	Enrollment string   `json:"enrollment"`
	Changes    []string `json:"changes"`
}

UpdateEnrollmentResponse contains response body returned after successful enrollment update

type UploadThirdPartyCertAndTrustChainRequest

type UploadThirdPartyCertAndTrustChainRequest struct {
	EnrollmentID int
	ChangeID     int
	Certificates ThirdPartyCertificates
}

UploadThirdPartyCertAndTrustChainRequest contains parameters to upload certificates

func (UploadThirdPartyCertAndTrustChainRequest) Validate

Validate validates UploadThirdPartyCertAndTrustChainRequest

type ValidationMessage

type ValidationMessage struct {
	Message     string `json:"message"`
	MessageCode string `json:"messageCode"`
}

ValidationMessage holds validation message

type ValidationRecord

type ValidationRecord struct {
	Authorities []string `json:"authorities"`
	Hostname    string   `json:"hostname"`
	Port        string   `json:"port"`
	ResolvedIP  []string `json:"resolvedIp"`
	TriedIP     string   `json:"triedIp"`
	URL         string   `json:"url"`
	UsedIP      string   `json:"usedIp"`
}

ValidationRecord represents validation attempt

type ValidationResult

type ValidationResult struct {
	Errors   []ValidationMessage `json:"errors"`
	Warnings []ValidationMessage `json:"warnings"`
}

ValidationResult contains validation errors and warnings messages

Jump to

Keyboard shortcuts

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