Documentation
¶
Index ¶
- Constants
- Variables
- func MarshalAuthenticationAPIForRead(ctx context.Context, ...) (basetypes.ObjectValue, diag.Diagnostics)
- func MarshalAuthenticationAPIKeyForRead(ctx context.Context, ...) (basetypes.ObjectValue, diag.Diagnostics)
- func MarshalAuthenticationForRead(ctx context.Context, ...) (basetypes.ObjectValue, diag.Diagnostics)
- func MarshalAuthenticationSAMLForRead(ctx context.Context, ...) (basetypes.ObjectValue, diag.Diagnostics)
- func MarshalAuthenticationTwoFactorForRead(ctx context.Context, ...) (basetypes.ObjectValue, diag.Diagnostics)
- func MarshalEmailForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
- func MarshalLastUsedDashboardAtForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
- func MarshalNameForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
- func NewDataSource() datasource.DataSource
- type APIModel
- type AuthenticationModel
- type DataSource
- func (d *DataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (d *DataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
- type DataSourceModel
- type KeyModel
- type SAMLModel
- type TwoFactorModel
Constants ¶
const ( DatasourceIdentitiesMeKey = "identities_me" DatasourceIdentitiesMeAuthenticationKey = "authentication" DatasourceIdentitiesMeAPIKey = "api" DatasourceIdentitiesMeSAMLKey = "saml" DatasourceIdentitiesMeTwoFactorKey = "two_factor" )
Attribute key constants
Variables ¶
var APIType = map[string]attr.Type{ "key": types.ObjectType{AttrTypes: KeyType}, }
APIType defines the attribute types for APIModel.
var AuthenticationType = map[string]attr.Type{ "mode": types.StringType, "api": types.ObjectType{AttrTypes: APIType}, "saml": types.ObjectType{AttrTypes: SAMLType}, "two_factor": types.ObjectType{AttrTypes: TwoFactorType}, }
AuthenticationType defines the attribute types for AuthenticationModel.
var DataSourceType = map[string]attr.Type{ "id": types.StringType, "name": types.StringType, "email": types.StringType, "last_used_dashboard_at": types.StringType, "authentication": types.ObjectType{AttrTypes: AuthenticationType}, }
DataSourceType defines the attribute types for DataSourceModel.
var DatasourceAPIAttributes = schema.SingleNestedAttribute{ MarkdownDescription: "API details for the user.", Computed: true, Attributes: map[string]schema.Attribute{ "key": schema.SingleNestedAttribute{ MarkdownDescription: "API key details.", Computed: true, Attributes: map[string]schema.Attribute{ "created": schema.BoolAttribute{ MarkdownDescription: "Whether the API key is created.", Computed: true, }, }, }, }, }
DatasourceAPIAttributes defines the schema for API details.
var DatasourceAuthenticationAttributes = schema.SingleNestedAttribute{ MarkdownDescription: "Authentication details for the user.", Computed: true, Attributes: map[string]schema.Attribute{ "mode": schema.StringAttribute{ MarkdownDescription: "The authentication mode.", Computed: true, }, "api": DatasourceAPIAttributes, "saml": DatasourceSAMLAttributes, "two_factor": DatasourceTwoFactorAttributes, }, }
DatasourceAuthenticationAttributes defines the schema for the authentication object.
var DatasourceSAMLAttributes = schema.SingleNestedAttribute{ MarkdownDescription: "Details about SAML authentication.", Computed: true, Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ MarkdownDescription: "Whether SAML authentication is enabled.", Computed: true, }, }, }
DatasourceSAMLAttributes defines the schema for SAML authentication.
var DatasourceTwoFactorAttributes = schema.SingleNestedAttribute{ MarkdownDescription: "Details about two-factor authentication.", Computed: true, Attributes: map[string]schema.Attribute{ "enabled": schema.BoolAttribute{ MarkdownDescription: "Whether two-factor authentication is enabled.", Computed: true, }, }, }
DatasourceTwoFactorAttributes defines the schema for two-factor authentication.
var GetDatasourceSchema = schema.Schema{ MarkdownDescription: "Returns the identity of the current user.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ MarkdownDescription: "Unique identifier for this data source. Always set to 'identities_me'.", Computed: true, }, "name": schema.StringAttribute{ MarkdownDescription: "The name of the user.", Computed: true, }, "email": schema.StringAttribute{ MarkdownDescription: "The email of the user.", Computed: true, }, "last_used_dashboard_at": schema.StringAttribute{ MarkdownDescription: "The last time the user was active on the Dashboard UI.", Computed: true, }, "authentication": DatasourceAuthenticationAttributes, }, }
GetDatasourceSchema defines the schema for the current user's identity.
KeyType defines the attribute types for KeyModel.
SAMLType defines the attribute types for SAMLModel.
TwoFactorType defines the attribute types for TwoFactorModel.
Functions ¶
func MarshalAuthenticationAPIForRead ¶
func MarshalAuthenticationAPIForRead(ctx context.Context, api *client.GetAdministeredIdentitiesMe200ResponseAuthenticationApi) (basetypes.ObjectValue, diag.Diagnostics)
MarshalAuthenticationAPIForRead maps the API object from the Authentication section of the API response to Terraform state.
func MarshalAuthenticationAPIKeyForRead ¶
func MarshalAuthenticationAPIKeyForRead(ctx context.Context, key *client.GetAdministeredIdentitiesMe200ResponseAuthenticationApiKey) (basetypes.ObjectValue, diag.Diagnostics)
MarshalAuthenticationAPIKeyForRead maps the API Key object to Terraform state.
func MarshalAuthenticationForRead ¶
func MarshalAuthenticationForRead(ctx context.Context, auth *client.GetAdministeredIdentitiesMe200ResponseAuthentication, diags diag.Diagnostics) (basetypes.ObjectValue, diag.Diagnostics)
MarshalAuthenticationForRead maps the Authentication object from the API response to the Terraform state.
func MarshalAuthenticationSAMLForRead ¶
func MarshalAuthenticationSAMLForRead(ctx context.Context, saml *client.GetAdministeredIdentitiesMe200ResponseAuthenticationSaml) (basetypes.ObjectValue, diag.Diagnostics)
MarshalAuthenticationSAMLForRead maps the SAML object from the Authentication section of the API response to Terraform state.
func MarshalAuthenticationTwoFactorForRead ¶
func MarshalAuthenticationTwoFactorForRead(ctx context.Context, twoFactor *client.GetAdministeredIdentitiesMe200ResponseAuthenticationTwoFactor) (basetypes.ObjectValue, diag.Diagnostics)
MarshalAuthenticationTwoFactorForRead maps the TwoFactor object from the Authentication section of the API response to Terraform state.
func MarshalEmailForRead ¶
func MarshalEmailForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
MarshalEmailForRead maps the Email field from the API response to the Terraform state.
func MarshalLastUsedDashboardAtForRead ¶
func MarshalLastUsedDashboardAtForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
MarshalLastUsedDashboardAtForRead maps and validates the LastUsedDashboardAt field from the API response.
func MarshalNameForRead ¶
func MarshalNameForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) types.String
MarshalNameForRead maps the Name field from the API response to the Terraform state.
func NewDataSource ¶
func NewDataSource() datasource.DataSource
NewDataSource initializes a new Administered Identities Me data source.
Types ¶
type AuthenticationModel ¶
type AuthenticationModel struct { Mode types.String `tfsdk:"mode" json:"mode"` API types.Object `tfsdk:"api" json:"api"` SAML types.Object `tfsdk:"saml" json:"saml"` TwoFactor types.Object `tfsdk:"two_factor" json:"twoFactor"` }
AuthenticationModel represents authentication attributes for a user.
type DataSource ¶
type DataSource struct {
// contains filtered or unexported fields
}
DataSource implements the Terraform data source for retrieving the current user's identity.
func (*DataSource) Configure ¶
func (d *DataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
Configure initializes the API client for the data source.
func (*DataSource) Metadata ¶
func (d *DataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata sets the data source type name.
func (*DataSource) Read ¶
func (d *DataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read retrieves the current user's identity and populates the Terraform state.
func (*DataSource) Schema ¶
func (d *DataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Schema sets the data source schema.
type DataSourceModel ¶
type DataSourceModel struct { Id types.String `tfsdk:"id" json:"-"` // Unique identifier for the datasource. Name types.String `tfsdk:"name" json:"name"` // The user's name. Email types.String `tfsdk:"email" json:"email"` // The user's email address. LastUsedDashboardAt types.String `tfsdk:"last_used_dashboard_at" json:"lastUsedDashboardAt"` // Last dashboard access time. Authentication types.Object `tfsdk:"authentication" json:"authentication"` // Authentication details. }
DataSourceModel represents the main data model for identities.
func MarshalIdentitiesMeForRead ¶
func MarshalIdentitiesMeForRead(ctx context.Context, inlineResp *client.GetAdministeredIdentitiesMe200Response) (DataSourceModel, diag.Diagnostics)
MarshalIdentitiesMeForRead maps the API response into the Terraform state model for the identities_me resource.
type TwoFactorModel ¶
TwoFactorModel represents two-factor authentication attributes.