Documentation
¶
Index ¶
- func BuildTargetRef(provider string, deploymentType deployPB.DeploymentType, ...) string
- func DeploymentErrorInfo(err error) (message string, retryable bool)
- func DeploymentTypeRefName(deploymentType deployPB.DeploymentType) string
- func EnsureResourceReady(resource DeploymentResource) error
- func FailureKind(err error) deployPB.FailureKind
- func IsContextFailure(err error) bool
- func IsPermissionDenied(err error) bool
- func IsPermissionDeniedCode(code string) bool
- func LeafCertificateSHA256(certificatePEM string) (string, error)
- func NewDeploymentError(message string, retryable bool, requestID string, cause error) error
- func NormalizeDomain(rawDomain string) (string, error)
- func NormalizeDomains(rawDomains ...string) []string
- func RequestID(err error) string
- func StableDomainIdentity(stableID, normalizedDomain, createdAt string) (string, bool)
- func ValidateCertificateForDomains(certificate CertificateMaterial, targetDomains []string, now time.Time) error
- func ValidateCertificateMaterial(certificate CertificateMaterial, targetDomain string, now time.Time) error
- func VerifyLeafCertificateSHA256(expectedPEM, actualPEM string) error
- type CertificateMaterial
- type CertificateUploader
- type ConnectionTester
- type DeploymentError
- type DeploymentResource
- type DeploymentResourceDeployer
- type DeploymentResourceProvider
- type DeploymentResult
- type ProviderHandler
- type ResourceCatalogResult
- type ResourceDiscoverer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTargetRef ¶ added in v0.7.0
func BuildTargetRef(provider string, deploymentType deployPB.DeploymentType, identityParts ...string) string
BuildTargetRef 使用稳定资源身份和 v2 部署类型生成不透明引用。
func DeploymentErrorInfo ¶ added in v0.6.4
DeploymentErrorInfo 只提取可返回后端的固定文案和重试分类。
func DeploymentTypeRefName ¶ added in v0.7.0
func DeploymentTypeRefName(deploymentType deployPB.DeploymentType) string
DeploymentTypeRefName 返回 targetRef 使用的简短稳定部署类型名。
func EnsureResourceReady ¶ added in v0.7.0
func EnsureResourceReady(resource DeploymentResource) error
EnsureResourceReady 拒绝不可执行的资源状态。
func FailureKind ¶ added in v0.7.0
func FailureKind(err error) deployPB.FailureKind
FailureKind 将错误归类为跨端稳定的部署失败类型。
func IsContextFailure ¶ added in v0.7.0
IsContextFailure 判断错误是否由调用方取消或超时引起。
func IsPermissionDenied ¶ added in v0.7.0
IsPermissionDenied 判断云 SDK 错误码是否明确表示缺少访问权限。
func IsPermissionDeniedCode ¶ added in v0.7.0
IsPermissionDeniedCode 按明确错误码白名单识别权限不足,避免只凭 HTTP 403 误判。
func LeafCertificateSHA256 ¶ added in v0.7.0
LeafCertificateSHA256 计算 PEM 中叶证书 DER 内容的 SHA-256 指纹。
func NewDeploymentError ¶ added in v0.6.4
NewDeploymentError 创建一个带重试属性的云部署错误。
func NormalizeDomain ¶ added in v0.7.0
NormalizeDomain 将云 API 返回的域名规范化为小写 ASCII DNS 名称。
func NormalizeDomains ¶ added in v0.7.0
NormalizeDomains 规范化、去重并稳定排序域名集合。
func StableDomainIdentity ¶ added in v0.7.0
StableDomainIdentity 优先使用云端稳定 ID;缺少 ID 时要求域名和创建时间共同标识资源生命周期。
func ValidateCertificateForDomains ¶ added in v0.7.0
func ValidateCertificateForDomains(certificate CertificateMaterial, targetDomains []string, now time.Time) error
ValidateCertificateForDomains 校验证书材料覆盖资源的全部域名。
func ValidateCertificateMaterial ¶ added in v0.6.4
func ValidateCertificateMaterial(certificate CertificateMaterial, targetDomain string, now time.Time) error
ValidateCertificateMaterial 校验证书有效期、域名覆盖关系和证书私钥匹配关系。
func VerifyLeafCertificateSHA256 ¶ added in v0.7.0
VerifyLeafCertificateSHA256 比较提交证书与控制面回读证书的叶证书 SHA-256 指纹。
Types ¶
type CertificateMaterial ¶ added in v0.6.4
type CertificateMaterial struct {
Name string // Name 云厂商证书备注或别名。
Domain string // Domain 证书申请主域名,仅用于展示和兼容旧业务。
CertificatePEM string // CertificatePEM 完整 PEM 证书链。
PrivateKeyPEM string // PrivateKeyPEM PEM 私钥。
}
CertificateMaterial 封装云部署使用的证书材料。
type CertificateUploader ¶ added in v0.6.4
type CertificateUploader interface {
// UploadCertificate 使用调用方上下文上传证书材料。
UploadCertificate(ctx context.Context, certificate CertificateMaterial) error
}
CertificateUploader 将证书上传到云厂商证书中心。
type ConnectionTester ¶ added in v0.6.4
type ConnectionTester interface {
// TestConnection 使用调用方上下文测试云厂商控制面连接。
TestConnection(ctx context.Context) (bool, error)
}
ConnectionTester 测试云厂商凭据是否可以访问对应控制面。
type DeploymentError ¶ added in v0.6.4
type DeploymentError struct {
Message string // Message 可安全返回后端的脱敏错误说明。
Retryable bool // Retryable 表示后端是否可以自动重试。
RequestID string // RequestID 云厂商请求 ID。
Cause error // Cause 保留原始错误链;跨端 ACK 禁止使用,在线日志必须先脱敏。
}
DeploymentError 描述云资源部署失败的重试属性和云厂商请求编号。
func (*DeploymentError) Error ¶ added in v0.6.4
func (e *DeploymentError) Error() string
Error 返回本地诊断信息;跨端回传必须经过 DeploymentErrorInfo 脱敏。
func (*DeploymentError) Unwrap ¶ added in v0.6.4
func (e *DeploymentError) Unwrap() error
Unwrap 返回原始错误,供 errors.Is 和 errors.As 使用。
type DeploymentResource ¶ added in v0.6.4
type DeploymentResource struct {
TargetRef string // TargetRef 客户端根据资源身份自动生成的不透明稳定引用。
Label string // Label 本地展示名称。
Domain string // Domain 实际绑定证书的域名。
Domains []string // Domains 是资源当前绑定的全部规范化域名。
Group string // Group 是站点、Bucket 或负载均衡实例的脱敏展示名称。
Region string // Region 云资源所在地域。
Protocol string // Protocol 是资源当前使用的公开协议名称。
Status string // Status 是云端返回的脱敏运行状态。
Availability deployPB.DeploymentResourceAvailability // Availability 是资源是否可测试和部署的结构化状态。
Endpoint string // Endpoint OSS endpoint 覆盖值。
Bucket string // Bucket 对象存储 Bucket。
SiteID string // SiteID 阿里云 ESA Site ID。
SiteIDs []string // SiteIDs 是需要联动更新或同步的多个站点 ID,不得上报。
ZoneID string // ZoneID 腾讯云 EdgeOne Zone ID。
LoadBalancerID string // LoadBalancerID 负载均衡实例 ID。
ListenerPort int // ListenerPort 负载均衡监听端口。
ListenerID string // ListenerID 腾讯云 CLB 或阿里云 ALB/NLB 监听器 ID。
ResourceID string // ResourceID 是仅供 deploy 本地解析的云资源稳定身份,不得上报。
CreatedAt string // CreatedAt 用于区分删除后重建的同名资源,不得上报。
}
DeploymentResource 描述从明确业务配置中精确解析出的部署资源。
func FindResourceByTargetRef ¶ added in v0.7.0
func FindResourceByTargetRef(resources []DeploymentResource, targetRef string) (DeploymentResource, error)
FindResourceByTargetRef 要求目录中只有一个资源匹配引用。
type DeploymentResourceDeployer ¶ added in v0.6.4
type DeploymentResourceDeployer interface {
// DeployCertificate 将证书部署到指定 v2 部署类型对应的精确资源。
DeployCertificate(ctx context.Context, certificate CertificateMaterial, deploymentType deployPB.DeploymentType, resource DeploymentResource) (DeploymentResult, error)
}
DeploymentResourceDeployer 将证书部署到一个明确业务下已经精确解析的资源。
type DeploymentResourceProvider ¶ added in v0.7.0
type DeploymentResourceProvider interface {
ResourceDiscoverer
DeploymentResourceDeployer
}
DeploymentResourceProvider 组合动态发现、解析、测试和精确部署能力。
type DeploymentResult ¶ added in v0.6.4
type DeploymentResult struct {
RequestID string // RequestID 云厂商请求 ID。
Message string // Message 不包含凭据或敏感资源定位参数的结果说明。
}
DeploymentResult 描述云 API 接受部署后的脱敏诊断信息。
type ProviderHandler ¶
type ProviderHandler interface {
ConnectionTester
CertificateUploader
}
ProviderHandler 组合证书中心上传业务所需的连接测试和证书上传能力。
type ResourceCatalogResult ¶ added in v0.7.0
type ResourceCatalogResult struct {
Resources []DeploymentResource // Resources 是成功发现且可安全上报的资源。
Status deployPB.DeploymentResourceStatus // Status 是完整、部分或失败等目录状态。
Error error // Error 是诊断详情;在线展示必须先经过日志脱敏层。
}
ResourceCatalogResult 描述一个明确云业务的实时脱敏资源目录。
type ResourceDiscoverer ¶ added in v0.7.0
type ResourceDiscoverer interface {
// DiscoverResources 实时读取指定部署类型下的全部可识别资源。
DiscoverResources(ctx context.Context, deploymentType deployPB.DeploymentType) ResourceCatalogResult
// ResolveResource 实时读取目录并按不透明引用唯一解析资源。
ResolveResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) (DeploymentResource, error)
// TestResource 确认资源仍存在、可读且具备精确证书部署条件。
TestResource(ctx context.Context, deploymentType deployPB.DeploymentType, targetRef string) error
}
ResourceDiscoverer 统一云资源的实时发现、引用解析和只读连接测试。
Directories
¶
| Path | Synopsis |
|---|---|
|
Package baidu implements Baidu Cloud certificate-center upload and CDN deployment.
|
Package baidu implements Baidu Cloud certificate-center upload and CDN deployment. |
|
Package dogecloud implements DogeCloud certificate upload and CDN deployment.
|
Package dogecloud implements DogeCloud certificate upload and CDN deployment. |
|
Package huawei implements Huawei Cloud SCM, CDN, DCDN, OBS and ELB certificate deployment flows.
|
Package huawei implements Huawei Cloud SCM, CDN, DCDN, OBS and ELB certificate deployment flows. |
|
Package jdcloud implements JD Cloud certificate-center upload and CDN deployment.
|
Package jdcloud implements JD Cloud certificate-center upload and CDN deployment. |
|
Package lecdn implements LeCDN certificate discovery and in-place CDN deployment.
|
Package lecdn implements LeCDN certificate discovery and in-place CDN deployment. |
|
Package qiniu implements certificate upload and exact-domain certificate deployment for Qiniu CDN products.
|
Package qiniu implements certificate upload and exact-domain certificate deployment for Qiniu CDN products. |
|
Package volcengine implements verified Volcengine certificate deployment flows.
|
Package volcengine implements verified Volcengine certificate deployment flows. |