Skip to content

Commit 151e02b

Browse files
Google APIscopybara-github
authored andcommitted
feat!: Replace enum with string representation for predefined ACLs and public_access_prevention
fix!: Remove CustomPlacementConfig, which is no longer the way custom dual regions will be specified feat: Add Autoclass support to Bucket configuration feat: Add matches_prefix and matches_suffix support to Lifecycle configuration PiperOrigin-RevId: 438078321
1 parent b5efd1e commit 151e02b

1 file changed

Lines changed: 49 additions & 88 deletions

File tree

google/storage/v2/storage.proto

Lines changed: 49 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,14 @@ message CreateBucketRequest {
325325
string bucket_id = 3 [(google.api.field_behavior) = REQUIRED];
326326

327327
// Apply a predefined set of access controls to this bucket.
328-
PredefinedBucketAcl predefined_acl = 4;
328+
// Valid values are "authenticatedRead", "private", "projectPrivate",
329+
// "publicRead", or "publicReadWrite".
330+
string predefined_acl = 6;
329331

330332
// Apply a predefined set of default object access controls to this bucket.
331-
PredefinedObjectAcl predefined_default_object_acl = 5;
333+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
334+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
335+
string predefined_default_object_acl = 7;
332336
}
333337

334338
// Request message for ListBuckets.
@@ -407,10 +411,14 @@ message UpdateBucketRequest {
407411
optional int64 if_metageneration_not_match = 3;
408412

409413
// Apply a predefined set of access controls to this bucket.
410-
PredefinedBucketAcl predefined_acl = 4;
414+
// Valid values are "authenticatedRead", "private", "projectPrivate",
415+
// "publicRead", or "publicReadWrite".
416+
string predefined_acl = 8;
411417

412418
// Apply a predefined set of default object access controls to this bucket.
413-
PredefinedObjectAcl predefined_default_object_acl = 5;
419+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
420+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
421+
string predefined_default_object_acl = 9;
414422

415423
// List of fields to be updated.
416424
//
@@ -529,7 +537,9 @@ message ComposeObjectRequest {
529537
repeated SourceObject source_objects = 2;
530538

531539
// Apply a predefined set of access controls to the destination object.
532-
PredefinedObjectAcl destination_predefined_acl = 3;
540+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
541+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
542+
string destination_predefined_acl = 9;
533543

534544
// Makes the operation conditional on whether the object's current generation
535545
// matches the given value. Setting to 0 makes the operation succeed only if
@@ -708,7 +718,7 @@ message GetObjectRequest {
708718
optional google.protobuf.FieldMask read_mask = 10;
709719
}
710720

711-
// Response message for GetObject.
721+
// Response message for ReadObject.
712722
message ReadObjectResponse {
713723
// A portion of the data for the object. The service **may** leave `data`
714724
// empty for any given `ReadResponse`. This enables the service to inform the
@@ -737,7 +747,9 @@ message WriteObjectSpec {
737747
Object resource = 1;
738748

739749
// Apply a predefined set of access controls to this object.
740-
PredefinedObjectAcl predefined_acl = 2;
750+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
751+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
752+
string predefined_acl = 7;
741753

742754
// Makes the operation conditional on whether the object's current
743755
// generation matches the given value. Setting to 0 makes the operation
@@ -984,7 +996,9 @@ message RewriteObjectRequest {
984996
string rewrite_token = 5;
985997

986998
// Apply a predefined set of access controls to the destination object.
987-
PredefinedObjectAcl destination_predefined_acl = 6;
999+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
1000+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
1001+
string destination_predefined_acl = 28;
9881002

9891003
// Makes the operation conditional on whether the object's current generation
9901004
// matches the given value. Setting to 0 makes the operation succeed only if
@@ -1123,7 +1137,9 @@ message UpdateObjectRequest {
11231137
optional int64 if_metageneration_not_match = 5;
11241138

11251139
// Apply a predefined set of access controls to this object.
1126-
PredefinedObjectAcl predefined_acl = 6;
1140+
// Valid values are "authenticatedRead", "bucketOwnerFullControl",
1141+
// "bucketOwnerRead", "private", "projectPrivate", or "publicRead".
1142+
string predefined_acl = 10;
11271143

11281144
// List of fields to be updated.
11291145
//
@@ -1444,26 +1460,12 @@ message Bucket {
14441460
google.protobuf.Timestamp lock_time = 2;
14451461
}
14461462

1447-
// Public Access Prevention config values.
1448-
enum PublicAccessPrevention {
1449-
// No specified PublicAccessPrevention.
1450-
PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0;
1451-
1452-
// Prevents access from being granted to public members 'allUsers' and
1453-
// 'allAuthenticatedUsers'. Prevents attempts to grant new access to
1454-
// public members.
1455-
ENFORCED = 1;
1456-
1457-
// This setting is inherited from Org Policy. Does not prevent access from
1458-
// being granted to public members 'allUsers' or 'allAuthenticatedUsers'.
1459-
INHERITED = 2;
1460-
}
1461-
14621463
// Bucket restriction options currently enforced on the bucket.
14631464
UniformBucketLevelAccess uniform_bucket_level_access = 1;
14641465

1465-
// Whether IAM will enforce public access prevention.
1466-
PublicAccessPrevention public_access_prevention = 2;
1466+
// Whether IAM will enforce public access prevention. Valid values are
1467+
// "enforced" or "inherited".
1468+
string public_access_prevention = 3;
14671469
}
14681470

14691471
// Lifecycle properties of a bucket.
@@ -1531,6 +1533,14 @@ message Bucket {
15311533
// version satisfies this condition only if it became noncurrent before
15321534
// the specified date in UTC.
15331535
google.type.Date noncurrent_time_before = 10;
1536+
1537+
// List of object name prefixes. If any prefix exactly matches the
1538+
// beginning of the object name, the condition evaluates to true.
1539+
repeated string matches_prefix = 11;
1540+
1541+
// List of object name suffixes. If any suffix exactly matches the
1542+
// end of the object name, the condition evaluates to true.
1543+
repeated string matches_suffix = 12;
15341544
}
15351545

15361546
// The action to take.
@@ -1597,11 +1607,16 @@ message Bucket {
15971607
string not_found_page = 2;
15981608
}
15991609

1600-
// Configuration for Custom Dual Regions. It should specify precisely two
1601-
// eligible regions within the same Multiregion.
1602-
message CustomPlacementConfig {
1603-
// List of locations to use for data placement.
1604-
repeated string data_locations = 1;
1610+
// Configuration for a bucket's Autoclass feature.
1611+
message Autoclass {
1612+
// Enables Autoclass.
1613+
bool enabled = 1;
1614+
1615+
// Output only. Latest instant at which the `enabled` field was set to true after being
1616+
// disabled/unconfigured or set to false after being enabled. If Autoclass
1617+
// is enabled when the bucket is created, the toggle_time is set to the
1618+
// bucket creation time.
1619+
google.protobuf.Timestamp toggle_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
16051620
}
16061621

16071622
// Immutable. The name of the bucket.
@@ -1738,9 +1753,9 @@ message Bucket {
17381753
// Reserved for future use.
17391754
bool satisfies_pzs = 25;
17401755

1741-
// Configuration that, if present, specifies the data placement for a Custom
1742-
// Dual Region.
1743-
CustomPlacementConfig custom_placement_config = 26;
1756+
// The bucket's Autoclass configuration. If there is no configuration, the
1757+
// Autoclass feature will be disabled and have no effect on the bucket.
1758+
Autoclass autoclass = 28;
17441759
}
17451760

17461761
// An access-control entry.
@@ -2121,57 +2136,3 @@ message ContentRange {
21212136
// The complete length of the object data.
21222137
int64 complete_length = 3;
21232138
}
2124-
2125-
// Predefined or "canned" aliases for sets of specific object ACL entries.
2126-
enum PredefinedObjectAcl {
2127-
// No predefined ACL.
2128-
PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0;
2129-
2130-
// Object owner gets `OWNER` access, and
2131-
// `allAuthenticatedUsers` get `READER` access.
2132-
OBJECT_ACL_AUTHENTICATED_READ = 1;
2133-
2134-
// Object owner gets `OWNER` access, and project team owners get
2135-
// `OWNER` access.
2136-
OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2;
2137-
2138-
// Object owner gets `OWNER` access, and project team owners get
2139-
// `READER` access.
2140-
OBJECT_ACL_BUCKET_OWNER_READ = 3;
2141-
2142-
// Object owner gets `OWNER` access.
2143-
OBJECT_ACL_PRIVATE = 4;
2144-
2145-
// Object owner gets `OWNER` access, and project team members get
2146-
// access according to their roles.
2147-
OBJECT_ACL_PROJECT_PRIVATE = 5;
2148-
2149-
// Object owner gets `OWNER` access, and `allUsers`
2150-
// get `READER` access.
2151-
OBJECT_ACL_PUBLIC_READ = 6;
2152-
}
2153-
2154-
// A set of predefined, or "canned," ACLs that can be set on a
2155-
// bucket instead of manually specifying a complete ACL.
2156-
enum PredefinedBucketAcl {
2157-
// No predefined ACL.
2158-
PREDEFINED_BUCKET_ACL_UNSPECIFIED = 0;
2159-
2160-
// Project team owners get `OWNER` access, and
2161-
// `allAuthenticatedUsers` get `READER` access.
2162-
BUCKET_ACL_AUTHENTICATED_READ = 1;
2163-
2164-
// Project team owners get `OWNER` access.
2165-
BUCKET_ACL_PRIVATE = 2;
2166-
2167-
// Project team members get access according to their roles.
2168-
BUCKET_ACL_PROJECT_PRIVATE = 3;
2169-
2170-
// Project team owners get `OWNER` access, and
2171-
// `allUsers` get `READER` access.
2172-
BUCKET_ACL_PUBLIC_READ = 4;
2173-
2174-
// Project team owners get `OWNER` access, and
2175-
// `allUsers` get `WRITER` access.
2176-
BUCKET_ACL_PUBLIC_READ_WRITE = 5;
2177-
}

0 commit comments

Comments
 (0)