Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertBase64(importValue string) (interface{}, error)
- func ConvertBool(importValue string) (interface{}, error)
- func ConvertEmpty(importValue string) (interface{}, error)
- func ConvertID(id string) (interface{}, error)
- func ConvertJSON(importValue string) (interface{}, error)
- func ConvertNonEmpty(importValue string) (interface{}, error)
- func CtxSetOrgID(ctx context.Context, orgID string) context.Context
- func CtxWithID(ctx context.Context, d *schema.ResourceData) context.Context
- func CtxWithOrgID(ctx context.Context, d *schema.ResourceData) context.Context
- func DescriptionEnumValuesList(enum map[int32]string) string
- func EnumValueMap(enum map[int32]string) map[string]int32
- func EnumValueValidation(ty string, checkValue interface{}, enumValues map[string]int32) diag.Diagnostics
- func EnumValuesValidation(ty string, checkValuesSet interface{}, enumValues map[string]int32) diag.Diagnostics
- func GetAddAndDelete(current []string, desired []string) ([]string, []string)
- func GetAdminClient(ctx context.Context, info *ClientInfo) (*admin.Client, error)
- func GetID(d *schema.ResourceData, idVar string) string
- func GetManagementClient(ctx context.Context, info *ClientInfo) (*management.Client, error)
- func GetOkSetToStringSlice(d *schema.ResourceData, value string) []string
- func GetStringFromAttr(ctx context.Context, attrs map[string]attr.Value, key string) string
- func IgnoreAlreadyExistsError(err error) error
- func IgnoreIfNotFoundError(err error) error
- func IgnorePreconditionError(err error) error
- func ImportIDValidationError(givenID string, requiredKeys, optionalKeys []string, err error) error
- func ImportWithAttributes(attrs ...importAttribute) *schema.ResourceImporter
- func ImportWithEmptyID(attributes ...importAttribute) *schema.ResourceImporter
- func ImportWithID(idVar string, attributes ...importAttribute) *schema.ResourceImporter
- func ImportWithIDAndOptionalOrg(idVar string, attributes ...importAttribute) *schema.ResourceImporter
- func ImportWithIDAndOptionalOrgAndSecret(idVar, secretKey string) *schema.ResourceImporter
- func ImportWithIDAndOptionalSecret(idVar, secretKey string) *schema.ResourceImporter
- func ImportWithOptionalOrg(attributes ...importAttribute) *schema.ResourceImporter
- func InstanceFormFilePost(ctx context.Context, clientInfo *ClientInfo, endpoint, path string) diag.Diagnostics
- func NewClientWithInterceptorFromKeyFile(ctx context.Context, issuer, keyPath string, scopes []string) (*http.Client, error)
- func NewClientWithInterceptorFromKeyFileData(ctx context.Context, issuer string, data []byte, scopes []string) (*http.Client, error)
- func NewImportAttribute(key string, value ConvertStringFunc, optional bool) importAttribute
- func OrgFormFilePost(ctx context.Context, clientInfo *ClientInfo, endpoint, path, orgID string) diag.Diagnostics
- func SetToStringSlice(set *schema.Set) []string
- type ClientInfo
- type ConvertStringFunc
- type ImportAttributes
- type Interceptor
- type Stringified
- type Stringify
Constants ¶
const ( DomainVar = "domain" InsecureVar = "insecure" TokenVar = "token" PortVar = "port" JWTProfileFile = "jwt_profile_file" JWTProfileJSON = "jwt_profile_json" )
const (
OrgIDVar = "org_id"
)
Variables ¶
var ( ImportOptionalOrgAttribute = NewImportAttribute(OrgIDVar, ConvertID, true) SemicolonPlaceholder = "__SEMICOLON__" )
var ( // ZitadelGeneratedIdPattern matches IDs like 123456789012345678 // ZITADEL IDs have 18 digits ZitadelGeneratedIdPattern = `\d{18}` ZitadelGeneratedIdOnlyRegex = regexp.MustCompile(fmt.Sprintf(`^%s$`, ZitadelGeneratedIdPattern)) OrgIDResourceField = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "ID of the organization", ForceNew: true, ValidateDiagFunc: func(i interface{}, path cty.Path) diag.Diagnostics { _, err := ConvertID(i.(string)) return diag.FromErr(err) }, } ResourceIDDatasourceField = &schema.Schema{ Type: schema.TypeString, Required: true, Description: "ID of the resource", } OrgIDDatasourceField = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "ID of the organization", } )
Functions ¶
func ConvertBase64 ¶ added in v2.0.3
func ConvertBool ¶
func ConvertEmpty ¶
func ConvertJSON ¶
func ConvertNonEmpty ¶
func CtxWithOrgID ¶
func EnumValueValidation ¶
func EnumValueValidation(ty string, checkValue interface{}, enumValues map[string]int32) diag.Diagnostics
func EnumValuesValidation ¶
func EnumValuesValidation(ty string, checkValuesSet interface{}, enumValues map[string]int32) diag.Diagnostics
func GetAddAndDelete ¶
func GetAdminClient ¶
func GetManagementClient ¶
func GetManagementClient(ctx context.Context, info *ClientInfo) (*management.Client, error)
func GetOkSetToStringSlice ¶
func GetOkSetToStringSlice(d *schema.ResourceData, value string) []string
func GetStringFromAttr ¶
func IgnoreIfNotFoundError ¶
func IgnorePreconditionError ¶
func ImportIDValidationError ¶
ImportIDValidationError wraps err with a help message about the expected format if it is not nil
func ImportWithAttributes ¶
func ImportWithAttributes(attrs ...importAttribute) *schema.ResourceImporter
func ImportWithEmptyID ¶
func ImportWithEmptyID(attributes ...importAttribute) *schema.ResourceImporter
ImportWithEmptyID returns a ResourceImporter that does not use the first import string position value for the states SetID call. It uses a dummy value, instead.
func ImportWithID ¶
func ImportWithID(idVar string, attributes ...importAttribute) *schema.ResourceImporter
ImportWithID is a convenience function that calls ImportWithAttributes. It returns a ResourceImporter that expects a ZITADEL ID number at the first import string position along with other given attributes. idVar is only relevant for the error message, the resources SetID function is called with first argument ID
func ImportWithIDAndOptionalOrg ¶
func ImportWithIDAndOptionalOrg(idVar string, attributes ...importAttribute) *schema.ResourceImporter
ImportWithIDAndOptionalOrg is a convenience function that calls ImportWithID and passes an optional attribute for the org ID along with the other given attributes.
func ImportWithIDAndOptionalOrgAndSecret ¶
func ImportWithIDAndOptionalOrgAndSecret(idVar, secretKey string) *schema.ResourceImporter
ImportWithIDAndOptionalOrgAndSecret is a convenience function that calls ImportWithIDAndOptionalOrg and passes an optional attribute for the secret var at secretKey.
func ImportWithIDAndOptionalSecret ¶
func ImportWithIDAndOptionalSecret(idVar, secretKey string) *schema.ResourceImporter
ImportWithIDAndOptionalSecret is a convenience function that calls ImportWithID and passes an optional attribute for the secret var at secretKey.
func ImportWithOptionalOrg ¶
func ImportWithOptionalOrg(attributes ...importAttribute) *schema.ResourceImporter
ImportWithOptionalOrg is a convenience function that calls ImportWithAttributes. It returns a ResourceImporter that accepts an optional organization id along with other given attributes
func InstanceFormFilePost ¶
func InstanceFormFilePost(ctx context.Context, clientInfo *ClientInfo, endpoint, path string) diag.Diagnostics
func NewImportAttribute ¶
func NewImportAttribute(key string, value ConvertStringFunc, optional bool) importAttribute
func OrgFormFilePost ¶
func OrgFormFilePost(ctx context.Context, clientInfo *ClientInfo, endpoint, path, orgID string) diag.Diagnostics
func SetToStringSlice ¶
Types ¶
type ClientInfo ¶
type ConvertStringFunc ¶
type ImportAttributes ¶
type ImportAttributes []importAttribute
func (ImportAttributes) Len ¶
func (i ImportAttributes) Len() int
func (ImportAttributes) Less ¶
func (i ImportAttributes) Less(j, k int) bool
Less makes the attributes sortable by putting the optional attributes to the end and the org id to the beginning of the optional attributes
func (ImportAttributes) Swap ¶
func (i ImportAttributes) Swap(j, k int)
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
type Stringified ¶
type Stringified struct {
Str string
}
func (*Stringified) String ¶
func (s *Stringified) String() string