Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix s3_datasets and s3_datasets_shares tests #1325

Merged
merged 4 commits into from
Jun 11, 2024
Merged

Fix s3_datasets and s3_datasets_shares tests #1325

merged 4 commits into from
Jun 11, 2024

Conversation

dlpzx
Copy link
Contributor

@dlpzx dlpzx commented Jun 10, 2024

Feature or Bugfix

  • Bugfix

Detail

With the refactoring of the datasets and the datasets_sharing tests were not being executed. In this PR the corresponding tests packages are renamed and the tests inside are fixed with the latest changes in main.

There are still things to improve, for example we can simplify the conftests of the s3_datasets and the s3_datasets_shars modules; but I am going to leave it for a next PR

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)?
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization?
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features?
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dlpzx dlpzx force-pushed the feat/shares-tests branch from a41946f to 0fed0b1 Compare June 10, 2024 16:01
@dlpzx dlpzx requested review from noah-paige June 10, 2024 16:03
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in conftest there is def share_item_folder which includes defining ShareObjectItem(...) with parameter S3AccessPointName which no longer exists

This fixture is not used anywhere in the tests and all tests pass but I imagine this is part of the improvements to conftests to come later

@@ -192,6 +192,7 @@ def check_target_role_access_policy(self) -> None:
version_id, policy_document = IAM.get_managed_policy_default_version(
self.target_environment.AwsAccountId, self.target_environment.region, share_resource_policy_name
)
logger.info(f'Policy... {policy_document}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is this leftover form debugging or want to keep for logging?

Copy link
Contributor

@noah-paige noah-paige left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests all passing and refactored changes lgtm

@dlpzx dlpzx merged commit a49935f into main Jun 11, 2024
9 checks passed
@dlpzx dlpzx deleted the feat/shares-tests branch June 19, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants