-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK-2438] Add support for Organizations in Management API #489
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
25116aa
Organization CRUD
frederikprijck bb99025
Add extra organization endpoints
frederikprijck 3f38d4c
Add tests
frederikprijck 8b8bc30
Add organization to clients
frederikprijck 0f40092
Add organization to Jobs
frederikprijck 26faeff
Add organization to tickets
frederikprijck 3bdb023
Add GetOrganizationByName
frederikprijck 3216d1d
Update Organization Tests
frederikprijck 89c7e23
Change logo_uri to logo_url
frederikprijck 4f3c042
Ensure organization_require_behavior is sent as string
frederikprijck 714c810
Update client tests to include organizations
frederikprijck bd0c794
Update Jobs tests to include organization
frederikprijck be0c52b
Update tickets tests to include organization
frederikprijck 9570810
Update users tests to include organization
frederikprijck 72a6bd6
Add cleanup controller
frederikprijck a5e9169
Refactors
frederikprijck 4752142
More refactors
frederikprijck 2a717a9
Make metadata dynamic
frederikprijck f9b79ff
Refactors
frederikprijck cf7ed72
Remove controllers
frederikprijck 285ce9b
Merge branch 'master' into freder/sdk-2438
frederikprijck 43c1c36
Fix tests
frederikprijck 34707d7
Add extra documentation
frederikprijck e0fe2be
Update tests
frederikprijck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class Organization : OrganizationBase | ||
{ | ||
[JsonProperty("id")] | ||
public string Id { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Auth0.ManagementApi/Models/OrganizationAddMemberRolesRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationAddMemberRolesRequest | ||
{ | ||
/// <summary> | ||
/// List of role IDs to associated with the user. | ||
/// </summary> | ||
[JsonProperty("roles")] | ||
public IList<string> Roles { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Auth0.ManagementApi/Models/OrganizationAddMembersRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationAddMembersRequest | ||
{ | ||
/// <summary> | ||
/// List of user IDs to add to the organization as members. | ||
/// </summary> | ||
[JsonProperty("members")] | ||
public IList<string> Members { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationBase | ||
{ | ||
/// <summary> | ||
/// The name of the organization | ||
/// </summary> | ||
[JsonProperty("name")] | ||
public string Name { get; set; } | ||
/// <summary> | ||
/// The display name of the organization | ||
/// </summary> | ||
[JsonProperty("display_name")] | ||
public string DisplayName { get; set; } | ||
/// <summary> | ||
/// Organization specific branding settings | ||
/// </summary> | ||
[JsonProperty("branding")] | ||
public OrganizationBranding Branding { get; set; } | ||
/// <summary> | ||
/// Organization specific metadata | ||
/// </summary> | ||
[JsonProperty("metadata")] | ||
public dynamic Metadata { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationBranding | ||
{ | ||
/// <summary> | ||
/// URL for the logo. Must use HTTPS. | ||
/// </summary> | ||
[JsonProperty("logo_url")] | ||
public string LogoUrl { get; set; } | ||
|
||
/// <summary> | ||
/// Custom color settings. | ||
/// </summary> | ||
[JsonProperty("colors")] | ||
public BrandingColors Colors { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationConnection | ||
{ | ||
/// <summary> | ||
/// ID of the connection. | ||
/// </summary> | ||
[JsonProperty("connection_id")] | ||
public string ConnectionId { get; set; } | ||
|
||
/// <summary> | ||
/// Whether or not users that login will automatically be granted membership to the organization. | ||
/// </summary> | ||
[JsonProperty("assign_membership_on_login")] | ||
public bool AssignMembershipOnLogin { get; set; } | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Auth0.ManagementApi/Models/OrganizationConnectionCreateRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationConnectionCreateRequest | ||
{ | ||
/// <summary> | ||
/// ID of the connection. | ||
/// </summary> | ||
[JsonProperty("connection_id")] | ||
public string ConnectionId { get; set; } | ||
|
||
/// <summary> | ||
/// Whether or not users that login will automatically be granted membership to the organization. | ||
/// </summary> | ||
[JsonProperty("assign_membership_on_login")] | ||
public bool AssignMembershipOnLogin { get; set; } | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Auth0.ManagementApi/Models/OrganizationConnectionUpdateRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationConnectionUpdateRequest | ||
{ | ||
/// <summary> | ||
/// Whether or not users that login will automatically be granted membership to the organization. | ||
/// </summary> | ||
[JsonProperty("assign_membership_on_login")] | ||
public bool AssignMembershipOnLogin { get; set; } | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
src/Auth0.ManagementApi/Models/OrganizationCreateInvitationRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
/// <summary> | ||
/// Requests structure for creating a new organization invitation. | ||
/// </summary> | ||
public class OrganizationCreateInvitationRequest | ||
{ | ||
/// <summary> | ||
/// Information about the person that is creating the invitation | ||
/// </summary> | ||
[JsonProperty("inviter")] | ||
public OrganizationInvitationInviter Inviter { get; set; } | ||
|
||
/// <summary> | ||
/// Information about the person being invited | ||
/// </summary> | ||
[JsonProperty("invitee")] | ||
public OrganizationInvitationInvitee Invitee { get; set; } | ||
|
||
/// <summary> | ||
/// The id of the connection to force invitee to authenticate with. | ||
/// </summary> | ||
[JsonProperty("connection_id")] | ||
public string ConnectionId { get; set; } | ||
|
||
/// <summary> | ||
/// Auth0 client ID. Used to resolve the application's login initiation endpoint. | ||
/// </summary> | ||
[JsonProperty("client_id")] | ||
public string ClientId { get; set; } | ||
|
||
/// <summary> | ||
/// Contains app meta data. The user has read/write access to this. | ||
/// </summary> | ||
[JsonProperty("app_metadata")] | ||
public dynamic AppMetadata { get; set; } | ||
|
||
/// <summary> | ||
/// Contains user meta data. The user has read/write access to this. | ||
/// </summary> | ||
[JsonProperty("user_metadata")] | ||
public dynamic UserMetadata { get; set; } | ||
|
||
/// <summary> | ||
/// Number of seconds for which the invitation is valid before expiration. | ||
/// </summary> | ||
/// <remarks> | ||
/// If unspecified or set to 0, this value defaults to 604800 seconds (7 days). Max value: 2592000 seconds (30 days). | ||
/// </remarks> | ||
[JsonProperty("ttl_sec")] | ||
public int TimeToLive { get; set; } | ||
|
||
/// <summary> | ||
/// Whether the user will receive an invitation email (true) or no email (false), true by default | ||
/// </summary> | ||
[JsonProperty("send_invitation_email")] | ||
public bool SendInvitationEmail { get; set; } | ||
|
||
/// <summary> | ||
/// List of role IDs to associated with the user. | ||
/// </summary> | ||
[JsonProperty("roles")] | ||
public IList<string> Roles { get; set; } | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Auth0.ManagementApi/Models/OrganizationCreateRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using Newtonsoft.Json.Linq; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
/// <summary> | ||
/// Requests structure for creating a new organization. | ||
/// </summary> | ||
public class OrganizationCreateRequest : OrganizationBase | ||
{ | ||
|
||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Auth0.ManagementApi/Models/OrganizationDeleteMemberRolesRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationDeleteMemberRolesRequest | ||
{ | ||
/// <summary> | ||
/// List of role IDs to remove from the user. | ||
/// </summary> | ||
[JsonProperty("roles")] | ||
public IList<string> Roles { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Auth0.ManagementApi/Models/OrganizationDeleteMembersRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Newtonsoft.Json; | ||
using System.Collections.Generic; | ||
|
||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationDeleteMembersRequest | ||
{ | ||
/// <summary> | ||
/// List of user IDs to remove from the organization as members. | ||
/// </summary> | ||
[JsonProperty("members")] | ||
public IList<string> Members { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Auth0.ManagementApi/Models/OrganizationGetAllRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Auth0.ManagementApi.Models | ||
{ | ||
public class OrganizationGetAllRequest : OrganizationGetRequest | ||
{ | ||
/// <summary> | ||
/// Field to sort by. | ||
/// </summary> | ||
/// <remarks> | ||
/// Use field:order where order is 1 for ascending and -1 for descending Defaults to created_at:-1. | ||
/// </remarks> | ||
public string Sort { get; set; } = null; | ||
|
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed our Playground app to not use Nuget but use our source project directly