buckets
Functionality related to querying the user for bucket access.
BucketAuth
Bases: BaseModel
A BucketAuth
references a bucket and holds an associated access type (read or write).
Attributes:
Name | Type | Description |
---|---|---|
simple_name |
str
|
the name (without the |
access_type |
str
|
|
Source code in dapla_team_cli/tf/iam_bindings/buckets.py
11 12 13 14 15 16 17 18 19 20 |
|
SimpleBucketNameValidator
Bases: Validator
Questionary Validator used for checking if a user provided bucket name is properly formatted.
Source code in dapla_team_cli/tf/iam_bindings/buckets.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
validate(document)
Validate that a bucket name is appropriately formatted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document |
Document
|
The document to validate |
required |
Raises:
Type | Description |
---|---|
ValidationError
|
if input does not adhere to the naming convention. |
Source code in dapla_team_cli/tf/iam_bindings/buckets.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
ask_for_buckets(team_name, auth_group)
Ask the user for buckets to which access should be granted.
Also prompt for which environments and until which timestamp the access should be granted.
The user can select buckets from a list, or supply a custom (other) bucket name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
team_name |
str
|
The Dapla team name, used for customizing the prompts |
required |
auth_group |
str
|
The auth group name, used for customizing the prompts |
required |
Returns:
Type | Description |
---|---|
List[BucketAuth]
|
A list of buckets |
Source code in dapla_team_cli/tf/iam_bindings/buckets.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
ask_for_other_bucket(team_name)
Query for a custom bucket.
This path is taken if the user selects "other" in the bucket choices dialog.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
team_name |
str
|
The team name. Used for deducing full bucket name. |
required |
Returns:
Type | Description |
---|---|
Optional[BucketAuth]
|
A custom bucket name |
Source code in dapla_team_cli/tf/iam_bindings/buckets.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|