Documentation
¶
Index ¶
- Constants
- func ApproveCSR(ac *client.AlpaconClient, csrId string) ([]byte, error)
- func ApproveRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
- func CancelRevokeRequest(ac *client.AlpaconClient, requestId string) error
- func DeleteCA(ac *client.AlpaconClient, authorityId string) error
- func DeleteCSR(ac *client.AlpaconClient, csrId string) error
- func DenyCSR(ac *client.AlpaconClient, csrId string) ([]byte, error)
- func DenyRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
- func DownloadCRL(ac *client.AlpaconClient, authorityId string, filePath string) error
- func DownloadCertificate(ac *client.AlpaconClient, certId string, filePath string) error
- func DownloadCertificateByCSR(ac *client.AlpaconClient, csrId string, filePath string) error
- func DownloadRootCertificate(ac *client.AlpaconClient, authorityId string, filePath string) error
- func GetAuthorityDetail(ac *client.AlpaconClient, authorityId string) ([]byte, error)
- func GetAuthorityIDByName(ac *client.AlpaconClient, name string) (string, error)
- func GetCSRDetail(ac *client.AlpaconClient, csrId string) ([]byte, error)
- func GetCertificateDetail(ac *client.AlpaconClient, certId string) ([]byte, error)
- func GetRevokeRequestDetail(ac *client.AlpaconClient, requestId string) ([]byte, error)
- func RetryCSR(ac *client.AlpaconClient, csrId string) ([]byte, error)
- func RetryRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
- func SubmitCSR(ac *client.AlpaconClient, csr []byte, signRequest SignRequestResponse) error
- func UpdateAuthority(ac *client.AlpaconClient, authorityId string) ([]byte, error)
- type AuthorityAttributes
- type AuthorityCreateResponse
- type AuthorityDetails
- type AuthorityRequest
- type AuthorityResponse
- type AuthoritySummary
- type CRLResponse
- type CSRAttributes
- type CSRResponse
- type CSRSubmit
- type Certificate
- type CertificateAttributes
- type RevokeRequestAttributes
- type RevokeRequestCreate
- type RevokeRequestResponse
- type SignRequest
- type SignRequestDetail
- type SignRequestResponse
Constants ¶
View Source
const ( // CodeAuthorityCannotBeDeleted rides a CA delete: the CA has received a // certificate sign request, so the server keeps it and its records. CodeAuthorityCannotBeDeleted = "cert_authority_cannot_be_deleted" // CodeInvalidPeriod rides a sign request whose valid_days falls outside // 1..max_valid_days of the CA. CodeInvalidPeriod = "cert_invalid_period" )
Server refusal codes, read off a 400 with utils.ParseErrorResponse.
Variables ¶
This section is empty.
Functions ¶
func ApproveCSR ¶
func ApproveCSR(ac *client.AlpaconClient, csrId string) ([]byte, error)
func ApproveRevokeRequest ¶ added in v1.2.0
func ApproveRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
func CancelRevokeRequest ¶ added in v1.2.0
func CancelRevokeRequest(ac *client.AlpaconClient, requestId string) error
func DenyRevokeRequest ¶ added in v1.2.0
func DenyRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
func DownloadCRL ¶ added in v1.2.0
func DownloadCRL(ac *client.AlpaconClient, authorityId string, filePath string) error
func DownloadCertificate ¶
func DownloadCertificate(ac *client.AlpaconClient, certId string, filePath string) error
func DownloadCertificateByCSR ¶ added in v1.0.0
func DownloadCertificateByCSR(ac *client.AlpaconClient, csrId string, filePath string) error
func DownloadRootCertificate ¶
func DownloadRootCertificate(ac *client.AlpaconClient, authorityId string, filePath string) error
func GetAuthorityDetail ¶
func GetAuthorityDetail(ac *client.AlpaconClient, authorityId string) ([]byte, error)
func GetAuthorityIDByName ¶ added in v1.2.2
func GetAuthorityIDByName(ac *client.AlpaconClient, name string) (string, error)
GetAuthorityIDByName resolves an authority name to its ID. A UUID is returned as-is without an API call.
func GetCSRDetail ¶
func GetCSRDetail(ac *client.AlpaconClient, csrId string) ([]byte, error)
func GetCertificateDetail ¶
func GetCertificateDetail(ac *client.AlpaconClient, certId string) ([]byte, error)
func GetRevokeRequestDetail ¶ added in v1.2.0
func GetRevokeRequestDetail(ac *client.AlpaconClient, requestId string) ([]byte, error)
func RetryCSR ¶ added in v1.2.0
func RetryCSR(ac *client.AlpaconClient, csrId string) ([]byte, error)
func RetryRevokeRequest ¶ added in v1.2.0
func RetryRevokeRequest(ac *client.AlpaconClient, requestId string) ([]byte, error)
func SubmitCSR ¶
func SubmitCSR(ac *client.AlpaconClient, csr []byte, signRequest SignRequestResponse) error
func UpdateAuthority ¶ added in v1.2.0
func UpdateAuthority(ac *client.AlpaconClient, authorityId string) ([]byte, error)
Types ¶
type AuthorityAttributes ¶
type AuthorityAttributes struct {
ID string `json:"id" table:"ID"`
Name string `json:"name"`
Organization string `json:"organization"`
Domain string `json:"domain"`
RootValidDays int `json:"root_valid_days" table:"Root Valid Days"`
DefaultValidDays int `json:"default_valid_days" table:"Default Valid Days"`
MaxValidDays int `json:"max_valid_days" table:"Max Valid Days"`
Server string `json:"server"`
SignedAt utils.Timestamp `json:"signed_at" table:"Signed At"`
}
func GetAuthorityList ¶
func GetAuthorityList(ac *client.AlpaconClient) ([]AuthorityAttributes, error)
type AuthorityCreateResponse ¶
type AuthorityCreateResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Organization string `json:"organization"`
Domain string `json:"domain"`
RootValidDays int `json:"root_valid_days"`
DefaultValidDays int `json:"default_valid_days"`
MaxValidDays int `json:"max_valid_days"`
Agent types.ServerSummary `json:"agent"`
Instruction string `json:"instruction"`
UpdatedAt time.Time `json:"updated_at"`
}
func CreateAuthority ¶
func CreateAuthority(ac *client.AlpaconClient, authorityRequest AuthorityRequest) (AuthorityCreateResponse, error)
type AuthorityDetails ¶
type AuthorityDetails struct {
ID string `json:"id"`
Name string `json:"name"`
Organization string `json:"organization"`
Domain string `json:"domain"`
Storage string `json:"storage"`
CrtText string `json:"crt_text"`
RootValidDays int `json:"root_valid_days"`
DefaultValidDays int `json:"default_valid_days"`
MaxValidDays int `json:"max_valid_days"`
RemoteIP string `json:"remote_ip"`
IsConnected bool `json:"is_connected"`
Status string `json:"status"`
Agent types.ServerSummary `json:"agent"`
UpdatedAt time.Time `json:"updated_at"`
SignedAt time.Time `json:"signed_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type AuthorityRequest ¶
type AuthorityRequest struct {
Name string `json:"name"`
Organization string `json:"organization"`
Domain string `json:"domain"`
RootValidDays int `json:"root_valid_days"`
DefaultValidDays int `json:"default_valid_days"`
MaxValidDays int `json:"max_valid_days"`
Agent string `json:"agent"`
Install bool `json:"install"`
}
type AuthorityResponse ¶
type AuthorityResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Organization string `json:"organization"`
Domain string `json:"domain"`
RootValidDays int `json:"root_valid_days"`
DefaultValidDays int `json:"default_valid_days"`
MaxValidDays int `json:"max_valid_days"`
Agent types.ServerSummary `json:"agent"`
UpdatedAt time.Time `json:"updated_at"`
SignedAt time.Time `json:"signed_at"`
ExpiresAt time.Time `json:"expires_at"`
}
type AuthoritySummary ¶ added in v0.4.4
type CRLResponse ¶ added in v1.2.0
type CSRAttributes ¶
type CSRAttributes struct {
ID string `json:"id" table:"ID"`
Name string `json:"name"` // Derived from the first domain in the CSR domain list
Authority string `json:"authority"`
DomainList []string `json:"domain_list" table:"Domain List"`
IpList []string `json:"ip_list" table:"IP List"`
Status string `json:"status"`
RequestedIp string `json:"requested_ip" table:"Requested IP"`
RequestedBy string `json:"requested_by" table:"Requested By"`
RequestedDate utils.Timestamp `json:"requested_date" table:"Requested Date"`
}
func GetCSRList ¶
func GetCSRList(ac *client.AlpaconClient, status string) ([]CSRAttributes, error)
type CSRResponse ¶
type CSRResponse struct {
ID string `json:"id"`
Authority AuthoritySummary `json:"authority"`
CommonName string `json:"common_name"`
DomainList []string `json:"domain_list"`
IpList []string `json:"ip_list"`
ValidDays int `json:"valid_days"`
Status string `json:"status"`
RequestedIp string `json:"requested_ip"`
RequestedBy types.UserSummary `json:"requested_by"`
AddedAt time.Time `json:"added_at"`
}
type Certificate ¶
type Certificate struct {
ID string `json:"id"`
Authority AuthoritySummary `json:"authority"`
Csr string `json:"csr"`
CrtText string `json:"crt_text"`
CommonName string `json:"common_name"`
SerialNumber string `json:"serial_number"`
ValidDays int `json:"valid_days"`
Status string `json:"status"`
IsRevoked bool `json:"is_revoked"`
RevokedAt *time.Time `json:"revoked_at"`
CanRevoke bool `json:"can_revoke"`
SignedAt time.Time `json:"signed_at"`
ExpiresAt time.Time `json:"expires_at"`
SignedBy string `json:"signed_by"`
RenewedBy string `json:"renewed_by"`
}
type CertificateAttributes ¶
type CertificateAttributes struct {
ID string `json:"id" table:"ID"`
Authority string `json:"authority"`
CommonName string `json:"common_name" table:"-"`
SerialNumber string `json:"serial_number" table:"-"`
Status string `json:"status" table:"-"`
IsRevoked bool `json:"is_revoked" table:"-"`
RevokedAt utils.Timestamp `json:"revoked_at" table:"-"`
Csr string `json:"csr" table:"CSR"`
ValidDays int `json:"valid_days" table:"Valid Days"`
SignedAt utils.Timestamp `json:"signed_at" table:"Signed At"`
ExpiresAt utils.Timestamp `json:"expires_at" table:"Expires At"`
SignedBy string `json:"signed_by" table:"Signed By"`
RenewedBy string `json:"renewed_by" table:"Renewed By"`
}
func GetCertificateList ¶
func GetCertificateList(ac *client.AlpaconClient) ([]CertificateAttributes, error)
type RevokeRequestAttributes ¶ added in v1.2.0
type RevokeRequestAttributes struct {
ID string `json:"id" table:"ID"`
CommonName string `json:"common_name" table:"Common Name"`
Authority string `json:"authority"`
SerialNumber string `json:"serial_number" table:"Serial Number"`
Status string `json:"status"`
RequestedBy string `json:"requested_by" table:"Requested By"`
AddedAt utils.Timestamp `json:"added_at" table:"Added At"`
ErrorMessage string `json:"error_message" table:"-"`
HandledAt utils.Timestamp `json:"handled_at" table:"-"`
}
func GetRevokeRequestList ¶ added in v1.2.0
func GetRevokeRequestList(ac *client.AlpaconClient, status string, certificate string) ([]RevokeRequestAttributes, error)
type RevokeRequestCreate ¶ added in v1.2.0
type RevokeRequestResponse ¶ added in v1.2.0
type RevokeRequestResponse struct {
ID string `json:"id"`
Certificate string `json:"certificate"`
Authority AuthoritySummary `json:"authority"`
CommonName string `json:"common_name"`
SerialNumber string `json:"serial_number"`
Reason int `json:"reason"`
Status string `json:"status"`
RequestedReason string `json:"requested_reason"`
RequestedBy types.UserSummary `json:"requested_by"`
AddedAt time.Time `json:"added_at"`
ErrorMessage string `json:"error_message"`
HandledAt *time.Time `json:"handled_at"`
}
func CreateRevokeRequest ¶ added in v1.2.0
func CreateRevokeRequest(ac *client.AlpaconClient, request RevokeRequestCreate) (RevokeRequestResponse, error)
type SignRequest ¶
type SignRequest struct {
DomainList []string `json:"domain_list"`
IpList []string `json:"ip_list"`
// ValidDays is omitted when zero so the server applies the CA's default_valid_days.
ValidDays int `json:"valid_days,omitempty"`
CsrText string `json:"csr_text,omitempty"`
RequestedBy string `json:"requested_by,omitempty"`
}
type SignRequestDetail ¶ added in v1.0.0
type SignRequestResponse ¶
type SignRequestResponse struct {
ID string `json:"id"`
Organization string `json:"organization"`
CommonName string `json:"common_name"`
DomainList []string `json:"domain_list"`
IpList []string `json:"ip_list"`
ValidDays int `json:"valid_days"`
Status string `json:"status"`
RequestedIp string `json:"requested_ip"`
RequestedBy types.UserSummary `json:"requested_by"`
SubmitURL string `json:"submit_url"`
}
func CreateSignRequest ¶
func CreateSignRequest(ac *client.AlpaconClient, signRequest SignRequest) (SignRequestResponse, error)
Click to show internal directories.
Click to hide internal directories.