Documentation ¶
Index ¶
- Variables
- func APIErrorMsg(r io.Reader) string
- func CACerts(t *testing.T) (string, string)
- func Deref[T dereferencable](v *T) (r T)
- func Describe(component string) (string, map[string]string, error)
- func DiagnosticsToErr(diagnostics diag.Diagnostics) error
- func FixAttestationAuthority(t *testing.T, catalog string) *v20231101.AttestationAuthority
- func IsDurationEqual(a, b string) bool
- func IsJSONEqual(a, b string) bool
- func NewAccount(t *testing.T) (*v20231101.Account, *v20231101.WifiAccount)
- func NewAuthority(t *testing.T) *v20231101.Authority
- func NewCollection(t *testing.T) *v20231101.Collection
- func NewCollectionInstance(t *testing.T, slug string) *v20231101.CollectionInstance
- func NewDeviceCollectionAccount(t *testing.T) (*v20231101.DeviceCollectionAccount, string)
- func NewJWK(t *testing.T, pass string) (string, string)
- func NewOIDCProvisioner(t *testing.T, authorityID string) (*v20231101.Provisioner, *v20231101.OidcProvisioner)
- func NewTPMDeviceCollection(t *testing.T, authorityID string) *v20231101.DeviceCollection
- func NewWebhook(t *testing.T, provisionerID, authorityID string) *v20231101.ProvisionerWebhook
- func Slug(t *testing.T) string
- func SmallstepAPIClientFromEnv() (*v20231101.Client, error)
- func SweepAttestationAuthorities() error
- func ToEqualString(ctx context.Context, remote *string, state AttributeGetter, p path.Path, ...) (types.String, diag.Diagnostics)
- func ToIntPointer(i64 *int64) *int
- func ToOptionalBool(ctx context.Context, remote *bool, priorState AttributeGetter, p path.Path) (types.Bool, diag.Diagnostics)
- func ToOptionalInt(ctx context.Context, remote *int, priorState AttributeGetter, p path.Path) (types.Int64, diag.Diagnostics)
- func ToOptionalList(ctx context.Context, remote *[]string, priorState AttributeGetter, p path.Path) (types.List, diag.Diagnostics)
- func ToOptionalSet(ctx context.Context, remote *[]string, priorState AttributeGetter, p path.Path) (types.Set, diag.Diagnostics)
- func ToOptionalString[S ~string](ctx context.Context, remote *S, priorState AttributeGetter, p path.Path) (types.String, diag.Diagnostics)
- func ToStringPointer[Out ~string](str *string) *Out
- type AttributeGetter
- type IsStringEqual
Constants ¶
This section is empty.
Variables ¶
var UUID = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
Functions ¶
func APIErrorMsg ¶
APIErrorMsg attempts to parse .Message from the API JSON response. Otherwise it returns the full response body.
func Deref ¶
func Deref[T dereferencable](v *T) (r T)
Deref gets the default value for a pointer type. This makes it easier to work with the generated API client code, which uses pointers for optional fields.
func Describe ¶
Describe parses descriptions for a component from its schema in Smallstep's OpenAPI spec. This ensures the terraform attribute documentation is kept in sync with the API spec.
func DiagnosticsToErr ¶ added in v0.2.0
func DiagnosticsToErr(diagnostics diag.Diagnostics) error
func FixAttestationAuthority ¶ added in v0.2.0
func FixAttestationAuthority(t *testing.T, catalog string) *v20231101.AttestationAuthority
There can only be 1 per team - don't try to create a new one if one exists
func IsDurationEqual ¶ added in v0.2.0
func IsJSONEqual ¶ added in v0.2.0
func NewAccount ¶ added in v0.5.0
func NewCollection ¶ added in v0.2.0
func NewCollection(t *testing.T) *v20231101.Collection
func NewCollectionInstance ¶ added in v0.2.0
func NewCollectionInstance(t *testing.T, slug string) *v20231101.CollectionInstance
func NewDeviceCollectionAccount ¶ added in v0.5.0
func NewDeviceCollectionAccount(t *testing.T) (*v20231101.DeviceCollectionAccount, string)
func NewOIDCProvisioner ¶ added in v0.2.0
func NewOIDCProvisioner(t *testing.T, authorityID string) (*v20231101.Provisioner, *v20231101.OidcProvisioner)
func NewTPMDeviceCollection ¶ added in v0.5.0
func NewTPMDeviceCollection(t *testing.T, authorityID string) *v20231101.DeviceCollection
func NewWebhook ¶ added in v0.2.0
func NewWebhook(t *testing.T, provisionerID, authorityID string) *v20231101.ProvisionerWebhook
func SweepAttestationAuthorities ¶ added in v0.2.0
func SweepAttestationAuthorities() error
func ToEqualString ¶ added in v0.2.0
func ToEqualString(ctx context.Context, remote *string, state AttributeGetter, p path.Path, isEqual IsStringEqual) (types.String, diag.Diagnostics)
ToEqualString checks if a remote string is equivalent to a string in state and if so uses the string from state. This is used to avoid "inconsistent result after apply" errors for JSON and duration strings.
func ToIntPointer ¶ added in v0.2.0
func ToOptionalBool ¶ added in v0.2.0
func ToOptionalBool(ctx context.Context, remote *bool, priorState AttributeGetter, p path.Path) (types.Bool, diag.Diagnostics)
func ToOptionalInt ¶ added in v0.2.0
func ToOptionalInt(ctx context.Context, remote *int, priorState AttributeGetter, p path.Path) (types.Int64, diag.Diagnostics)
func ToOptionalList ¶ added in v0.2.0
func ToOptionalList(ctx context.Context, remote *[]string, priorState AttributeGetter, p path.Path) (types.List, diag.Diagnostics)
func ToOptionalSet ¶ added in v0.2.0
func ToOptionalSet(ctx context.Context, remote *[]string, priorState AttributeGetter, p path.Path) (types.Set, diag.Diagnostics)
func ToOptionalString ¶ added in v0.2.0
func ToOptionalString[S ~string](ctx context.Context, remote *S, priorState AttributeGetter, p path.Path) (types.String, diag.Diagnostics)