Documentation
¶
Overview ¶
Package sslcore holds the certificate/certificate_authorities/key conversion logic shared by Fleet resources that expose an `ssl` block (currently output and agentdownloadsource), so the null-normalizing and pointer-to-tfsdk-value mapping only has to be correct in one place. Resource-specific concerns -- extra sub-attributes such as output's verification_mode, update "clear" semantics, and schema-level validation -- stay in each resource package. agentdownloadsource's ssl object is exactly Values. output embeds Values and adds verification_mode.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(ctx context.Context, values Values, certificateAuthoritiesPath path.Path, diags *diag.Diagnostics) (certificate *string, certificateAuthorities *[]string, key *string)
Extract reads the certificate, certificate_authorities, and key sub-attributes out of an already-decoded ssl object model, converting them to the pointer representation the Fleet API models expect. certificateAuthoritiesPath attributes any list-conversion diagnostics.
Types ¶
type Values ¶
type Values struct {
Certificate types.String `tfsdk:"certificate"`
CertificateAuthorities types.List `tfsdk:"certificate_authorities"` // > string
Key types.String `tfsdk:"key"`
}
Values is the tfsdk object for an ssl block whose attributes are exactly certificate, certificate_authorities, and key. A resource that adds attributes embeds Values by value, with no tfsdk tag on the embed. terraform-plugin-framework promotes these fields onto the parent object, so the tags must match the schema attribute names on every embedder.
func Hydrate ¶
func Hydrate(ctx context.Context, certificate *string, certificateAuthorities *[]string, key *string, certificateAuthoritiesPath path.Path, diags *diag.Diagnostics) Values
Hydrate builds the tfsdk-typed certificate, certificate_authorities, and key values from a Fleet API response's ssl fields, normalizing an empty certificate_authorities list to null the same way a practitioner-omitted attribute would decode. Callers use Values.AllNil to collapse a present-but-empty ssl object down to ObjectNull.