Skip to content

Commit f98a696

Browse files
authored
fix: added missing validations (#414)
1 parent b776c7c commit f98a696

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed

modules/simple_bucket/metadata.display.yaml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,41 @@ spec:
3939
cors:
4040
name: cors
4141
title: Cors
42+
properties:
43+
method:
44+
name: method
45+
title: Method
46+
regexValidation: ^(GET|HEAD|POST|PUT|DELETE|OPTIONS|PATCH)$
47+
validation: Method must be one of [GET, HEAD, POST, PUT, DELETE, OPTIONS, PATCH].
48+
origin:
49+
name: origin
50+
title: Origin
51+
regexValidation: "^([*]|https?://([a-zA-Z0-9.-]+|[[0-9a-fA-F:.]+])(:[0-9]{1,5})?)$"
52+
validation: Must be "*" or a valid HTTP/HTTPS origin, optionally including a port (e.g., https://example.com, http://localhost:8080).
53+
response_header:
54+
name: response_header
55+
title: Response Header
56+
regexValidation: "^([*]|[A-Za-z0-9]+(-[A-Za-z0-9]+)*)$"
57+
validation: Must be "*" or a valid HTTP header name containing only letters, digits, and hyphens, and must start and end with a letter or digit (e.g., Content-Type, X-Custom-Header)
4258
custom_placement_config:
4359
name: custom_placement_config
4460
title: Custom Placement Config
61+
properties:
62+
data_locations:
63+
name: data_locations
64+
title: Data Locations
65+
regexValidation: "^(?:[A-Z]+(?:-[A-Z0-9]+)*)(?:,[A-Z]+(?:-[A-Z0-9]+)*)*$"
66+
validation: Must be a region ID in the format REGION-NAME+NUMBER (e.g., US-CENTRAL1, EUROPE-WEST4, ASIA-SOUTH1)
4567
encryption:
4668
name: encryption
4769
title: Encryption
4870
level: 1
71+
properties:
72+
default_kms_key_name:
73+
name: default_kms_key_name
74+
title: Default KMS Key Name
75+
regexValidation: "^projects/[A-Za-z0-9_-]+/locations/[A-Za-z0-9_-]+/keyRings/[A-Za-z0-9_-]+/cryptoKeys/[A-Za-z0-9_-]+$"
76+
validation: Must be a valid Cloud KMS key resource name in the format projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}
4977
force_destroy:
5078
name: force_destroy
5179
title: Force Destroy
@@ -56,23 +84,118 @@ spec:
5684
iam_members:
5785
name: iam_members
5886
title: Iam Members
87+
properties:
88+
role:
89+
name: role
90+
title: Role
91+
regexValidation: "^(?:[a-z][a-z0-9-]{4,29}/)?roles/[a-zA-Z0-9_.]+$"
92+
validation: Role must be in the format roles/{role_name}.
93+
member:
94+
name: member
95+
title: Member
96+
regexValidation: "^(user:[^@ ]+@[^@ ]+[.][^@ ]+|serviceAccount:[^@ ]+@[^@ ]+[.][^@ ]+|group:[^@ ]+@[^@ ]+[.][^@ ]+|domain:[^@ ]+[.][^@ ]+|allUsers|allAuthenticatedUsers)$"
97+
validation: Value must be a valid IAM member, such as user:{email}, serviceAccount:{email}, group:{email}, domain:{domain}, allUsers, or allAuthenticatedUsers
5998
internal_encryption_config:
6099
name: internal_encryption_config
61100
title: Internal Encryption Config
62101
level: 1
102+
properties:
103+
key_rotation_period:
104+
name: key_rotation_period
105+
title: Key Rotation Period
106+
regexValidation: "^(8[6-9][0-9]{3}|9[0-9]{4}|[1-9][0-9]{5,})(.[0-9]{1,9})?s$"
107+
validation: Must be a duration in seconds, with optional fractional part (up to 9 digits), ending in "s". Must be greater than 86400s (24 hours).
63108
labels:
64109
name: labels
65110
title: Labels
66111
lifecycle_rules:
67112
name: lifecycle_rules
68113
title: Lifecycle Rules
69114
level: 1
115+
properties:
116+
action:
117+
name: action
118+
title: Action
119+
properties:
120+
type:
121+
name: type
122+
title: Type
123+
enumValueLabels:
124+
- label: DELETE
125+
value: Delete
126+
- label: SET_STORAGE_CLASS
127+
value: SetStorageClass
128+
storage_class:
129+
name: storage_class
130+
title: Storage Class
131+
enumValueLabels:
132+
- label: STANDARD
133+
value: STANDARD
134+
- label: MULTI_REGIONAL
135+
value: MULTI_REGIONAL
136+
- label: REGIONAL
137+
value: REGIONAL
138+
- label: NEARLINE
139+
value: NEARLINE
140+
- label: COLDLINE
141+
value: COLDLINE
142+
- label: ARCHIVE
143+
value: ARCHIVE
144+
condition:
145+
name: condition
146+
title: Condition
147+
properties:
148+
created_before:
149+
name: created_before
150+
title: Created Before
151+
regexValidation: "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
152+
validation: Must be a date in RFC 3339 format (YYYY-MM-DD)
153+
with_state:
154+
name: with_state
155+
title: With State
156+
enumValueLabels:
157+
- label: LIVE
158+
value: LIVE
159+
- label: ARCHIVED
160+
value: ARCHIVED
161+
- label: ANY
162+
value: ANY
163+
matches_storage_class:
164+
name: matches_storage_class
165+
title: Matches Storage Class
166+
enumValueLabels:
167+
- label: STANDARD
168+
value: STANDARD
169+
- label: MULTI_REGIONAL
170+
value: MULTI_REGIONAL
171+
- label: REGIONAL
172+
value: REGIONAL
173+
- label: NEARLINE
174+
value: NEARLINE
175+
- label: COLDLINE
176+
value: COLDLINE
177+
- label: ARCHIVE
178+
value: ARCHIVE
179+
custom_time_before:
180+
name: custom_time_before
181+
title: Custom Time Before
182+
regexValidation: "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
183+
validation: Must be a date in RFC 3339 format (YYYY-MM-DD)
184+
noncurrent_time_before:
185+
name: noncurrent_time_before
186+
title: Noncurrent Time Before
187+
regexValidation: "^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"
188+
validation: Must be a date in RFC 3339 format (YYYY-MM-DD)
70189
location:
71190
name: location
72191
title: Location
192+
regexValidation: ^(?:[A-Z]+(?:-[A-Z0-9]+)*)(?:,[A-Z]+(?:-[A-Z0-9]+)*)*$
193+
validation: Must be a region ID in the format REGION-NAME+NUMBER (e.g., US-CENTRAL1, EUROPE-WEST4, ASIA-SOUTH1)
73194
log_bucket:
74195
name: log_bucket
75196
title: Log Bucket
197+
regexValidation: "^([A-Za-z0-9-_.]+)/?$"
198+
validation: Must be a valid bucket name or namespaced identifier (letters, numbers, hyphens, underscores, periods), e.g., my-log-bucket or project-id/my-log-bucket
76199
log_object_prefix:
77200
name: log_object_prefix
78201
title: Log Object Prefix
@@ -87,6 +210,11 @@ spec:
87210
public_access_prevention:
88211
name: public_access_prevention
89212
title: Public Access Prevention
213+
enumValueLabels:
214+
- label: INHERITED
215+
value: inherited
216+
- label: ENFORCED
217+
value: enforced
90218
retention_policy:
91219
name: retention_policy
92220
title: Retention Policy
@@ -121,3 +249,14 @@ spec:
121249
website:
122250
name: website
123251
title: Website
252+
properties:
253+
main_page_suffix:
254+
name: main_page_suffix
255+
title: Main Page Suffix
256+
regexValidation: "^[A-Za-z0-9._-]+$"
257+
validation: Must be a valid Cloud Storage object name. It may contain any UTF-8 characters except control characters
258+
not_found_page:
259+
name: not_found_page
260+
title: Not Found Page
261+
regexValidation: "^[A-Za-z0-9._-]+$"
262+
validation: Must be a valid Cloud Storage object name. It may contain letters (a–z, A–Z), numbers (0–9), dots (.), underscores (_), slashes (/), and hyphens (-)

0 commit comments

Comments
 (0)