Skip to content

Commit

Permalink
AUTH-5974 added saml_attribute_transform_jsonata for saas apps
Browse files Browse the repository at this point in the history
  • Loading branch information
rkernscloudflaretest committed Mar 14, 2024
1 parent 6a9e07e commit 9be5900
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .changelog/1562.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
access_application: add support for `saml_attribute_transform_jsonata` in saas apps
```
17 changes: 9 additions & 8 deletions access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,15 @@ type SaasApplication struct {
AuthType string `json:"auth_type,omitempty"`

// SAML saas app
ConsumerServiceUrl string `json:"consumer_service_url,omitempty"`
SPEntityID string `json:"sp_entity_id,omitempty"`
IDPEntityID string `json:"idp_entity_id,omitempty"`
NameIDFormat string `json:"name_id_format,omitempty"`
SSOEndpoint string `json:"sso_endpoint,omitempty"`
DefaultRelayState string `json:"default_relay_state,omitempty"`
CustomAttributes []SAMLAttributeConfig `json:"custom_attributes,omitempty"`
NameIDTransformJsonata string `json:"name_id_transform_jsonata,omitempty"`
ConsumerServiceUrl string `json:"consumer_service_url,omitempty"`
SPEntityID string `json:"sp_entity_id,omitempty"`
IDPEntityID string `json:"idp_entity_id,omitempty"`
NameIDFormat string `json:"name_id_format,omitempty"`
SSOEndpoint string `json:"sso_endpoint,omitempty"`
DefaultRelayState string `json:"default_relay_state,omitempty"`
CustomAttributes []SAMLAttributeConfig `json:"custom_attributes,omitempty"`
NameIDTransformJsonata string `json:"name_id_transform_jsonata,omitempty"`
SamlAttributeTransformJsonata string `json:"saml_attribute_transform_jsonata"`

// OIDC saas app
ClientID string `json:"client_id,omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions access_application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ func TestCreateSAMLSaasAccessApplications(t *testing.T) {
}
}
],
"name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')"
"name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')",
"saml_attribute_transform_jsonata": "$ ~>| groups | {'group_name': name} |"
}
}
}
Expand Down Expand Up @@ -732,7 +733,8 @@ func TestCreateSAMLSaasAccessApplications(t *testing.T) {
},
},
},
NameIDTransformJsonata: "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')",
NameIDTransformJsonata: "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')",
SamlAttributeTransformJsonata: "$ ~>| groups | {'group_name': name} |",
},
CreatedAt: &createdAt,
UpdatedAt: &updatedAt,
Expand Down

0 comments on commit 9be5900

Please sign in to comment.