Skip to content

Commit

Permalink
Sync OpenAPI; PkiConfigureAcmeRequest += AllowRoleExtKeyUsage (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxb authored Jul 21, 2023
1 parent 7052fc4 commit bd017b8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/PkiConfigureAcmeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AllowRoleExtKeyUsage** | **bool** | whether the ExtKeyUsage field from a role is used, defaults to false meaning that certificate will be signed with ServerAuth. | [optional] [default to false]
**AllowedIssuers** | **List<string>** | which issuers are allowed for use with ACME; by default, this will only be the primary (default) issuer | [optional]
**AllowedRoles** | **List<string>** | which roles are allowed for use with ACME; by default via '*', these will be all roles including sign-verbatim; when concrete role names are specified, any default_directory_policy role must be included to allow usage of the default acme directories under /pki/acme/directory and /pki/issuer/:issuer_id/acme/directory. | [optional]
**DefaultDirectoryPolicy** | **string** | the policy to be used for non-role-qualified ACME requests; by default ACME issuance will be otherwise unrestricted, equivalent to the sign-verbatim endpoint; one may also specify a role to use as this policy, as \"role:<role_name>\", the specified role must be allowed by allowed_roles | [optional] [default to "sign-verbatim"]
Expand Down
9 changes: 8 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@
},
"/auth/token/revoke-orphan": {
"description": "This endpoint will delete the token and orphan its child tokens.",
"x-vault-sudo": true,
"post": {
"summary": "This endpoint will delete the token and orphan its child tokens.",
"operationId": "token-revoke-orphan",
Expand Down Expand Up @@ -14970,6 +14971,7 @@
},
"/sys/seal": {
"description": "Seals the Vault.",
"x-vault-sudo": true,
"post": {
"summary": "Seal the Vault.",
"operationId": "seal",
Expand Down Expand Up @@ -15031,6 +15033,7 @@
}
},
"/sys/step-down": {
"x-vault-sudo": true,
"post": {
"summary": "Cause the node to give up active status.",
"description": "This endpoint forces the node to give up active status. If the node does not have active status, this endpoint does nothing. Note that the node will sleep for ten seconds before attempting to grab the active lock again, but if no standby nodes grab the active lock in the interim, the same node may become the active node again.",
Expand Down Expand Up @@ -28299,7 +28302,6 @@
"required": true
}
],
"x-vault-createSupported": true,
"get": {
"summary": "Returns the size of the active cache",
"operationId": "transit-read-cache-configuration",
Expand Down Expand Up @@ -38437,6 +38439,11 @@
"PkiConfigureAcmeRequest": {
"type": "object",
"properties": {
"allow_role_ext_key_usage": {
"type": "boolean",
"description": "whether the ExtKeyUsage field from a role is used, defaults to false meaning that certificate will be signed with ServerAuth.",
"default": false
},
"allowed_issuers": {
"type": "array",
"description": "which issuers are allowed for use with ACME; by default, this will only be the primary (default) issuer",
Expand Down
9 changes: 9 additions & 0 deletions src/Vault.Test/Model/PkiConfigureAcmeRequestTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ public void PkiConfigureAcmeRequestInstanceTest()



/// <summary>
/// Test the property 'AllowRoleExtKeyUsage'
/// </summary>
[Fact]
public void AllowRoleExtKeyUsageTest()
{
// TODO unit test for the property 'AllowRoleExtKeyUsage'
}

/// <summary>
/// Test the property 'AllowedIssuers'
/// </summary>
Expand Down
23 changes: 22 additions & 1 deletion src/Vault/Model/PkiConfigureAcmeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public partial class PkiConfigureAcmeRequest : IEquatable<PkiConfigureAcmeReques
/// Initializes a new instance of the <see cref="PkiConfigureAcmeRequest" /> class.
/// </summary>

/// <param name="AllowRoleExtKeyUsage">whether the ExtKeyUsage field from a role is used, defaults to false meaning that certificate will be signed with ServerAuth. (default to false).</param>

/// <param name="AllowedIssuers">which issuers are allowed for use with ACME; by default, this will only be the primary (default) issuer.</param>

/// <param name="AllowedRoles">which roles are allowed for use with ACME; by default via &#x27;*&#x27;, these will be all roles including sign-verbatim; when concrete role names are specified, any default_directory_policy role must be included to allow usage of the default acme directories under /pki/acme/directory and /pki/issuer/:issuer_id/acme/directory..</param>
Expand All @@ -47,9 +49,11 @@ public partial class PkiConfigureAcmeRequest : IEquatable<PkiConfigureAcmeReques
/// <param name="Enabled">whether ACME is enabled, defaults to false meaning that clusters will by default not get ACME support (default to false).</param>


public PkiConfigureAcmeRequest(List<string> AllowedIssuers = default(List<string>), List<string> AllowedRoles = default(List<string>), string DefaultDirectoryPolicy = "sign-verbatim", string DnsResolver = "", string EabPolicy = "always-required", bool Enabled = false)
public PkiConfigureAcmeRequest(bool AllowRoleExtKeyUsage = false, List<string> AllowedIssuers = default(List<string>), List<string> AllowedRoles = default(List<string>), string DefaultDirectoryPolicy = "sign-verbatim", string DnsResolver = "", string EabPolicy = "always-required", bool Enabled = false)
{

this.AllowRoleExtKeyUsage = AllowRoleExtKeyUsage;

this.AllowedIssuers = AllowedIssuers;

this.AllowedRoles = AllowedRoles;
Expand All @@ -70,6 +74,15 @@ public partial class PkiConfigureAcmeRequest : IEquatable<PkiConfigureAcmeReques

}

/// <summary>
/// whether the ExtKeyUsage field from a role is used, defaults to false meaning that certificate will be signed with ServerAuth.
/// </summary>
/// <value>whether the ExtKeyUsage field from a role is used, defaults to false meaning that certificate will be signed with ServerAuth.</value>
[DataMember(Name = "allow_role_ext_key_usage", EmitDefaultValue = true)]

public bool AllowRoleExtKeyUsage { get; set; }


/// <summary>
/// which issuers are allowed for use with ACME; by default, this will only be the primary (default) issuer
/// </summary>
Expand Down Expand Up @@ -134,6 +147,7 @@ public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class PkiConfigureAcmeRequest {\n");
sb.Append(" AllowRoleExtKeyUsage: ").Append(AllowRoleExtKeyUsage).Append("\n");
sb.Append(" AllowedIssuers: ").Append(AllowedIssuers).Append("\n");
sb.Append(" AllowedRoles: ").Append(AllowedRoles).Append("\n");
sb.Append(" DefaultDirectoryPolicy: ").Append(DefaultDirectoryPolicy).Append("\n");
Expand Down Expand Up @@ -175,6 +189,11 @@ public bool Equals(PkiConfigureAcmeRequest input)
return false;
}
return
(
this.AllowRoleExtKeyUsage == input.AllowRoleExtKeyUsage ||

this.AllowRoleExtKeyUsage.Equals(input.AllowRoleExtKeyUsage)
) &&
(
this.AllowedIssuers == input.AllowedIssuers ||
this.AllowedIssuers != null &&
Expand Down Expand Up @@ -223,6 +242,8 @@ public override int GetHashCode()
{
int hashCode = 41;


hashCode = (hashCode * 59) + this.AllowRoleExtKeyUsage.GetHashCode();
if (this.AllowedIssuers != null)
{
hashCode = (hashCode * 59) + this.AllowedIssuers.GetHashCode();
Expand Down

0 comments on commit bd017b8

Please sign in to comment.