Skip to content

Commit

Permalink
Merge pull request #2838 from F21/access-app-saml-attributes
Browse files Browse the repository at this point in the history
Add idp_entity_id, public_key and sso_endpoint attributes to cloudflare_access_application.saas_app
  • Loading branch information
jacobbednarz authored Oct 16, 2023
2 parents 80af2ab + 45e9229 commit be30605
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/2838.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/cloudflare_access_application: Add idp_entity_id, public_key and sso_endpoint attributes to saas_app
```
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 be30605

Please sign in to comment.