Skip to content

Commit 5becebf

Browse files
authored
Merge pull request #146 from IBM/shacharn-7485-inter-rotate
patch: support for intermediate CA certificates rotation
2 parents fc12924 + 19b20a9 commit 5becebf

File tree

2 files changed

+152
-2
lines changed

2 files changed

+152
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ npm install @ibm-cloud/secrets-manager
4444
```
4545

4646
## Authentication
47-
4847
Secrets Manager uses token-based Identity and Access Management (IAM) authentication.
4948

5049
With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is

secrets-manager/v2.ts

Lines changed: 152 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* IBM OpenAPI SDK Code Generator Version: 3.95.0-d0e386be-20240906-183310
18+
* IBM OpenAPI SDK Code Generator Version: 3.95.2-120e65bc-20240924-152329
1919
*/
2020

2121
/* eslint-disable max-classes-per-file */
@@ -2062,6 +2062,8 @@ class SecretsManagerV2 extends BaseService {
20622062
* authority certificate.
20632063
* - `private_cert_configuration_action_rotate_crl`: Rotate the certificate revocation list (CRL) of an intermediate
20642064
* certificate authority.
2065+
* - `private_cert_configuration_action_rotate_intermediate`: Rotate an internally signed intermediate certificate
2066+
* authority certificate.
20652067
*
20662068
* @param {Object} params - The parameters to send to the service.
20672069
* @param {string} params.name - The name that uniquely identifies a configuration.
@@ -3197,6 +3199,97 @@ namespace SecretsManagerV2 {
31973199
export interface PrivateCertificateCAData {
31983200
}
31993201

3202+
/**
3203+
* The response body of the action to rotate an intermediate certificate authority for the private certificate
3204+
* configuration.
3205+
*/
3206+
export interface PrivateCertificateConfigurationRotateAction {
3207+
/** The Common Name (CN) represents the server name that is protected by the SSL certificate. */
3208+
common_name?: string;
3209+
/** With the Subject Alternative Name field, you can specify additional hostnames to be protected by a single
3210+
* SSL certificate.
3211+
*/
3212+
alt_names?: string[];
3213+
/** The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list. */
3214+
ip_sans?: string;
3215+
/** The URI Subject Alternative Names to define for the CA certificate, in a comma-delimited list. */
3216+
uri_sans?: string;
3217+
/** The custom Object Identifier (OID) or UTF8-string Subject Alternative Names to define for the CA
3218+
* certificate.
3219+
*
3220+
* The alternative names must match the values that are specified in the `allowed_other_sans` field in the
3221+
* associated certificate template. The format is the same as OpenSSL: `<oid>:<type>:<value>` where the current
3222+
* valid type is `UTF8`.
3223+
*/
3224+
other_sans?: string[];
3225+
/** he requested TTL, after which the certificate expires. */
3226+
ttl?: number;
3227+
/** The format of the returned data. */
3228+
format?: PrivateCertificateConfigurationRotateAction.Constants.Format | string;
3229+
/** The maximum path length to encode in the generated certificate. `-1` means no limit.
3230+
*
3231+
* If the signing certificate has a maximum path length set, the path length is set to one less than that of the
3232+
* signing certificate. A limit of `0` means a literal path length of zero.
3233+
*/
3234+
max_path_length?: number;
3235+
/** This parameter controls whether the common name is excluded from Subject Alternative Names (SANs).
3236+
*
3237+
* If the common name is set to `true`, it is not included in DNS, or email SANs if they apply. This field can be
3238+
* useful if the common name is a human-readable identifier, instead of a hostname or an email address.
3239+
*/
3240+
exclude_cn_from_sans?: boolean;
3241+
/** The allowed DNS domains or subdomains for the certificates that are to be signed and issued by this CA
3242+
* certificate.
3243+
*/
3244+
permitted_dns_domains?: string[];
3245+
/** This field indicates whether to use values from a certificate signing request (CSR) to complete a
3246+
* `private_cert_configuration_action_sign_csr` action. If it is set to `true`, then:
3247+
*
3248+
* 1) Subject information, including names and alternate names, are preserved from the CSR rather than by using the
3249+
* values that are provided in the other parameters to this operation.
3250+
*
3251+
* 2) Any key usage, for example, non-repudiation, that is requested in the CSR are added to the basic set of key
3252+
* usages used for CA certificates that are signed by the intermediate authority.
3253+
*
3254+
* 3) Extensions that are requested in the CSR are copied into the issued private certificate.
3255+
*/
3256+
use_csr_values?: boolean;
3257+
/** The Organizational Unit (OU) values to define in the subject field of the resulting certificate. */
3258+
ou?: string[];
3259+
/** The Organization (O) values to define in the subject field of the resulting certificate. */
3260+
organization?: string[];
3261+
/** The Country (C) values to define in the subject field of the resulting certificate. */
3262+
country?: string[];
3263+
/** The Locality (L) values to define in the subject field of the resulting certificate. */
3264+
locality?: string[];
3265+
/** The Province (ST) values to define in the subject field of the resulting certificate. */
3266+
province?: string[];
3267+
/** The street address values to define in the subject field of the resulting certificate. */
3268+
street_address?: string[];
3269+
/** The postal code values to define in the subject field of the resulting certificate. */
3270+
postal_code?: string[];
3271+
/** The requested value for the [`serialNumber`](https://datatracker.ietf.org/doc/html/rfc4519#section-2.31)
3272+
* attribute that is in the certificate's distinguished name (DN).
3273+
*
3274+
* **Note:** This field is not related to the `serial_number` field that is returned in the API response. The
3275+
* `serial_number` field represents the certificate's randomly assigned serial number.
3276+
*/
3277+
serial_number?: string;
3278+
/** The certificate signing request. */
3279+
csr?: string;
3280+
/** The data that is associated with the root certificate authority. */
3281+
data?: PrivateCertificateConfigurationCACertificate;
3282+
}
3283+
export namespace PrivateCertificateConfigurationRotateAction {
3284+
export namespace Constants {
3285+
/** The format of the returned data. */
3286+
export enum Format {
3287+
PEM = 'pem',
3288+
PEM_BUNDLE = 'pem_bundle',
3289+
}
3290+
}
3291+
}
3292+
32003293
/**
32013294
* The data that is associated with a cryptographic key.
32023295
*/
@@ -5893,6 +5986,7 @@ namespace SecretsManagerV2 {
58935986
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
58945987
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
58955988
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
5989+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
58965990
}
58975991
}
58985992
}
@@ -5913,6 +6007,34 @@ namespace SecretsManagerV2 {
59136007
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
59146008
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
59156009
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6010+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
6011+
}
6012+
}
6013+
}
6014+
6015+
/**
6016+
* The response body to specify the properties of the action to rotate the private certificate.
6017+
*/
6018+
export interface PrivateCertificateConfigurationActionRotate extends ConfigurationAction {
6019+
/** The type of configuration action. */
6020+
action_type: PrivateCertificateConfigurationActionRotate.Constants.ActionType | string;
6021+
/** The name of the intermediate certificate authority configuration. */
6022+
name: string;
6023+
/** The response body of the action to rotate an intermediate certificate authority for the private certificate
6024+
* configuration.
6025+
*/
6026+
config: PrivateCertificateConfigurationRotateAction;
6027+
}
6028+
export namespace PrivateCertificateConfigurationActionRotate {
6029+
export namespace Constants {
6030+
/** The type of configuration action. */
6031+
export enum ActionType {
6032+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_CRL = 'private_cert_configuration_action_rotate_crl',
6033+
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_INTERMEDIATE = 'private_cert_configuration_action_sign_intermediate',
6034+
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
6035+
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
6036+
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6037+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
59166038
}
59176039
}
59186040
}
@@ -5938,6 +6060,7 @@ namespace SecretsManagerV2 {
59386060
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
59396061
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
59406062
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6063+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
59416064
}
59426065
}
59436066
}
@@ -5959,6 +6082,28 @@ namespace SecretsManagerV2 {
59596082
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
59606083
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
59616084
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6085+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
6086+
}
6087+
}
6088+
}
6089+
6090+
/**
6091+
* The request body to specify the properties of the action to rotate the private certificate configuration.
6092+
*/
6093+
export interface PrivateCertificateConfigurationActionRotatePrototype extends ConfigurationActionPrototype {
6094+
/** The type of configuration action. */
6095+
action_type: PrivateCertificateConfigurationActionRotatePrototype.Constants.ActionType | string;
6096+
}
6097+
export namespace PrivateCertificateConfigurationActionRotatePrototype {
6098+
export namespace Constants {
6099+
/** The type of configuration action. */
6100+
export enum ActionType {
6101+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_CRL = 'private_cert_configuration_action_rotate_crl',
6102+
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_INTERMEDIATE = 'private_cert_configuration_action_sign_intermediate',
6103+
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
6104+
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
6105+
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6106+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
59626107
}
59636108
}
59646109
}
@@ -5982,6 +6127,7 @@ namespace SecretsManagerV2 {
59826127
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
59836128
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
59846129
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6130+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
59856131
}
59866132
}
59876133
}
@@ -6005,6 +6151,7 @@ namespace SecretsManagerV2 {
60056151
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
60066152
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
60076153
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6154+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
60086155
}
60096156
}
60106157
}
@@ -6109,6 +6256,7 @@ namespace SecretsManagerV2 {
61096256
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
61106257
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
61116258
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6259+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
61126260
}
61136261
}
61146262
}
@@ -6211,6 +6359,7 @@ namespace SecretsManagerV2 {
62116359
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
62126360
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
62136361
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6362+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
62146363
}
62156364
}
62166365
}
@@ -6314,6 +6463,7 @@ namespace SecretsManagerV2 {
63146463
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
63156464
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
63166465
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6466+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
63176467
}
63186468
}
63196469
}
@@ -6417,6 +6567,7 @@ namespace SecretsManagerV2 {
64176567
PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = 'private_cert_configuration_action_sign_csr',
64186568
PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = 'private_cert_configuration_action_set_signed',
64196569
PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = 'private_cert_configuration_action_revoke_ca_certificate',
6570+
PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = 'private_cert_configuration_action_rotate_intermediate',
64206571
}
64216572
}
64226573
}

0 commit comments

Comments
 (0)