Skip to content

Commit

Permalink
Adds 'is_signup_enabled' for OrganisationConnection (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
kailash-b authored Sep 5, 2024
2 parents 410cfa4 + f04d45e commit 005f580
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Auth0.ManagementApi/Models/OrganizationConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public class OrganizationConnection
/// </summary>
[JsonProperty("show_as_button")]
public bool ShowAsButton { get; set; }

/// <summary>
/// Determines whether organization signup should be enabled for this organization connection.
/// </summary>
[JsonProperty("is_signup_enabled")]
public bool IsSignUpEnabled { get; set; }

/// <summary>
/// Information on the enabled connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ public class OrganizationConnectionCreateRequest
/// </summary>
[JsonProperty("show_as_button")]
public bool? ShowAsButton { get; set; }

/// <summary>
/// Determines whether organization signup should be enabled for this organization connection.
/// </summary>
[JsonProperty("is_signup_enabled")]
public bool? IsSignUpEnabled { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@ public class OrganizationConnectionUpdateRequest
/// </summary>
[JsonProperty("show_as_button")]
public bool? ShowAsButton { get; set; }

/// <summary>
/// Determines whether organization signup should be enabled for this organization connection.
/// </summary>
[JsonProperty("is_signup_enabled")]
public bool? IsSignUpEnabled { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,31 @@ public async Task Test_organization_connections_crud_sequence()
var createConnectionResponse = await fixture.ApiClient.Organizations.CreateConnectionAsync(ExistingOrganizationId, new OrganizationConnectionCreateRequest
{
ConnectionId = ExistingConnectionId,
AssignMembershipOnLogin = true
AssignMembershipOnLogin = true,
IsSignUpEnabled = true
});

createConnectionResponse.Should().NotBeNull();
createConnectionResponse.AssignMembershipOnLogin.Should().Be(true);
createConnectionResponse.IsSignUpEnabled.Should().Be(true);

try
{
var updateConnectionResponse = await fixture.ApiClient.Organizations.UpdateConnectionAsync(ExistingOrganizationId, ExistingConnectionId, new OrganizationConnectionUpdateRequest
{
AssignMembershipOnLogin = false
AssignMembershipOnLogin = false,
IsSignUpEnabled = false
});

updateConnectionResponse.Should().NotBeNull();
updateConnectionResponse.AssignMembershipOnLogin.Should().Be(false);
updateConnectionResponse.IsSignUpEnabled.Should().Be(false);

var connection = await fixture.ApiClient.Organizations.GetConnectionAsync(ExistingOrganizationId, ExistingConnectionId);

connection.Should().NotBeNull();
connection.AssignMembershipOnLogin.Should().Be(false);
connection.IsSignUpEnabled.Should().Be(false);

var connections = await fixture.ApiClient.Organizations.GetAllConnectionsAsync(ExistingOrganizationId, new Paging.PaginationInfo());
connections.Count.Should().Be(initialConnections.Count + 1);
Expand Down

0 comments on commit 005f580

Please sign in to comment.