-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for BYOK end-points (#743)
- Loading branch information
Showing
17 changed files
with
452 additions
and
4 deletions.
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
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,53 @@ | ||
using System; | ||
using System.Net.Security; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Represents and Encryption Key | ||
/// </summary> | ||
public class EncryptionKey | ||
{ | ||
/// <summary> | ||
/// Key ID | ||
/// </summary> | ||
[JsonProperty("kid")] | ||
public string Kid { get; set; } | ||
|
||
/// <inheritdoc cref="EncryptionKeyType"/> | ||
[JsonProperty("type")] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public EncryptionKeyType Type { get; set; } | ||
|
||
/// <inheritdoc cref="EncryptionKeyState"/> | ||
[JsonProperty("state")] | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public EncryptionKeyState State { get; set; } | ||
|
||
/// <summary> | ||
/// Key creation timestamp | ||
/// </summary> | ||
[JsonProperty("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
/// <summary> | ||
/// Key update timestamp | ||
/// </summary> | ||
[JsonProperty("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
|
||
/// <summary> | ||
/// ID of the parent wrapping key. | ||
/// </summary> | ||
[JsonProperty("parent_kid")] | ||
public string ParentKid { get; set; } | ||
|
||
/// <summary> | ||
/// Public key in PEM format | ||
/// </summary> | ||
[JsonProperty("public_key")] | ||
public string PublicKey { get; set; } | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Auth0.ManagementApi/Models/Keys/EncryptionKeyCreateRequest.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,17 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Contains information required for creating an encryption key. | ||
/// </summary> | ||
public class EncryptionKeyCreateRequest | ||
{ | ||
/// <summary> | ||
/// Type of the encryption key to be created. | ||
/// Possible values: [customer-provided-root-key, tenant-encryption-key] | ||
/// </summary> | ||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Auth0.ManagementApi/Models/Keys/EncryptionKeyGetRequest.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 @@ | ||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Contains information required for getting an encryption key. | ||
/// </summary> | ||
public class EncryptionKeyGetRequest | ||
{ | ||
/// <summary> | ||
/// Encryption key ID. | ||
/// </summary> | ||
public string Kid { get; set; } | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Auth0.ManagementApi/Models/Keys/EncryptionKeyImportRequest.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; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Contains information required for importing an encryption key. | ||
/// </summary> | ||
public class EncryptionKeyImportRequest | ||
{ | ||
/// <summary> | ||
/// Encryption key ID | ||
/// </summary> | ||
public string Kid { get; set; } | ||
|
||
/// <summary> | ||
/// Base64 encoded ciphertext of key material wrapped by public wrapping key. | ||
/// </summary> | ||
[JsonProperty("wrapped_key")] | ||
public string WrappedKey { 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,22 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Encryption Key State | ||
/// </summary> | ||
public enum EncryptionKeyState | ||
{ | ||
[EnumMember(Value = "pre-activation")] | ||
PreActivation, | ||
|
||
[EnumMember(Value = "active")] | ||
Active, | ||
|
||
[EnumMember(Value = "deactivated")] | ||
Deactivated, | ||
|
||
[EnumMember(Value = "destroyed")] | ||
Destroyed, | ||
} | ||
} |
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,22 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Encryption Key Type | ||
/// </summary> | ||
public enum EncryptionKeyType | ||
{ | ||
[EnumMember(Value = "customer-provided-root-key")] | ||
CustomerProvidedRootKey, | ||
|
||
[EnumMember(Value = "environment-root-key")] | ||
EnvironmentRootKey, | ||
|
||
[EnumMember(Value = "tenant-master-key")] | ||
TenantMasterKey, | ||
|
||
[EnumMember(Value = "tenant-encryption-key")] | ||
TenantEncryptionKey, | ||
} | ||
} |
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,22 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Represents the WrappingKey | ||
/// </summary> | ||
public class WrappingKey | ||
{ | ||
/// <summary> | ||
/// Public wrapping key in PEM format | ||
/// </summary> | ||
[JsonProperty("public_key")] | ||
public string PublicKey { get; set; } | ||
|
||
/// <summary> | ||
/// Encryption Algorithm that shall be used to wrap your key material | ||
/// </summary> | ||
[JsonProperty("algorithm")] | ||
public string Algorithm { get; set; } | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/Auth0.ManagementApi/Models/Keys/WrappingKeyCreateRequest.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 @@ | ||
namespace Auth0.ManagementApi.Models.Keys | ||
{ | ||
/// <summary> | ||
/// Contains information required for creating a wrapping key. | ||
/// </summary> | ||
public class WrappingKeyCreateRequest | ||
{ | ||
/// <summary> | ||
/// Encryption key ID | ||
/// </summary> | ||
public string Kid { 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
Oops, something went wrong.