Skip to content

Commit 2bede14

Browse files
sophyawu09Dawid212
authored andcommitted
Feat add cas custom cdp aia support (GoogleCloudPlatform#12452)
1 parent 56c453c commit 2bede14

File tree

2 files changed

+73
-2
lines changed

2 files changed

+73
-2
lines changed

mmv1/products/privateca/CertificateAuthority.yaml

+33-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ examples:
105105
# Skip test because it depends on a beta resource, but PrivateCA does
106106
# not have a beta endpoint
107107
exclude_test: true
108-
# Multiple IAM bindings on the same key cause non-determinism
108+
# Multiple IAM bindings on the same key cause non-determinism
109109
skip_vcr: true
110110
- name: 'privateca_certificate_authority_custom_ski'
111111
primary_resource_id: 'default'
@@ -126,6 +126,19 @@ examples:
126126
exclude_test: true
127127
# Multiple IAM bindings on the same key cause non-determinism
128128
skip_vcr: true
129+
- name: 'privateca_certificate_authority_basic_with_custom_cdp_aia_urls'
130+
primary_resource_id: 'default'
131+
vars:
132+
certificate_authority_id: 'my-certificate-authority'
133+
pool_name: 'ca-pool'
134+
pool_location: 'us-central1'
135+
deletion_protection: 'true'
136+
test_vars_overrides:
137+
'pool_name': 'acctest.BootstrapSharedCaPoolInLocation(t, "us-central1")'
138+
'pool_location': '"us-central1"'
139+
'deletion_protection': 'false'
140+
ignore_read_extra:
141+
- 'deletion_protection'
129142
virtual_fields:
130143
- name: 'deletion_protection'
131144
description: |
@@ -638,7 +651,7 @@ properties:
638651
"notAfterTime" fields inside an X.509 certificate. A duration in seconds with up to nine
639652
fractional digits, terminated by 's'. Example: "3.5s".
640653
immutable: true
641-
# 10 years
654+
# 10 years
642655
default_value: "315360000s"
643656
- name: 'keySpec'
644657
type: NestedObject
@@ -785,3 +798,21 @@ properties:
785798
786799
An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass":
787800
"1.3kg", "count": "3" }.
801+
- name: 'userDefinedAccessUrls'
802+
type: NestedObject
803+
description: |
804+
Custom URLs for accessing content published by this CA, such as the CA certificate and CRLs,
805+
that can be specified by users.
806+
properties:
807+
- name: 'aiaIssuingCertificateUrls'
808+
type: Array
809+
description: |
810+
A list of URLs where this CertificateAuthority's CA certificate is published that is specified by users.
811+
item_type:
812+
type: String
813+
- name: 'crlAccessUrls'
814+
type: Array
815+
description: |
816+
A list of URLs where this CertificateAuthority's CRLs are published that is specified by users.
817+
item_type:
818+
type: String
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
resource "google_privateca_certificate_authority" "{{$.PrimaryResourceId}}" {
2+
// This example assumes this pool already exists.
3+
// Pools cannot be deleted in normal test circumstances, so we depend on static pools
4+
pool = "{{index $.Vars "pool_name"}}"
5+
certificate_authority_id = "{{index $.Vars "certificate_authority_id"}}"
6+
location = "{{index $.Vars "pool_location"}}"
7+
deletion_protection = {{index $.Vars "deletion_protection"}}
8+
config {
9+
subject_config {
10+
subject {
11+
organization = "ACME"
12+
common_name = "my-certificate-authority"
13+
}
14+
}
15+
x509_config {
16+
ca_options {
17+
# is_ca *MUST* be true for certificate authorities
18+
is_ca = true
19+
}
20+
key_usage {
21+
base_key_usage {
22+
# cert_sign and crl_sign *MUST* be true for certificate authorities
23+
cert_sign = true
24+
crl_sign = true
25+
}
26+
extended_key_usage {
27+
}
28+
}
29+
}
30+
}
31+
# valid for 10 years
32+
lifetime = "${10 * 365 * 24 * 3600}s"
33+
key_spec {
34+
algorithm = "RSA_PKCS1_4096_SHA256"
35+
}
36+
user_defined_access_urls {
37+
aia_issuing_certificate_urls = ["http://example.com/ca.crt", "http://example.com/anotherca.crt"]
38+
crl_access_urls = ["http://example.com/crl1.crt", "http://example.com/crl2.crt"]
39+
}
40+
}

0 commit comments

Comments
 (0)