Skip to content

Commit

Permalink
Add idp_entity_id, public_key and sso_endpoint attributes to cloudfla…
Browse files Browse the repository at this point in the history
…re_access-application.saas_app
  • Loading branch information
F21 committed Oct 11, 2023
1 parent bf62e71 commit 526fb7c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/resources/access_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ Optional:
- `custom_attribute` (Block List) Custom attribute mapped from IDPs. (see [below for nested schema](#nestedblock--saas_app--custom_attribute))
- `name_id_format` (String) The format of the name identifier sent to the SaaS application. Defaults to `email`.

Read-Only:

- `idp_entity_id` (String) The unique identifier for the SaaS application.
- `public_key` (String) The public certificate that will be used to verify identities.
- `sso_endpoint` (String) The endpoint where the SaaS application will send login requests.

<a id="nestedblock--saas_app--custom_attribute"></a>
### Nested Schema for `saas_app.custom_attribute`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func TestAccCloudflareAccessApplication_WithSaas(t *testing.T) {
resource.TestCheckResourceAttr(name, "saas_app.0.sp_entity_id", "saas-app.example"),
resource.TestCheckResourceAttr(name, "saas_app.0.consumer_service_url", "https://saas-app.example/sso/saml/consume"),
resource.TestCheckResourceAttr(name, "saas_app.0.name_id_format", "email"),
resource.TestCheckResourceAttrSet(name, "saas_app.0.idp_entity_id"),
resource.TestCheckResourceAttrSet(name, "saas_app.0.public_key"),
resource.TestCheckResourceAttrSet(name, "saas_app.0.sso_endpoint"),

resource.TestCheckResourceAttr(name, "saas_app.0.custom_attribute.#", "2"),
resource.TestCheckResourceAttr(name, "saas_app.0.custom_attribute.0.name", "email"),
Expand Down
18 changes: 18 additions & 0 deletions internal/sdkv2provider/schema_cloudflare_access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,21 @@ func resourceCloudflareAccessApplicationSchema() map[string]*schema.Schema {
},
},
},
"idp_entity_id": {
Type: schema.TypeString,
Computed: true,
Description: "The unique identifier for the SaaS application.",
},
"public_key": {
Type: schema.TypeString,
Computed: true,
Description: "The public certificate that will be used to verify identities.",
},
"sso_endpoint": {
Type: schema.TypeString,
Computed: true,
Description: "The endpoint where the SaaS application will send login requests.",
},
},
},
},
Expand Down Expand Up @@ -430,6 +445,9 @@ func convertSaasStructToSchema(d *schema.ResourceData, app *cloudflare.SaasAppli
"sp_entity_id": app.SPEntityID,
"consumer_service_url": app.ConsumerServiceUrl,
"name_id_format": app.NameIDFormat,
"idp_entity_id": app.IDPEntityID,
"public_key": app.PublicKey,
"sso_endpoint": app.SSOEndpoint,
}

var customAttributes []interface{}
Expand Down

0 comments on commit 526fb7c

Please sign in to comment.