Skip to content

Commit

Permalink
feat(saml_connection): add field
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasLopes7 committed Sep 26, 2024
1 parent 1f2556d commit 3c1ea66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions saml_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type SAMLConnection struct {
Name string `json:"name"`
Domain string `json:"domain"`
IdpEntityID *string `json:"idp_entity_id"`
OrganizationID *string `json:"organization_id"`
IdpSsoURL *string `json:"idp_sso_url"`
IdpCertificate *string `json:"idp_certificate"`
IdpMetadataURL *string `json:"idp_metadata_url"`
Expand Down
2 changes: 2 additions & 0 deletions samlconnection/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type AttributeMappingParams struct {
type CreateParams struct {
clerk.APIParams
Name *string `json:"name,omitempty"`
OrganizationID *string `json:"organization_id,omitempty"`
Domain *string `json:"domain,omitempty"`
Provider *string `json:"provider,omitempty"`
IdpEntityID *string `json:"idp_entity_id,omitempty"`
Expand Down Expand Up @@ -70,6 +71,7 @@ type UpdateParams struct {
Name *string `json:"name,omitempty"`
Domain *string `json:"domain,omitempty"`
IdpEntityID *string `json:"idp_entity_id,omitempty"`
OrganizationID *string `json:"organization_id,omitempty"`
IdpSsoURL *string `json:"idp_sso_url,omitempty"`
IdpCertificate *string `json:"idp_certificate,omitempty"`
IdpMetadataURL *string `json:"idp_metadata_url,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion samlconnection/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestSAMLConnectionClientUpdate(t *testing.T) {
config.HTTPClient = &http.Client{
Transport: &clerktest.RoundTripper{
T: t,
In: json.RawMessage(fmt.Sprintf(`{"name":"%s", "disable_additional_identifications": %t}`, name, disableAdditionalIdentifications)),
In: json.RawMessage(fmt.Sprintf(`{"name":"%s", "disable_additional_identifications": %t, "organization_id": ""}`, name, disableAdditionalIdentifications)),
Out: json.RawMessage(fmt.Sprintf(`{"id":"%s","name":"%s","domain":"%s","provider":"%s","disable_additional_identifications": %t}`, id, name, domain, provider, disableAdditionalIdentifications)),
Method: http.MethodPatch,
Path: "/v1/saml_connections/" + id,
Expand All @@ -113,6 +113,7 @@ func TestSAMLConnectionClientUpdate(t *testing.T) {
samlConnection, err := client.Update(context.Background(), id, &UpdateParams{
Name: clerk.String(name),
DisableAdditionalIdentifications: clerk.Bool(disableAdditionalIdentifications),
OrganizationID: clerk.String(""),
})
require.NoError(t, err)
require.Equal(t, id, samlConnection.ID)
Expand Down

0 comments on commit 3c1ea66

Please sign in to comment.