sslcore

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func (Values) AllNil

func (v Values) AllNil() bool

AllNil reports whether certificate, certificate_authorities, and key are all null.

Jump to

Keyboard shortcuts

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