Skip to content

Commit 7e17157

Browse files
authored
Merge pull request #24 from IBM/public_cert
Public cert
2 parents 6aacd73 + c1dffb6 commit 7e17157

File tree

107 files changed

+6214
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6214
-593
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ jobs:
1919
SECRETS_MANAGER_API_AUTH_TYPE: iam
2020
SECRETS_MANAGER_API_APIKEY: ${{ secrets.SECRETS_MANAGER_API_APIKEY }}
2121
SERVICE_URL: https://9476d663-dc80-4132-aff6-4585ebbdfb2d.us-south.secrets-manager.appdomain.cloud
22+
DNS_CONFIG_CRN: "crn:v1:staging:public:internet-svcs-ci:global:a/791f5fb10986423e97aa8512f18b7e65:dc08a28a-9181-45db-bf0d-a8733a5796b6::"
23+
CA_CONFIG_PRIVATE_KEY: ${{ secrets.CA_CONFIG_PRIVATE_KEY }}
24+
DNS_CONFIG_API_KEY: ${{ secrets.DNS_CONFIG_API_KEY }}

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

Lines changed: 271 additions & 117 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public interface SecretType {
4141
* imported_cert.
4242
*/
4343
String IMPORTED_CERT = "imported_cert";
44+
/**
45+
* public_cert.
46+
*/
47+
String PUBLIC_CERT = "public_cert";
4448
}
4549

4650

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public interface SecretType {
4040
* imported_cert.
4141
*/
4242
String IMPORTED_CERT = "imported_cert";
43+
/**
44+
* public_cert.
45+
*/
46+
String PUBLIC_CERT = "public_cert";
4347
}
4448

