Skip to content

Commit

Permalink
fix: update test_downscoped.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetic1728 committed Oct 21, 2021
1 parent 3400015 commit ce5366c
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions tests/test_downscoped.py
Expand Up @@ -28,39 +28,39 @@


EXPRESSION = (
"resource.name.startsWith('projects/_/buckets/example-bucket/objects/customer-a')"
u"resource.name.startsWith('projects/_/buckets/example-bucket/objects/customer-a')"
)
TITLE = "customer-a-objects"
TITLE = u"customer-a-objects"
DESCRIPTION = (
"Condition to make permissions available for objects starting with customer-a"
u"Condition to make permissions available for objects starting with customer-a"
)
AVAILABLE_RESOURCE = "//storage.googleapis.com/projects/_/buckets/example-bucket"
AVAILABLE_PERMISSIONS = ["inRole:roles/storage.objectViewer"]
AVAILABLE_RESOURCE = u"//storage.googleapis.com/projects/_/buckets/example-bucket"
AVAILABLE_PERMISSIONS = [u"inRole:roles/storage.objectViewer"]

OTHER_EXPRESSION = (
"resource.name.startsWith('projects/_/buckets/example-bucket/objects/customer-b')"
u"resource.name.startsWith('projects/_/buckets/example-bucket/objects/customer-b')"
)
OTHER_TITLE = "customer-b-objects"
OTHER_TITLE = u"customer-b-objects"
OTHER_DESCRIPTION = (
"Condition to make permissions available for objects starting with customer-b"
u"Condition to make permissions available for objects starting with customer-b"
)
OTHER_AVAILABLE_RESOURCE = "//storage.googleapis.com/projects/_/buckets/other-bucket"
OTHER_AVAILABLE_PERMISSIONS = ["inRole:roles/storage.objectCreator"]
QUOTA_PROJECT_ID = "QUOTA_PROJECT_ID"
GRANT_TYPE = "urn:ietf:params:oauth:grant-type:token-exchange"
REQUESTED_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"
TOKEN_EXCHANGE_ENDPOINT = "https://sts.googleapis.com/v1/token"
SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token"
OTHER_AVAILABLE_RESOURCE = u"//storage.googleapis.com/projects/_/buckets/other-bucket"
OTHER_AVAILABLE_PERMISSIONS = [u"inRole:roles/storage.objectCreator"]
QUOTA_PROJECT_ID = u"QUOTA_PROJECT_ID"
GRANT_TYPE = u"urn:ietf:params:oauth:grant-type:token-exchange"
REQUESTED_TOKEN_TYPE = u"urn:ietf:params:oauth:token-type:access_token"
TOKEN_EXCHANGE_ENDPOINT = u"https://sts.googleapis.com/v1/token"
SUBJECT_TOKEN_TYPE = u"urn:ietf:params:oauth:token-type:access_token"
SUCCESS_RESPONSE = {
"access_token": "ACCESS_TOKEN",
"issued_token_type": "urn:ietf:params:oauth:token-type:access_token",
"token_type": "Bearer",
"access_token": u"ACCESS_TOKEN",
"issued_token_type": u"urn:ietf:params:oauth:token-type:access_token",
"token_type": u"Bearer",
"expires_in": 3600,
}
ERROR_RESPONSE = {
"error": "invalid_grant",
"error_description": "Subject token is invalid.",
"error_uri": "https://tools.ietf.org/html/rfc6749",
"error": u"invalid_grant",
"error_description": u"Subject token is invalid.",
"error_uri": u"https://tools.ietf.org/html/rfc6749",
}
CREDENTIAL_ACCESS_BOUNDARY_JSON = {
"accessBoundary": {
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_invalid_available_permissions_value(self):
with pytest.raises(ValueError) as excinfo:
make_access_boundary_rule(
AVAILABLE_RESOURCE,
["roles/storage.objectViewer"],
[u"roles/storage.objectViewer"],
availability_condition,
)

Expand Down

0 comments on commit ce5366c

Please sign in to comment.