Skip to content

Commit a165fc6

Browse files
authored
Merge pull request #108 from IBM/shacharn-7485-inter-rotate
patch: support for intermediate CA certificates rotation
2 parents 4186662 + 30d9515 commit a165fc6

21 files changed

+683
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ The IBM Cloud Secrets Manager Java SDK allows developers to programmatically int
5050
```
5151

5252
## Authentication
53-
5453
Secrets Manager uses token-based Identity and Access Management (IAM) authentication.
5554

5655
With IAM authentication, you supply an API key that is used to generate an access token. Then, the access token is included in each API request to Secrets Manager. Access tokens are valid for a limited amount of time and must be regenerated.

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/SecretsManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
15-
* IBM OpenAPI SDK Code Generator Version: 3.95.0-d0e386be-20240906-183310
15+
* IBM OpenAPI SDK Code Generator Version: 3.95.2-120e65bc-20240924-152329
1616
*/
1717

1818
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2;
@@ -1185,6 +1185,8 @@ public ServiceCall<Void> deleteConfiguration(DeleteConfigurationOptions deleteCo
11851185
* authority certificate.
11861186
* - `private_cert_configuration_action_rotate_crl`: Rotate the certificate revocation list (CRL) of an intermediate
11871187
* certificate authority.
1188+
* - `private_cert_configuration_action_rotate_intermediate`: Rotate an internally signed intermediate certificate
1189+
* authority certificate.
11881190
*
11891191
* @param createConfigurationActionOptions the {@link CreateConfigurationActionOptions} containing the options for the call
11901192
* @return a {@link ServiceCall} with a result of type {@link ConfigurationAction}

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/ConfigurationAction.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*
2424
* Classes which extend this class:
2525
* - PrivateCertificateConfigurationActionRevoke
26+
* - PrivateCertificateConfigurationActionRotate
2627
* - PrivateCertificateConfigurationActionSignCSR
2728
* - PrivateCertificateConfigurationActionSignIntermediate
2829
* - PrivateCertificateConfigurationActionSetSigned
@@ -35,6 +36,7 @@ public class ConfigurationAction extends GenericModel {
3536
static {
3637
discriminatorMapping = new java.util.HashMap<>();
3738
discriminatorMapping.put("private_cert_configuration_action_revoke_ca_certificate", PrivateCertificateConfigurationActionRevoke.class);
39+
discriminatorMapping.put("private_cert_configuration_action_rotate_intermediate", PrivateCertificateConfigurationActionRotate.class);
3840
discriminatorMapping.put("private_cert_configuration_action_sign_csr", PrivateCertificateConfigurationActionSignCSR.class);
3941
discriminatorMapping.put("private_cert_configuration_action_sign_intermediate", PrivateCertificateConfigurationActionSignIntermediate.class);
4042
discriminatorMapping.put("private_cert_configuration_action_set_signed", PrivateCertificateConfigurationActionSetSigned.class);
@@ -54,6 +56,8 @@ public interface ActionType {
5456
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
5557
/** private_cert_configuration_action_revoke_ca_certificate. */
5658
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
59+
/** private_cert_configuration_action_rotate_intermediate. */
60+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
5761
}
5862

5963
/**
@@ -70,6 +74,8 @@ public interface Format {
7074
protected String actionType;
7175
@SerializedName("revocation_time_seconds")
7276
protected Long revocationTimeSeconds;
77+
protected String name;
78+
protected PrivateCertificateConfigurationRotateAction config;
7379
@SerializedName("common_name")
7480
protected String commonName;
7581
@SerializedName("alt_names")
@@ -132,6 +138,29 @@ public Long getRevocationTimeSeconds() {
132138
return revocationTimeSeconds;
133139
}
134140

141+
/**
142+
* Gets the name.
143+
*
144+
* The name of the intermediate certificate authority configuration.
145+
*
146+
* @return the name
147+
*/
148+
public String getName() {
149+
return name;
150+
}
151+
152+
/**
153+
* Gets the config.
154+
*
155+
* The response body of the action to rotate an intermediate certificate authority for the private certificate
156+
* configuration.
157+
*
158+
* @return the config
159+
*/
160+
public PrivateCertificateConfigurationRotateAction getConfig() {
161+
return config;
162+
}
163+
135164
/**
136165
* Gets the commonName.
137166
*

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/ConfigurationActionPrototype.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Classes which extend this class:
2525
* - PrivateCertificateConfigurationActionRotateCRLPrototype
2626
* - PrivateCertificateConfigurationActionRevokePrototype
27+
* - PrivateCertificateConfigurationActionRotatePrototype
2728
* - PrivateCertificateConfigurationActionSignCSRPrototype
2829
* - PrivateCertificateConfigurationActionSignIntermediatePrototype
2930
* - PrivateCertificateConfigurationActionSetSignedPrototype
@@ -36,6 +37,7 @@ public class ConfigurationActionPrototype extends GenericModel {
3637
discriminatorMapping = new java.util.HashMap<>();
3738
discriminatorMapping.put("private_cert_configuration_action_rotate_crl", PrivateCertificateConfigurationActionRotateCRLPrototype.class);
3839
discriminatorMapping.put("private_cert_configuration_action_revoke_ca_certificate", PrivateCertificateConfigurationActionRevokePrototype.class);
40+
discriminatorMapping.put("private_cert_configuration_action_rotate_intermediate", PrivateCertificateConfigurationActionRotatePrototype.class);
3941
discriminatorMapping.put("private_cert_configuration_action_sign_csr", PrivateCertificateConfigurationActionSignCSRPrototype.class);
4042
discriminatorMapping.put("private_cert_configuration_action_sign_intermediate", PrivateCertificateConfigurationActionSignIntermediatePrototype.class);
4143
discriminatorMapping.put("private_cert_configuration_action_set_signed", PrivateCertificateConfigurationActionSetSignedPrototype.class);
@@ -54,6 +56,8 @@ public interface ActionType {
5456
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
5557
/** private_cert_configuration_action_revoke_ca_certificate. */
5658
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
59+
/** private_cert_configuration_action_rotate_intermediate. */
60+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
5761
}
5862

5963
/**

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/PrivateCertificateConfigurationActionRevoke.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public interface ActionType {
3232
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
3333
/** private_cert_configuration_action_revoke_ca_certificate. */
3434
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
35+
/** private_cert_configuration_action_rotate_intermediate. */
36+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
3537
}
3638

3739

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/PrivateCertificateConfigurationActionRevokePrototype.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public interface ActionType {
3232
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
3333
/** private_cert_configuration_action_revoke_ca_certificate. */
3434
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
35+
/** private_cert_configuration_action_rotate_intermediate. */
36+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
3537
}
3638

3739

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2024.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model;
15+
16+
/**
17+
* The response body to specify the properties of the action to rotate the private certificate.
18+
*/
19+
public class PrivateCertificateConfigurationActionRotate extends ConfigurationAction {
20+
21+
/**
22+
* The type of configuration action.
23+
*/
24+
public interface ActionType {
25+
/** private_cert_configuration_action_rotate_crl. */
26+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_CRL = "private_cert_configuration_action_rotate_crl";
27+
/** private_cert_configuration_action_sign_intermediate. */
28+
String PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_INTERMEDIATE = "private_cert_configuration_action_sign_intermediate";
29+
/** private_cert_configuration_action_sign_csr. */
30+
String PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = "private_cert_configuration_action_sign_csr";
31+
/** private_cert_configuration_action_set_signed. */
32+
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
33+
/** private_cert_configuration_action_revoke_ca_certificate. */
34+
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
35+
/** private_cert_configuration_action_rotate_intermediate. */
36+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
37+
}
38+
39+
40+
protected PrivateCertificateConfigurationActionRotate() { }
41+
}
42+

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/PrivateCertificateConfigurationActionRotateCRL.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public interface ActionType {
3333
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
3434
/** private_cert_configuration_action_revoke_ca_certificate. */
3535
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
36+
/** private_cert_configuration_action_rotate_intermediate. */
37+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
3638
}
3739

3840

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v2/model/PrivateCertificateConfigurationActionRotateCRLPrototype.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public interface ActionType {
3333
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
3434
/** private_cert_configuration_action_revoke_ca_certificate. */
3535
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
36+
/** private_cert_configuration_action_rotate_intermediate. */
37+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
3638
}
3739

3840

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2024.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*/
13+
14+
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v2.model;
15+
16+
/**
17+
* The request body to specify the properties of the action to rotate the private certificate configuration.
18+
*/
19+
public class PrivateCertificateConfigurationActionRotatePrototype extends ConfigurationActionPrototype {
20+
21+
/**
22+
* The type of configuration action.
23+
*/
24+
public interface ActionType {
25+
/** private_cert_configuration_action_rotate_crl. */
26+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_CRL = "private_cert_configuration_action_rotate_crl";
27+
/** private_cert_configuration_action_sign_intermediate. */
28+
String PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_INTERMEDIATE = "private_cert_configuration_action_sign_intermediate";
29+
/** private_cert_configuration_action_sign_csr. */
30+
String PRIVATE_CERT_CONFIGURATION_ACTION_SIGN_CSR = "private_cert_configuration_action_sign_csr";
31+
/** private_cert_configuration_action_set_signed. */
32+
String PRIVATE_CERT_CONFIGURATION_ACTION_SET_SIGNED = "private_cert_configuration_action_set_signed";
33+
/** private_cert_configuration_action_revoke_ca_certificate. */
34+
String PRIVATE_CERT_CONFIGURATION_ACTION_REVOKE_CA_CERTIFICATE = "private_cert_configuration_action_revoke_ca_certificate";
35+
/** private_cert_configuration_action_rotate_intermediate. */
36+
String PRIVATE_CERT_CONFIGURATION_ACTION_ROTATE_INTERMEDIATE = "private_cert_configuration_action_rotate_intermediate";
37+
}
38+
39+
40+
/**
41+
* Builder.
42+
*/
43+
public static class Builder {
44+
private String actionType;
45+
46+
/**
47+
* Instantiates a new Builder from an existing PrivateCertificateConfigurationActionRotatePrototype instance.
48+
*
49+
* @param privateCertificateConfigurationActionRotatePrototype the instance to initialize the Builder with
50+
*/
51+
public Builder(ConfigurationActionPrototype privateCertificateConfigurationActionRotatePrototype) {
52+
this.actionType = privateCertificateConfigurationActionRotatePrototype.actionType;
53+
}
54+
55+
/**
56+
* Instantiates a new builder.
57+
*/
58+
public Builder() {
59+
}
60+
61+
/**
62+
* Instantiates a new builder with required properties.
63+
*
64+
* @param actionType the actionType
65+
*/
66+
public Builder(String actionType) {
67+
this.actionType = actionType;
68+
}
69+
70+
/**
71+
* Builds a PrivateCertificateConfigurationActionRotatePrototype.
72+
*
73+
* @return the new PrivateCertificateConfigurationActionRotatePrototype instance
74+
*/
75+
public PrivateCertificateConfigurationActionRotatePrototype build() {
76+
return new PrivateCertificateConfigurationActionRotatePrototype(this);
77+
}
78+
79+
/**
80+
* Set the actionType.
81+
*
82+
* @param actionType the actionType
83+
* @return the PrivateCertificateConfigurationActionRotatePrototype builder
84+
*/
85+
public Builder actionType(String actionType) {
86+
this.actionType = actionType;
87+
return this;
88+
}
89+
}
90+
91+
protected PrivateCertificateConfigurationActionRotatePrototype() { }
92+
93+
protected PrivateCertificateConfigurationActionRotatePrototype(Builder builder) {
94+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.actionType,
95+
"actionType cannot be null");
96+
actionType = builder.actionType;
97+
}
98+
99+
/**
100+
* New builder.
101+
*
102+
* @return a PrivateCertificateConfigurationActionRotatePrototype builder
103+
*/
104+
public Builder newBuilder() {
105+
return new Builder(this);
106+
}
107+
}
108+

0 commit comments

Comments
 (0)