Skip to content

Commit 16e25aa

Browse files
s3-coverage-expansion (#602)
Summary: - Coverage of `aws.s3.bucket_abac` plus integration test. - Added regression test `AWS S3 Bucket ABAC Works`. - Dependent repositories will not yet be forced to use containerised mocks.
1 parent b12782a commit 16e25aa

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

test/python/stackql_test_tooling/web_service_keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ def create_digitalocean_web_service(
345345

346346
@keyword
347347
def start_all_webservers(self, port_dict: Optional[dict] = None) -> None:
348-
# if system has docker installed, use that to run mock servers
349-
if os.system('which docker >/dev/null 2>&1') == 0:
348+
# if system has docker installed and also has docker compose file, use that to run mock servers
349+
if os.system('which docker >/dev/null 2>&1') == 0 and os.path.exists('docker-compose-testing.yml'):
350350
## inherits env vars from parent process so IS_DOCKER env var is passed along
351351
rv = os.system('docker compose -f docker-compose-testing.yml up -d --build --force-recreate')
352352
if rv != 0:

test/registry/src/aws/v0.1.0/services/s3.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,17 +4423,25 @@ paths:
44234423
responses:
44244424
'200':
44254425
description: Success
4426-
/{Bucket}?abac:
4426+
/?abac:
4427+
servers:
4428+
- url: 'https://{Bucket}.s3-{region}.amazonaws.com'
4429+
variables:
4430+
Bucket:
4431+
default: stackql-trial-bucket-02
4432+
region:
4433+
default: us-east-1
44274434
get:
44284435
operationId: GetBucketAbac
44294436
description: |-
44304437
Returns the attribute-based access control (ABAC) property of the general purpose bucket. If ABAC is enabled on your bucket, you can use tags on the bucket for access control. For more information, see [Enabling ABAC in general purpose buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/buckets-tagging-enable-abac.html).
44314438
parameters:
4432-
- name: Bucket
4433-
in: path
4434-
required: true
4439+
- name: x-amz-content-sha256
4440+
in: header
4441+
required: false
44354442
schema:
4436-
$ref: '#/components/schemas/BucketName'
4443+
type: string
4444+
default: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
44374445
- name: x-amz-expected-bucket-owner
44384446
in: header
44394447
required: false
@@ -4451,11 +4459,6 @@ paths:
44514459
description: |-
44524460
Sets the attribute-based access control (ABAC) property of the general purpose bucket. You must have `s3:PutBucketABAC` permission to perform this action. When you enable ABAC, you can use tags for access control on your buckets. Additionally, when ABAC is enabled, you must use the [TagResource](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_TagResource.html) and [UntagResource](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_UntagResource.html) actions to manage tags on your buckets. You can nolonger use the [PutBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) and [DeleteBucketTagging](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) actions to tag your bucket. For more information, see [Enabling ABAC in general purpose buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/buckets-tagging-enable-abac.html).
44534461
parameters:
4454-
- name: Bucket
4455-
in: path
4456-
required: true
4457-
schema:
4458-
$ref: '#/components/schemas/BucketName'
44594462
- name: Content-MD5
44604463
in: header
44614464
required: false
@@ -22116,13 +22119,13 @@ components:
2211622119
methods:
2211722120
get_bucket_abac:
2211822121
operation:
22119-
$ref: '#/paths/~1{Bucket}?abac/get'
22122+
$ref: '#/paths/~1?abac/get'
2212022123
response:
2212122124
mediaType: text/xml
2212222125
openAPIDocKey: '200'
2212322126
put_bucket_abac:
2212422127
operation:
22125-
$ref: '#/paths/~1{Bucket}?abac/put'
22128+
$ref: '#/paths/~1?abac/put'
2212622129
response:
2212722130
mediaType: application/json
2212822131
openAPIDocKey: '200'

test/robot/integration-traffic-lights/stackql_traffic_light_integration_from_cmd_line.robot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,19 @@ AWS S3 Bucket Objects List
5757
... stderr=${CURDIR}/tmp/AWS-S3-Bucket-Objects-List-stderr.tmp
5858
Should Be Equal As Integers ${result.rc} 0
5959
Should Contain ${result.stdout} docs/advanced
60+
61+
AWS S3 Bucket ABAC Works
62+
Sleep 2s
63+
${bucketObjectsListQuery} = Catenate
64+
... select * from aws.s3.bucket_abac where Bucket = 'stackql-trial-bucket-02' and region = 'ap-southeast-2';
65+
${result} = Run Process
66+
... ${STACKQL_EXE}
67+
... \-\-registry
68+
... { "url": "file://${REPOSITORY_ROOT}/test/registry", "localDocRoot": "${REPOSITORY_ROOT}/test/registry", "verifyConfig": { "nopVerify": true } }
69+
... exec
70+
... ${bucketObjectsListQuery}
71+
... cwd=${REPOSITORY_ROOT}
72+
... stdout=${CURDIR}/tmp/AWS-S3-Bucket-Objects-List.tmp
73+
... stderr=${CURDIR}/tmp/AWS-S3-Bucket-Objects-List-stderr.tmp
74+
Should Be Equal As Integers ${result.rc} 0
75+
Should Contain ${result.stdout} stackql\-trial\-bucket\-02

0 commit comments

Comments
 (0)