Skip to content

Commit 6356a1d

Browse files
authored
Merge pull request #27 from IBM/public_cert
update version
2 parents 76b66bf + fc4b5c2 commit 6356a1d

24 files changed

+416
-240
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ Service name | Imported class name
4444
<dependency>
4545
<groupId>com.ibm.cloud</groupId>
4646
<artifactId>secrets-manager</artifactId>
47-
<version>1.0.1</version>
47+
<version>1.0.2</version>
4848
</dependency>
4949
```
5050

5151
##### Gradle
5252

5353
```gradle
54-
'com.ibm.cloud:secrets-manager:1.0.1'
54+
'com.ibm.cloud:secrets-manager:1.0.2'
5555
```
5656

5757
## Authentication

modules/common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>secrets-manager-sdk</artifactId>
88
<groupId>com.ibm.cloud</groupId>
9-
<version>1.0.1</version>
9+
<version>1.0.2</version>
1010
<relativePath>../..</relativePath>
1111
</parent>
1212

modules/coverage-reports/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<artifactId>secrets-manager-sdk</artifactId>
55
<groupId>com.ibm.cloud</groupId>
6-
<version>1.0.1</version>
6+
<version>1.0.2</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/secrets-manager/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>secrets-manager-sdk</artifactId>
77
<groupId>com.ibm.cloud</groupId>
8-
<version>1.0.1</version>
8+
<version>1.0.2</version>
99
<relativePath>../..</relativePath>
1010
</parent>
1111

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

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
/*
15-
* IBM OpenAPI SDK Code Generator Version: 3.38.1-1037b405-20210908-184149
15+
* IBM OpenAPI SDK Code Generator Version: 3.40.0-910cf8c2-20211006-154754
1616
*/
1717

1818
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1;
@@ -668,8 +668,7 @@ public ServiceCall<Void> putConfig(PutConfigOptions putConfigOptions) {
668668
for (Entry<String, String> header : sdkHeaders.entrySet()) {
669669
builder.header(header.getKey(), header.getValue());
670670
}
671-
final JsonObject contentJson = new JsonObject();
672-
builder.bodyJson(contentJson);
671+
builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(putConfigOptions.engineConfig()), "application/json");
673672
ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid();
674673
return createServiceCall(builder.build(), responseConverter);
675674
}
@@ -759,6 +758,33 @@ public ServiceCall<GetConfigElements> getConfigElements(GetConfigElementsOptions
759758
return createServiceCall(builder.build(), responseConverter);
760759
}
761760

761+
/**
762+
* Get a configuration.
763+
* <p>
764+
* Retrieves the details of a specific configuration that is associated with a secret type.
765+
*
766+
* @param getConfigElementOptions the {@link GetConfigElementOptions} containing the options for the call
767+
* @return a {@link ServiceCall} with a result of type {@link GetSingleConfigElement}
768+
*/
769+
public ServiceCall<GetSingleConfigElement> getConfigElement(GetConfigElementOptions getConfigElementOptions) {
770+
com.ibm.cloud.sdk.core.util.Validator.notNull(getConfigElementOptions,
771+
"getConfigElementOptions cannot be null");
772+
Map<String, String> pathParamsMap = new HashMap<String, String>();
773+
pathParamsMap.put("secret_type", getConfigElementOptions.secretType());
774+
pathParamsMap.put("config_element", getConfigElementOptions.configElement());
775+
pathParamsMap.put("config_name", getConfigElementOptions.configName());
776+
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/config/{secret_type}/{config_element}/{config_name}", pathParamsMap));
777+
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "getConfigElement");
778+
for (Entry<String, String> header : sdkHeaders.entrySet()) {
779+
builder.header(header.getKey(), header.getValue());
780+
}
781+
builder.header("Accept", "application/json");
782+
ResponseConverter<GetSingleConfigElement> responseConverter =
783+
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<GetSingleConfigElement>() {
784+
}.getType());
785+
return createServiceCall(builder.build(), responseConverter);
786+
}
787+
762788
/**
763789
* Update a configuration.
764790
* <p>
@@ -791,9 +817,9 @@ public ServiceCall<GetSingleConfigElement> updateConfigElement(UpdateConfigEleme
791817
}
792818

793819
/**
794-
* Remove a configuration.
820+
* Delete a configuration.
795821
* <p>
796-
* Removes a configuration element from the specified secret type.
822+
* Deletes a configuration element from the specified secret type.
797823
*
798824
* @param deleteConfigElementOptions the {@link DeleteConfigElementOptions} containing the options for the call
799825
* @return a {@link ServiceCall} with a void result
@@ -814,31 +840,4 @@ public ServiceCall<Void> deleteConfigElement(DeleteConfigElementOptions deleteCo
814840
return createServiceCall(builder.build(), responseConverter);
815841
}
816842

817-
/**
818-
* Get a configuration.
819-
* <p>
820-
* Retrieves the details of a specific configuration that is associated with a secret type.
821-
*
822-
* @param getConfigElementOptions the {@link GetConfigElementOptions} containing the options for the call
823-
* @return a {@link ServiceCall} with a result of type {@link GetSingleConfigElement}
824-
*/
825-
public ServiceCall<GetSingleConfigElement> getConfigElement(GetConfigElementOptions getConfigElementOptions) {
826-
com.ibm.cloud.sdk.core.util.Validator.notNull(getConfigElementOptions,
827-
"getConfigElementOptions cannot be null");
828-
Map<String, String> pathParamsMap = new HashMap<String, String>();
829-
pathParamsMap.put("secret_type", getConfigElementOptions.secretType());
830-
pathParamsMap.put("config_element", getConfigElementOptions.configElement());
831-
pathParamsMap.put("config_name", getConfigElementOptions.configName());
832-
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/api/v1/config/{secret_type}/{config_element}/{config_name}", pathParamsMap));
833-
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("secrets_manager", "v1", "getConfigElement");
834-
for (Entry<String, String> header : sdkHeaders.entrySet()) {
835-
builder.header(header.getKey(), header.getValue());
836-
}
837-
builder.header("Accept", "application/json");
838-
ResponseConverter<GetSingleConfigElement> responseConverter =
839-
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<GetSingleConfigElement>() {
840-
}.getType());
841-
return createServiceCall(builder.build(), responseConverter);
842-
}
843-
844843
}

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/ConfigElementDefConfig.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ protected ConfigElementDefConfig() {
4242
/**
4343
* Gets the privateKey.
4444
* <p>
45-
* The private key that is associated with your ACME account.
45+
* The private key that is associated with your Automatic Certificate Management Environment (ACME) account.
46+
* <p>
47+
* If you have a working ACME client or account for Let's Encrypt, you can use the existing private key to enable
48+
* communications with Secrets Manager. If you don't have an account yet, you can create one. For more information,
49+
* see the
50+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#create-acme-account).
4651
*
4752
* @return the privateKey
4853
*/
@@ -85,6 +90,11 @@ public String cisApikey() {
8590
* Gets the classicInfrastructureUsername.
8691
* <p>
8792
* The username that is associated with your classic infrastructure account.
93+
* <p>
94+
* In most cases, your classic infrastructure username is your `&lt;account_id&gt;_&lt;email_address&gt;`. In the
95+
* console, you can find your username by going to **Manage &gt; Access (IAM) &gt; Users &gt; name &gt; VPN
96+
* password.** For more information, see the
97+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-classic-infrastructure).
8898
*
8999
* @return the classicInfrastructureUsername
90100
*/
@@ -96,6 +106,10 @@ public String classicInfrastructureUsername() {
96106
* Gets the classicInfrastructurePassword.
97107
* <p>
98108
* Your classic infrastructure API key.
109+
* <p>
110+
* In the console, you can view or create a classic infrastructure API key by going to **Manage &gt; Access (IAM)
111+
* &gt; Users &gt; name &gt; API keys.** For more information, see the
112+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-classic-infrastructure).
99113
*
100114
* @return the classicInfrastructurePassword
101115
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2021.
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+
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model;
14+
15+
/**
16+
* Configuration for the IAM credentials engine.
17+
*/
18+
public class CreateIAMCredentialsSecretEngineRootConfig extends EngineConfig {
19+
20+
21+
/**
22+
* Builder.
23+
*/
24+
public static class Builder {
25+
private String apiKey;
26+
27+
public Builder(EngineConfig createIamCredentialsSecretEngineRootConfig) {
28+
this.apiKey = createIamCredentialsSecretEngineRootConfig.apiKey;
29+
}
30+
31+
/**
32+
* Instantiates a new builder.
33+
*/
34+
public Builder() {
35+
}
36+
37+
/**
38+
* Instantiates a new builder with required properties.
39+
*
40+
* @param apiKey the apiKey
41+
*/
42+
public Builder(String apiKey) {
43+
this.apiKey = apiKey;
44+
}
45+
46+
/**
47+
* Builds a CreateIAMCredentialsSecretEngineRootConfig.
48+
*
49+
* @return the new CreateIAMCredentialsSecretEngineRootConfig instance
50+
*/
51+
public CreateIAMCredentialsSecretEngineRootConfig build() {
52+
return new CreateIAMCredentialsSecretEngineRootConfig(this);
53+
}
54+
55+
/**
56+
* Set the apiKey.
57+
*
58+
* @param apiKey the apiKey
59+
* @return the CreateIAMCredentialsSecretEngineRootConfig builder
60+
*/
61+
public Builder apiKey(String apiKey) {
62+
this.apiKey = apiKey;
63+
return this;
64+
}
65+
}
66+
67+
protected CreateIAMCredentialsSecretEngineRootConfig(Builder builder) {
68+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.apiKey,
69+
"apiKey cannot be null");
70+
apiKey = builder.apiKey;
71+
}
72+
73+
/**
74+
* New builder.
75+
*
76+
* @return a CreateIAMCredentialsSecretEngineRootConfig builder
77+
*/
78+
public Builder newBuilder() {
79+
return new Builder(this);
80+
}
81+
}
82+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* (C) Copyright IBM Corp. 2021.
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+
package com.ibm.cloud.secrets_manager_sdk.secrets_manager.v1.model;
14+
15+
import com.google.gson.annotations.SerializedName;
16+
import com.ibm.cloud.sdk.core.service.model.GenericModel;
17+
18+
/**
19+
* EngineConfig.
20+
* <p>
21+
* Classes which extend this class:
22+
* - CreateIAMCredentialsSecretEngineRootConfig
23+
*/
24+
public class EngineConfig extends GenericModel {
25+
26+
@SerializedName("api_key")
27+
protected String apiKey;
28+
@SerializedName("api_key_hash")
29+
protected String apiKeyHash;
30+
31+
protected EngineConfig() {
32+
}
33+
34+
/**
35+
* Gets the apiKey.
36+
* <p>
37+
* An IBM Cloud API key that has the capability to create and manage service IDs.
38+
* <p>
39+
* The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform role
40+
* on the IAM Identity Service. For more information, see the
41+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).
42+
*
43+
* @return the apiKey
44+
*/
45+
public String apiKey() {
46+
return apiKey;
47+
}
48+
49+
/**
50+
* Gets the apiKeyHash.
51+
* <p>
52+
* The hash value of the IBM Cloud API key that is used to create and manage service IDs.
53+
*
54+
* @return the apiKeyHash
55+
*/
56+
public String apiKeyHash() {
57+
return apiKeyHash;
58+
}
59+
}
60+

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/GetConfigResourcesItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public List<ConfigElementMetadata> getDnsProviders() {
6666
* An IBM Cloud API key that has the capability to create and manage service IDs.
6767
* <p>
6868
* The API key must be assigned the Editor platform role on the Access Groups Service and the Operator platform role
69-
* on the IAM Identity Service. For more information, see [Configuring the IAM secrets
70-
* engine](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-iam-credentials#configure-iam-secrets-engine-api).
69+
* on the IAM Identity Service. For more information, see the
70+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-configure-iam-engine).
7171
*
7272
* @return the apiKey
7373
*/

modules/secrets-manager/src/main/java/com/ibm/cloud/secrets_manager_sdk/secrets_manager/v1/model/GetSecretVersionMetadataOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
public class GetSecretVersionMetadataOptions extends GenericModel {
2121

2222
/**
23-
* The secret type. Supported options include: imported_cert.
23+
* The secret type.
2424
*/
2525
public interface SecretType {
2626
/**
@@ -137,7 +137,7 @@ public Builder newBuilder() {
137137
/**
138138
* Gets the secretType.
139139
* <p>
140-
* The secret type. Supported options include: imported_cert.
140+
* The secret type.
141141
*
142142
* @return the secretType
143143
*/

0 commit comments

Comments
 (0)