Skip to content

Commit 73eaaba

Browse files
committed
enable private cert API
1 parent 2516b70 commit 73eaaba

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

secretsmanagerv1/secrets_manager_v1.go

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,7 @@ type ConfigAction struct {
23312331
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
23322332
//
23332333
// The alternative names can be host names or email addresses.
2334-
AltNames *string `json:"alt_names,omitempty"`
2334+
AltNames []string `json:"alt_names,omitempty"`
23352335

23362336
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
23372337
IPSans *string `json:"ip_sans,omitempty"`
@@ -2609,7 +2609,7 @@ type ConfigElementActionResultConfig struct {
26092609
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
26102610
//
26112611
// The alternative names can be host names or email addresses.
2612-
AltNames *string `json:"alt_names,omitempty"`
2612+
AltNames []string `json:"alt_names,omitempty"`
26132613

26142614
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
26152615
IPSans *string `json:"ip_sans,omitempty"`
@@ -2950,7 +2950,7 @@ type ConfigElementDefConfig struct {
29502950
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
29512951
//
29522952
// The alternative names can be host names or email addresses.
2953-
AltNames *string `json:"alt_names,omitempty"`
2953+
AltNames []string `json:"alt_names,omitempty"`
29542954

29552955
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
29562956
IPSans *string `json:"ip_sans,omitempty"`
@@ -2982,6 +2982,9 @@ type ConfigElementDefConfig struct {
29822982
KeyType *string `json:"key_type,omitempty"`
29832983

29842984
// The number of bits to use when generating the private key.
2985+
//
2986+
// Allowable values for RSA keys are: 2048 and 4096. Allowable values for EC keys are: 224, 256, 384 And 521. The
2987+
// default for RSA keys is 2048, and the default for EC keys is 256.
29852988
KeyBits *int64 `json:"key_bits,omitempty"`
29862989

29872990
// The maximum path length to encode in the generated certificate. `-1` means no limit.
@@ -3202,9 +3205,8 @@ const (
32023205
// Constants associated with the ConfigElementDefConfig.KeyType property.
32033206
// The type of private key to generate.
32043207
const (
3205-
ConfigElementDefConfigKeyTypeEcConst = "ec"
3206-
ConfigElementDefConfigKeyTypeEd25519Const = "ed25519"
3207-
ConfigElementDefConfigKeyTypeRsaConst = "rsa"
3208+
ConfigElementDefConfigKeyTypeEcConst = "ec"
3209+
ConfigElementDefConfigKeyTypeRsaConst = "rsa"
32083210
)
32093211

32103212
// Constants associated with the ConfigElementDefConfig.SigningMethod property.
@@ -8803,7 +8805,7 @@ type CertificateTemplateConfig struct {
88038805
// The value can be supplied as a string representation of a duration, such as `12h`. Hour (`h`) is the largest time
88048806
// suffix. The value can't exceed the `max_ttl` that is defined in the associated certificate template. Note that in
88058807
// the API response the value is returned in seconds (integer).
8806-
TTL interface{} `json:"ttl,omitempty"`
8808+
TTL *string `json:"ttl,omitempty"`
88078809

88088810
// Determines whether to allow `localhost` to be included as one of the requested common names.
88098811
AllowLocalhost *bool `json:"allow_localhost,omitempty"`
@@ -8878,11 +8880,13 @@ type CertificateTemplateConfig struct {
88788880
// The type of private key to generate for private certificates and the type of key that is expected for submitted
88798881
// certificate signing requests (CSRs).
88808882
//
8881-
// Allowable values are: `rsa`, `ec` and `any`. A value of `any` allow keys of either type and with any bit size. The
8882-
// bit size must be greater than 1024 bits for RSA keys.
8883+
// Allowable values are: `rsa` and `ec`.
88838884
KeyType *string `json:"key_type,omitempty"`
88848885

88858886
// The number of bits to use when generating the private key.
8887+
//
8888+
// Allowable values for RSA keys are: 2048 and 4096. Allowable values for EC keys are: 224, 256, 384 And 521. The
8889+
// default for RSA keys is 2048, and the default for EC keys is 256.
88868890
KeyBits *int64 `json:"key_bits,omitempty"`
88878891

88888892
// The allowed key usage constraint to define for private certificates.
@@ -8964,10 +8968,8 @@ type CertificateTemplateConfig struct {
89648968
// The type of private key to generate for private certificates and the type of key that is expected for submitted
89658969
// certificate signing requests (CSRs).
89668970
//
8967-
// Allowable values are: `rsa`, `ec` and `any`. A value of `any` allow keys of either type and with any bit size. The
8968-
// bit size must be greater than 1024 bits for RSA keys.
8971+
// Allowable values are: `rsa` and `ec`.
89698972
const (
8970-
CertificateTemplateConfigKeyTypeAnyConst = "any"
89718973
CertificateTemplateConfigKeyTypeEcConst = "ec"
89728974
CertificateTemplateConfigKeyTypeRsaConst = "rsa"
89738975
)
@@ -9701,7 +9703,7 @@ type IamCredentialsSecretResource struct {
97019703
// or `24h`.
97029704
//
97039705
// Minimum duration is 1 minute. Maximum is 90 days.
9704-
TTL interface{} `json:"ttl,omitempty"`
9706+
TTL *string `json:"ttl,omitempty"`
97059707

97069708
// The access groups that define the capabilities of the service ID and API key that are generated for an
97079709
// `iam_credentials` secret. If you prefer to use an existing service ID that is already assigned the access policies
@@ -10100,7 +10102,7 @@ type IntermediateCertificateAuthorityConfig struct {
1010010102
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1010110103
//
1010210104
// The alternative names can be host names or email addresses.
10103-
AltNames *string `json:"alt_names,omitempty"`
10105+
AltNames []string `json:"alt_names,omitempty"`
1010410106

1010510107
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1010610108
IPSans *string `json:"ip_sans,omitempty"`
@@ -10125,6 +10127,9 @@ type IntermediateCertificateAuthorityConfig struct {
1012510127
KeyType *string `json:"key_type,omitempty"`
1012610128

1012710129
// The number of bits to use when generating the private key.
10130+
//
10131+
// Allowable values for RSA keys are: 2048 and 4096. Allowable values for EC keys are: 224, 256, 384 And 521. The
10132+
// default for RSA keys is 2048, and the default for EC keys is 256.
1012810133
KeyBits *int64 `json:"key_bits,omitempty"`
1012910134

1013010135
// Controls whether the common name is excluded from Subject Alternative Names (SANs).
@@ -10208,9 +10213,8 @@ const (
1020810213
// Constants associated with the IntermediateCertificateAuthorityConfig.KeyType property.
1020910214
// The type of private key to generate.
1021010215
const (
10211-
IntermediateCertificateAuthorityConfigKeyTypeEcConst = "ec"
10212-
IntermediateCertificateAuthorityConfigKeyTypeEd25519Const = "ed25519"
10213-
IntermediateCertificateAuthorityConfigKeyTypeRsaConst = "rsa"
10216+
IntermediateCertificateAuthorityConfigKeyTypeEcConst = "ec"
10217+
IntermediateCertificateAuthorityConfigKeyTypeRsaConst = "rsa"
1021410218
)
1021510219

1021610220
// NewIntermediateCertificateAuthorityConfig : Instantiate IntermediateCertificateAuthorityConfig (Generic Model Constructor)
@@ -10816,7 +10820,7 @@ type PrivateCertificateSecretMetadata struct {
1081610820
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1081710821
//
1081810822
// The alternative names can be host names or email addresses.
10819-
AltNames *string `json:"alt_names,omitempty"`
10823+
AltNames []string `json:"alt_names,omitempty"`
1082010824

1082110825
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1082210826
IPSans *string `json:"ip_sans,omitempty"`
@@ -11120,7 +11124,7 @@ type PrivateCertificateSecretResource struct {
1112011124
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1112111125
//
1112211126
// The alternative names can be host names or email addresses.
11123-
AltNames *string `json:"alt_names,omitempty"`
11127+
AltNames []string `json:"alt_names,omitempty"`
1112411128

1112511129
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1112611130
IPSans *string `json:"ip_sans,omitempty"`
@@ -12392,7 +12396,7 @@ type RootCertificateAuthorityConfig struct {
1239212396
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1239312397
//
1239412398
// The alternative names can be host names or email addresses.
12395-
AltNames *string `json:"alt_names,omitempty"`
12399+
AltNames []string `json:"alt_names,omitempty"`
1239612400

1239712401
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1239812402
IPSans *string `json:"ip_sans,omitempty"`
@@ -12424,6 +12428,9 @@ type RootCertificateAuthorityConfig struct {
1242412428
KeyType *string `json:"key_type,omitempty"`
1242512429

1242612430
// The number of bits to use when generating the private key.
12431+
//
12432+
// Allowable values for RSA keys are: 2048 and 4096. Allowable values for EC keys are: 224, 256, 384 And 521. The
12433+
// default for RSA keys is 2048, and the default for EC keys is 256.
1242712434
KeyBits *int64 `json:"key_bits,omitempty"`
1242812435

1242912436
// The maximum path length to encode in the generated certificate. `-1` means no limit.
@@ -12505,9 +12512,8 @@ const (
1250512512
// Constants associated with the RootCertificateAuthorityConfig.KeyType property.
1250612513
// The type of private key to generate.
1250712514
const (
12508-
RootCertificateAuthorityConfigKeyTypeEcConst = "ec"
12509-
RootCertificateAuthorityConfigKeyTypeEd25519Const = "ed25519"
12510-
RootCertificateAuthorityConfigKeyTypeRsaConst = "rsa"
12515+
RootCertificateAuthorityConfigKeyTypeEcConst = "ec"
12516+
RootCertificateAuthorityConfigKeyTypeRsaConst = "rsa"
1251112517
)
1251212518

1251312519
// NewRootCertificateAuthorityConfig : Instantiate RootCertificateAuthorityConfig (Generic Model Constructor)
@@ -12971,7 +12977,7 @@ type SignCsrAction struct {
1297112977
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1297212978
//
1297312979
// The alternative names can be host names or email addresses.
12974-
AltNames *string `json:"alt_names,omitempty"`
12980+
AltNames []string `json:"alt_names,omitempty"`
1297512981

1297612982
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1297712983
IPSans *string `json:"ip_sans,omitempty"`
@@ -13168,7 +13174,7 @@ type SignCsrActionResult struct {
1316813174
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1316913175
//
1317013176
// The alternative names can be host names or email addresses.
13171-
AltNames *string `json:"alt_names,omitempty"`
13177+
AltNames []string `json:"alt_names,omitempty"`
1317213178

1317313179
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1317413180
IPSans *string `json:"ip_sans,omitempty"`
@@ -13363,7 +13369,7 @@ type SignIntermediateAction struct {
1336313369
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1336413370
//
1336513371
// The alternative names can be host names or email addresses.
13366-
AltNames *string `json:"alt_names,omitempty"`
13372+
AltNames []string `json:"alt_names,omitempty"`
1336713373

1336813374
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1336913375
IPSans *string `json:"ip_sans,omitempty"`
@@ -13561,7 +13567,7 @@ type SignIntermediateActionResult struct {
1356113567
// The Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1356213568
//
1356313569
// The alternative names can be host names or email addresses.
13564-
AltNames *string `json:"alt_names,omitempty"`
13570+
AltNames []string `json:"alt_names,omitempty"`
1356513571

1356613572
// The IP Subject Alternative Names to define for the CA certificate, in a comma-delimited list.
1356713573
IPSans *string `json:"ip_sans,omitempty"`

secretsmanagerv1/secrets_manager_v1_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5926,7 +5926,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
59265926
// Construct an instance of the SignCsrAction model
59275927
configActionModel := new(secretsmanagerv1.SignCsrAction)
59285928
configActionModel.CommonName = core.StringPtr("example.com")
5929-
configActionModel.AltNames = core.StringPtr("testString")
5929+
configActionModel.AltNames = []string{"testString"}
59305930
configActionModel.IPSans = core.StringPtr("testString")
59315931
configActionModel.URISans = core.StringPtr("testString")
59325932
configActionModel.OtherSans = []string{"testString"}
@@ -6006,7 +6006,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
60066006
// Set mock response
60076007
res.Header().Set("Content-type", "application/json")
60086008
res.WriteHeader(200)
6009-
fmt.Fprintf(res, "%s", `{"metadata": {"collection_type": "application/vnd.ibm.secrets-manager.config+json", "collection_total": 1}, "resources": [{"name": "Name", "type": "letsencrypt", "config": {"common_name": "example.com", "alt_names": "AltNames", "ip_sans": "IPSans", "uri_sans": "URISans", "other_sans": ["OtherSans"], "ttl": "12h", "format": "pem", "max_path_length": 13, "exclude_cn_from_sans": false, "permitted_dns_domains": ["PermittedDNSDomains"], "use_csr_values": false, "ou": ["Ou"], "organization": ["Organization"], "country": ["Country"], "locality": ["Locality"], "province": ["Province"], "street_address": ["StreetAddress"], "postal_code": ["PostalCode"], "serial_number": "d9:be:fe:35:ba:09:42:b5", "data": {"certificate": "Certificate", "serial_number": "d9:be:fe:35:ba:09:42:b5", "issuing_ca": "IssuingCa", "ca_chain": ["CaChain"], "expiration": 10}, "csr": "Csr"}}]}`)
6009+
fmt.Fprintf(res, "%s", `{"metadata": {"collection_type": "application/vnd.ibm.secrets-manager.config+json", "collection_total": 1}, "resources": [{"name": "Name", "type": "letsencrypt", "config": {"common_name": "example.com", "alt_names": ["AltNames"], "ip_sans": "IPSans", "uri_sans": "URISans", "other_sans": ["OtherSans"], "ttl": "12h", "format": "pem", "max_path_length": 13, "exclude_cn_from_sans": false, "permitted_dns_domains": ["PermittedDNSDomains"], "use_csr_values": false, "ou": ["Ou"], "organization": ["Organization"], "country": ["Country"], "locality": ["Locality"], "province": ["Province"], "street_address": ["StreetAddress"], "postal_code": ["PostalCode"], "serial_number": "d9:be:fe:35:ba:09:42:b5", "data": {"certificate": "Certificate", "serial_number": "d9:be:fe:35:ba:09:42:b5", "issuing_ca": "IssuingCa", "ca_chain": ["CaChain"], "expiration": 10}, "csr": "Csr"}}]}`)
60106010
}))
60116011
})
60126012
It(`Invoke ActionOnConfigElement successfully with retries`, func() {
@@ -6021,7 +6021,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
60216021
// Construct an instance of the SignCsrAction model
60226022
configActionModel := new(secretsmanagerv1.SignCsrAction)
60236023
configActionModel.CommonName = core.StringPtr("example.com")
6024-
configActionModel.AltNames = core.StringPtr("testString")
6024+
configActionModel.AltNames = []string{"testString"}
60256025
configActionModel.IPSans = core.StringPtr("testString")
60266026
configActionModel.URISans = core.StringPtr("testString")
60276027
configActionModel.OtherSans = []string{"testString"}
@@ -6104,7 +6104,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
61046104
// Set mock response
61056105
res.Header().Set("Content-type", "application/json")
61066106
res.WriteHeader(200)
6107-
fmt.Fprintf(res, "%s", `{"metadata": {"collection_type": "application/vnd.ibm.secrets-manager.config+json", "collection_total": 1}, "resources": [{"name": "Name", "type": "letsencrypt", "config": {"common_name": "example.com", "alt_names": "AltNames", "ip_sans": "IPSans", "uri_sans": "URISans", "other_sans": ["OtherSans"], "ttl": "12h", "format": "pem", "max_path_length": 13, "exclude_cn_from_sans": false, "permitted_dns_domains": ["PermittedDNSDomains"], "use_csr_values": false, "ou": ["Ou"], "organization": ["Organization"], "country": ["Country"], "locality": ["Locality"], "province": ["Province"], "street_address": ["StreetAddress"], "postal_code": ["PostalCode"], "serial_number": "d9:be:fe:35:ba:09:42:b5", "data": {"certificate": "Certificate", "serial_number": "d9:be:fe:35:ba:09:42:b5", "issuing_ca": "IssuingCa", "ca_chain": ["CaChain"], "expiration": 10}, "csr": "Csr"}}]}`)
6107+
fmt.Fprintf(res, "%s", `{"metadata": {"collection_type": "application/vnd.ibm.secrets-manager.config+json", "collection_total": 1}, "resources": [{"name": "Name", "type": "letsencrypt", "config": {"common_name": "example.com", "alt_names": ["AltNames"], "ip_sans": "IPSans", "uri_sans": "URISans", "other_sans": ["OtherSans"], "ttl": "12h", "format": "pem", "max_path_length": 13, "exclude_cn_from_sans": false, "permitted_dns_domains": ["PermittedDNSDomains"], "use_csr_values": false, "ou": ["Ou"], "organization": ["Organization"], "country": ["Country"], "locality": ["Locality"], "province": ["Province"], "street_address": ["StreetAddress"], "postal_code": ["PostalCode"], "serial_number": "d9:be:fe:35:ba:09:42:b5", "data": {"certificate": "Certificate", "serial_number": "d9:be:fe:35:ba:09:42:b5", "issuing_ca": "IssuingCa", "ca_chain": ["CaChain"], "expiration": 10}, "csr": "Csr"}}]}`)
61086108
}))
61096109
})
61106110
It(`Invoke ActionOnConfigElement successfully`, func() {
@@ -6124,7 +6124,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
61246124
// Construct an instance of the SignCsrAction model
61256125
configActionModel := new(secretsmanagerv1.SignCsrAction)
61266126
configActionModel.CommonName = core.StringPtr("example.com")
6127-
configActionModel.AltNames = core.StringPtr("testString")
6127+
configActionModel.AltNames = []string{"testString"}
61286128
configActionModel.IPSans = core.StringPtr("testString")
61296129
configActionModel.URISans = core.StringPtr("testString")
61306130
configActionModel.OtherSans = []string{"testString"}
@@ -6171,7 +6171,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
61716171
// Construct an instance of the SignCsrAction model
61726172
configActionModel := new(secretsmanagerv1.SignCsrAction)
61736173
configActionModel.CommonName = core.StringPtr("example.com")
6174-
configActionModel.AltNames = core.StringPtr("testString")
6174+
configActionModel.AltNames = []string{"testString"}
61756175
configActionModel.IPSans = core.StringPtr("testString")
61766176
configActionModel.URISans = core.StringPtr("testString")
61776177
configActionModel.OtherSans = []string{"testString"}
@@ -6239,7 +6239,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
62396239
// Construct an instance of the SignCsrAction model
62406240
configActionModel := new(secretsmanagerv1.SignCsrAction)
62416241
configActionModel.CommonName = core.StringPtr("example.com")
6242-
configActionModel.AltNames = core.StringPtr("testString")
6242+
configActionModel.AltNames = []string{"testString"}
62436243
configActionModel.IPSans = core.StringPtr("testString")
62446244
configActionModel.URISans = core.StringPtr("testString")
62456245
configActionModel.OtherSans = []string{"testString"}
@@ -6938,7 +6938,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
69386938
configActionModel := new(secretsmanagerv1.SignCsrAction)
69396939
Expect(configActionModel).ToNot(BeNil())
69406940
configActionModel.CommonName = core.StringPtr("example.com")
6941-
configActionModel.AltNames = core.StringPtr("testString")
6941+
configActionModel.AltNames = []string{"testString"}
69426942
configActionModel.IPSans = core.StringPtr("testString")
69436943
configActionModel.URISans = core.StringPtr("testString")
69446944
configActionModel.OtherSans = []string{"testString"}
@@ -6958,7 +6958,7 @@ var _ = Describe(`SecretsManagerV1`, func() {
69586958
configActionModel.SerialNumber = core.StringPtr("d9:be:fe:35:ba:09:42:b5")
69596959
configActionModel.Csr = core.StringPtr("testString")
69606960
Expect(configActionModel.CommonName).To(Equal(core.StringPtr("example.com")))
6961-
Expect(configActionModel.AltNames).To(Equal(core.StringPtr("testString")))
6961+
Expect(configActionModel.AltNames).To(Equal([]string{"testString"}))
69626962
Expect(configActionModel.IPSans).To(Equal(core.StringPtr("testString")))
69636963
Expect(configActionModel.URISans).To(Equal(core.StringPtr("testString")))
69646964
Expect(configActionModel.OtherSans).To(Equal([]string{"testString"}))

0 commit comments

Comments
 (0)