From 6872b6380406be1616cc7812bcc11e8cd7535ec8 Mon Sep 17 00:00:00 2001 From: joerger Date: Tue, 8 Oct 2024 11:39:00 -0700 Subject: [PATCH] Upate terraform schema. --- .../terraform/tfschema/types_terraform.go | 222 +++++++++++++++++- 1 file changed, 221 insertions(+), 1 deletion(-) diff --git a/integrations/terraform/tfschema/types_terraform.go b/integrations/terraform/tfschema/types_terraform.go index 70a85e7c24d3b..afd846111510b 100644 --- a/integrations/terraform/tfschema/types_terraform.go +++ b/integrations/terraform/tfschema/types_terraform.go @@ -3052,6 +3052,11 @@ func GenSchemaSAMLConnectorV2(ctx context.Context) (github_com_hashicorp_terrafo Optional: true, Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, }, + "force_authn": { + Description: "ForceAuthn specified whether re-authentication should be forced on login. UNSPECIFIED is treated as NO.", + Optional: true, + Type: github_com_hashicorp_terraform_plugin_framework_types.Int64Type, + }, "issuer": { Computed: true, Description: "Issuer is the identity provider issuer.", @@ -3061,13 +3066,18 @@ func GenSchemaSAMLConnectorV2(ctx context.Context) (github_com_hashicorp_terrafo }, "mfa": { Attributes: github_com_hashicorp_terraform_plugin_framework_tfsdk.SingleNestedAttributes(map[string]github_com_hashicorp_terraform_plugin_framework_tfsdk.Attribute{ + "cert": { + Description: "Cert is the identity provider certificate PEM. IDP signs `` responses using this certificate.", + Optional: true, + Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, + }, "enabled": { Description: "Enabled specified whether this SAML connector supports MFA checks. Defaults to false.", Optional: true, Type: github_com_hashicorp_terraform_plugin_framework_types.BoolType, }, "entity_descriptor": { - Description: "EntityDescriptor is XML with descriptor. It can be used to supply configuration parameters in one XML file rather than supplying them in the individual elements.", + Description: "EntityDescriptor is XML with descriptor. It can be used to supply configuration parameters in one XML file rather than supplying them in the individual elements. Usually set from EntityDescriptorUrl.", Optional: true, Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, }, @@ -3076,6 +3086,21 @@ func GenSchemaSAMLConnectorV2(ctx context.Context) (github_com_hashicorp_terrafo Optional: true, Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, }, + "force_authn": { + Description: "ForceAuthn specified whether re-authentication should be forced for MFA checks. UNSPECIFIED is treated as YES to always re-authentication for MFA checks. This should only be set to NO if the IdP is setup to perform MFA checks on top of active user sessions.", + Optional: true, + Type: github_com_hashicorp_terraform_plugin_framework_types.Int64Type, + }, + "issuer": { + Description: "Issuer is the identity provider issuer. Usually set from EntityDescriptor.", + Optional: true, + Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, + }, + "sso": { + Description: "SSO is the URL of the identity provider's SSO service. Usually set from EntityDescriptor.", + Optional: true, + Type: github_com_hashicorp_terraform_plugin_framework_types.StringType, + }, }), Description: "MFASettings contains settings to enable SSO MFA checks through this auth connector.", Optional: true, @@ -31015,7 +31040,92 @@ func CopySAMLConnectorV2FromTerraform(_ context.Context, tf github_com_hashicorp } } } + { + a, ok := tf.Attrs["force_authn"] + if !ok { + diags.Append(attrReadMissingDiag{"SAMLConnectorV2.Spec.MFASettings.force_authn"}) + } else { + v, ok := a.(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + diags.Append(attrReadConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.force_authn", "github.com/hashicorp/terraform-plugin-framework/types.Int64"}) + } else { + var t github_com_gravitational_teleport_api_types.SAMLForceAuthn + if !v.Null && !v.Unknown { + t = github_com_gravitational_teleport_api_types.SAMLForceAuthn(v.Value) + } + obj.ForceAuthn = t + } + } + } + { + a, ok := tf.Attrs["issuer"] + if !ok { + diags.Append(attrReadMissingDiag{"SAMLConnectorV2.Spec.MFASettings.issuer"}) + } else { + v, ok := a.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrReadConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.issuer", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } else { + var t string + if !v.Null && !v.Unknown { + t = string(v.Value) + } + obj.Issuer = t + } + } + } + { + a, ok := tf.Attrs["sso"] + if !ok { + diags.Append(attrReadMissingDiag{"SAMLConnectorV2.Spec.MFASettings.sso"}) + } else { + v, ok := a.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrReadConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.sso", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } else { + var t string + if !v.Null && !v.Unknown { + t = string(v.Value) + } + obj.Sso = t + } + } + } + { + a, ok := tf.Attrs["cert"] + if !ok { + diags.Append(attrReadMissingDiag{"SAMLConnectorV2.Spec.MFASettings.cert"}) + } else { + v, ok := a.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrReadConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.cert", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } else { + var t string + if !v.Null && !v.Unknown { + t = string(v.Value) + } + obj.Cert = t + } + } + } + } + } + } + } + { + a, ok := tf.Attrs["force_authn"] + if !ok { + diags.Append(attrReadMissingDiag{"SAMLConnectorV2.Spec.ForceAuthn"}) + } else { + v, ok := a.(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + diags.Append(attrReadConversionFailureDiag{"SAMLConnectorV2.Spec.ForceAuthn", "github.com/hashicorp/terraform-plugin-framework/types.Int64"}) + } else { + var t github_com_gravitational_teleport_api_types.SAMLForceAuthn + if !v.Null && !v.Unknown { + t = github_com_gravitational_teleport_api_types.SAMLForceAuthn(v.Value) } + obj.ForceAuthn = t } } } @@ -32118,12 +32228,122 @@ func CopySAMLConnectorV2ToTerraform(ctx context.Context, obj *github_com_gravita tf.Attrs["entity_descriptor_url"] = v } } + { + t, ok := tf.AttrTypes["force_authn"] + if !ok { + diags.Append(attrWriteMissingDiag{"SAMLConnectorV2.Spec.MFASettings.force_authn"}) + } else { + v, ok := tf.Attrs["force_authn"].(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + i, err := t.ValueFromTerraform(ctx, github_com_hashicorp_terraform_plugin_go_tftypes.NewValue(t.TerraformType(ctx), nil)) + if err != nil { + diags.Append(attrWriteGeneralError{"SAMLConnectorV2.Spec.MFASettings.force_authn", err}) + } + v, ok = i.(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + diags.Append(attrWriteConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.force_authn", "github.com/hashicorp/terraform-plugin-framework/types.Int64"}) + } + v.Null = int64(obj.ForceAuthn) == 0 + } + v.Value = int64(obj.ForceAuthn) + v.Unknown = false + tf.Attrs["force_authn"] = v + } + } + { + t, ok := tf.AttrTypes["issuer"] + if !ok { + diags.Append(attrWriteMissingDiag{"SAMLConnectorV2.Spec.MFASettings.issuer"}) + } else { + v, ok := tf.Attrs["issuer"].(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + i, err := t.ValueFromTerraform(ctx, github_com_hashicorp_terraform_plugin_go_tftypes.NewValue(t.TerraformType(ctx), nil)) + if err != nil { + diags.Append(attrWriteGeneralError{"SAMLConnectorV2.Spec.MFASettings.issuer", err}) + } + v, ok = i.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrWriteConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.issuer", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } + v.Null = string(obj.Issuer) == "" + } + v.Value = string(obj.Issuer) + v.Unknown = false + tf.Attrs["issuer"] = v + } + } + { + t, ok := tf.AttrTypes["sso"] + if !ok { + diags.Append(attrWriteMissingDiag{"SAMLConnectorV2.Spec.MFASettings.sso"}) + } else { + v, ok := tf.Attrs["sso"].(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + i, err := t.ValueFromTerraform(ctx, github_com_hashicorp_terraform_plugin_go_tftypes.NewValue(t.TerraformType(ctx), nil)) + if err != nil { + diags.Append(attrWriteGeneralError{"SAMLConnectorV2.Spec.MFASettings.sso", err}) + } + v, ok = i.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrWriteConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.sso", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } + v.Null = string(obj.Sso) == "" + } + v.Value = string(obj.Sso) + v.Unknown = false + tf.Attrs["sso"] = v + } + } + { + t, ok := tf.AttrTypes["cert"] + if !ok { + diags.Append(attrWriteMissingDiag{"SAMLConnectorV2.Spec.MFASettings.cert"}) + } else { + v, ok := tf.Attrs["cert"].(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + i, err := t.ValueFromTerraform(ctx, github_com_hashicorp_terraform_plugin_go_tftypes.NewValue(t.TerraformType(ctx), nil)) + if err != nil { + diags.Append(attrWriteGeneralError{"SAMLConnectorV2.Spec.MFASettings.cert", err}) + } + v, ok = i.(github_com_hashicorp_terraform_plugin_framework_types.String) + if !ok { + diags.Append(attrWriteConversionFailureDiag{"SAMLConnectorV2.Spec.MFASettings.cert", "github.com/hashicorp/terraform-plugin-framework/types.String"}) + } + v.Null = string(obj.Cert) == "" + } + v.Value = string(obj.Cert) + v.Unknown = false + tf.Attrs["cert"] = v + } + } } v.Unknown = false tf.Attrs["mfa"] = v } } } + { + t, ok := tf.AttrTypes["force_authn"] + if !ok { + diags.Append(attrWriteMissingDiag{"SAMLConnectorV2.Spec.ForceAuthn"}) + } else { + v, ok := tf.Attrs["force_authn"].(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + i, err := t.ValueFromTerraform(ctx, github_com_hashicorp_terraform_plugin_go_tftypes.NewValue(t.TerraformType(ctx), nil)) + if err != nil { + diags.Append(attrWriteGeneralError{"SAMLConnectorV2.Spec.ForceAuthn", err}) + } + v, ok = i.(github_com_hashicorp_terraform_plugin_framework_types.Int64) + if !ok { + diags.Append(attrWriteConversionFailureDiag{"SAMLConnectorV2.Spec.ForceAuthn", "github.com/hashicorp/terraform-plugin-framework/types.Int64"}) + } + v.Null = int64(obj.ForceAuthn) == 0 + } + v.Value = int64(obj.ForceAuthn) + v.Unknown = false + tf.Attrs["force_authn"] = v + } + } } v.Unknown = false tf.Attrs["spec"] = v