4549

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public class CollectionMetadata extends GenericModel {
2424
* The type of resources in the resource array.
2525
*/
2626
public interface CollectionType {
27+
/**
28+
* application/vnd.ibm.secrets-manager.config+json.
29+
*/
30+
String APPLICATION_VND_IBM_SECRETS_MANAGER_CONFIG_JSON = "application/vnd.ibm.secrets-manager.config+json";
2731
/**
2832
* application/vnd.ibm.secrets-manager.secret+json.
2933
*/
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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.ibm.cloud.sdk.core.service.model.GenericModel;
16+
17+
/**
18+
* The configuration to add or update.
19+
*/
20+
public class ConfigElementDef extends GenericModel {
21+
22+
/**
23+
* The type of configuration. Value options differ depending on the `config_element` property that you want to define.
24+
*/
25+
public interface Type {
26+
/**
27+
* letsencrypt.
28+
*/
29+
String LETSENCRYPT = "letsencrypt";
30+
/**
31+
* letsencrypt-stage.
32+
*/
33+
String LETSENCRYPT_STAGE = "letsencrypt-stage";
34+
/**
35+
* cis.
36+
*/
37+
String CIS = "cis";
38+
/**
39+
* classic_infrastructure.
40+
*/
41+
String CLASSIC_INFRASTRUCTURE = "classic_infrastructure";
42+
}
43+
44+
protected String name;
45+
protected String type;
46+
protected ConfigElementDefConfig config;
47+
48+
/**
49+
* Builder.
50+
*/
51+
public static class Builder {
52+
private String name;
53+
private String type;
54+
private ConfigElementDefConfig config;
55+
56+
private Builder(ConfigElementDef configElementDef) {
57+
this.name = configElementDef.name;
58+
this.type = configElementDef.type;
59+
this.config = configElementDef.config;
60+
}
61+
62+
/**
63+
* Instantiates a new builder.
64+
*/
65+
public Builder() {
66+
}
67+
68+
/**
69+
* Instantiates a new builder with required properties.
70+
*
71+
* @param name the name
72+
* @param type the type
73+
* @param config the config
74+
*/
75+
public Builder(String name, String type, ConfigElementDefConfig config) {
76+
this.name = name;
77+
this.type = type;
78+
this.config = config;
79+
}
80+
81+
/**
82+
* Builds a ConfigElementDef.
83+
*
84+
* @return the new ConfigElementDef instance
85+
*/
86+
public ConfigElementDef build() {
87+
return new ConfigElementDef(this);
88+
}
89+
90+
/**
91+
* Set the name.
92+
*
93+
* @param name the name
94+
* @return the ConfigElementDef builder
95+
*/
96+
public Builder name(String name) {
97+
this.name = name;
98+
return this;
99+
}
100+
101+
/**
102+
* Set the type.
103+
*
104+
* @param type the type
105+
* @return the ConfigElementDef builder
106+
*/
107+
public Builder type(String type) {
108+
this.type = type;
109+
return this;
110+
}
111+
112+
/**
113+
* Set the config.
114+
*
115+
* @param config the config
116+
* @return the ConfigElementDef builder
117+
*/
118+
public Builder config(ConfigElementDefConfig config) {
119+
this.config = config;
120+
return this;
121+
}
122+
}
123+
124+
protected ConfigElementDef(Builder builder) {
125+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name,
126+
"name cannot be null");
127+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.type,
128+
"type cannot be null");
129+
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.config,
130+
"config cannot be null");
131+
name = builder.name;
132+
type = builder.type;
133+
config = builder.config;
134+
}
135+
136+
/**
137+
* New builder.
138+
*
139+
* @return a ConfigElementDef builder
140+
*/
141+
public Builder newBuilder() {
142+
return new Builder(this);
143+
}
144+
145+
/**
146+
* Gets the name.
147+
* <p>
148+
* The human-readable name to assign to your configuration.
149+
*
150+
* @return the name
151+
*/
152+
public String name() {
153+
return name;
154+
}
155+
156+
/**
157+
* Gets the type.
158+
* <p>
159+
* The type of configuration. Value options differ depending on the `config_element` property that you want to define.
160+
*
161+
* @return the type
162+
*/
163+
public String type() {
164+
return type;
165+
}
166+
167+
/**
168+
* Gets the config.
169+
* <p>
170+
* The configuration to define for the specified secret type.
171+
*
172+
* @return the config
173+
*/
174+
public ConfigElementDefConfig config() {
175+
return config;
176+
}
177+
}
178+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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+
* The configuration to define for the specified secret type.
20+
* <p>
21+
* Classes which extend this class:
22+
* - ConfigElementDefConfigLetsEncryptConfig
23+
* - ConfigElementDefConfigCloudInternetServicesConfig
24+
* - ConfigElementDefConfigClassicInfrastructureConfig
25+
*/
26+
public class ConfigElementDefConfig extends GenericModel {
27+
28+
@SerializedName("private_key")
29+
protected String privateKey;
30+
@SerializedName("cis_crn")
31+
protected String cisCrn;
32+
@SerializedName("cis_apikey")
33+
protected String cisApikey;
34+
@SerializedName("classic_infrastructure_username")
35+
protected String classicInfrastructureUsername;
36+
@SerializedName("classic_infrastructure_password")
37+
protected String classicInfrastructurePassword;
38+
39+
protected ConfigElementDefConfig() {
40+
}
41+
42+
/**
43+
* Gets the privateKey.
44+
* <p>
45+
* The private key that is associated with your ACME account.
46+
*
47+
* @return the privateKey
48+
*/
49+
public String privateKey() {
50+
return privateKey;
51+
}
52+
53+
/**
54+
* Gets the cisCrn.
55+
* <p>
56+
* The Cloud Resource Name (CRN) that is associated with the CIS instance.
57+
*
58+
* @return the cisCrn
59+
*/
60+
public String cisCrn() {
61+
return cisCrn;
62+
}
63+
64+
/**
65+
* Gets the cisApikey.
66+
* <p>
67+
* An IBM Cloud API key that has the capability to list domains in your CIS instance.
68+
* <p>
69+
* To grant Secrets Manager the ability to view the CIS instance and all of its domains, the API key must be assigned
70+
* the Reader service role on Internet Services (`internet-svcs`).
71+
* <p>
72+
* If you need to manage specific domains, you can assign the Manager role. For production environments, it is
73+
* recommended that you assign the Reader access role, and then use the
74+
* [IAM Policy Management API](https://cloud.ibm.com/apidocs/iam-policy-management#create-policy) to control specific
75+
* domains. For more information, see the
76+
* [docs](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-prepare-order-certificates#authorize-specific-domains).
77+
*
78+
* @return the cisApikey
79+
*/
80+
public String cisApikey() {
81+
return cisApikey;
82+
}
83+
84+
/**
85+
* Gets the classicInfrastructureUsername.
86+
* <p>
87+
* The username that is associated with your classic infrastructure account.
88+
*
89+
* @return the classicInfrastructureUsername
90+
*/
91+
public String classicInfrastructureUsername() {
92+
return classicInfrastructureUsername;
93+
}
94+
95+
/**
96+
* Gets the classicInfrastructurePassword.
97+
* <p>
98+
* Your classic infrastructure API key.
99+
*
100+
* @return the classicInfrastructurePassword
101+
*/
102+
public String classicInfrastructurePassword() {
103+
return classicInfrastructurePassword;
104+
}
105+
}
106+

0 commit comments

Comments
 (0)