You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(bigquery): support IAM conditions in datasets (#11123)
This PR adds support for IAM conditions via the existing dataset access mechanism. To do so, the following changes are necessary:
* add the `Expr` type for expressing conditions, and wire it into the existing DatasetAccessEntry.
* add an option pattern to the Dataset-related RPC methods
* Add a new WithAccessPolicyVersion option for setting access policies
To expose the new functionality, this PR adds CreateWithOptions, UpdateWithOptions, MetadataWithOptions methods on Dataset that accept the new option.
// dsCallOption provides a general option holder for dataset RPCs
343
+
typedsCallOptionstruct {
344
+
accessPolicyVersion optional.Int
345
+
}
346
+
347
+
// DatasetOption provides an option type for customizing requests against the Dataset
348
+
// service.
349
+
typeDatasetOptionfunc(*dsCallOption)
350
+
351
+
// WithAccessPolicyVersion is an option that enabled setting of the Access Policy Version for a request
352
+
// where appropriate. Valid values are 0, 1, and 3.
353
+
//
354
+
// Requests specifying an invalid value will be rejected.
355
+
// Requests for conditional access policy binding in datasets must specify version 3.
356
+
//
357
+
// Dataset with no conditional role bindings in access policy may specify any valid value
358
+
// or leave the field unset.
359
+
//
360
+
// This field will be mapped to [IAM Policy version] (https://cloud.google.com/iam/docs/policies#versions)
361
+
// and will be used to fetch policy from IAM. If unset or if 0 or 1 value is used for
362
+
// dataset with conditional bindings, access entry with condition will have role string
363
+
// appended by 'withcond' string followed by a hash value.
364
+
//
365
+
// Please refer https://cloud.google.com/iam/docs/troubleshooting-withcond for more details.
0 commit comments