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

feat: enable reusable credentials for S3 integration #248

Merged

Conversation

yurimssilva
Copy link
Contributor

@yurimssilva yurimssilva commented Mar 1, 2024

What this PR changes/adds

  • Introduces the objectName property to store the S3 object name
  • Refactors keyName to exclusively handle secret aliases
  • Renames keyPrefix to objectPrefix
  • Destination object(s) naming decision based on Part list size.
  • Updates documentation
  • Updates tests

Why it does that

To align with the existing behavior of TransferProcessManagerImpl, which defaults to using keyName for fetching secret values, rather than introducing a new property configuration specifically for holding the secret alias, a more effective approach would be to introduce an objectName property to store the S3 object name. This modification aims to enhance consistency and also alignment between the AWS and Azure platforms.

Linked Issue(s)

Closes #211

@yurimssilva yurimssilva self-assigned this Mar 1, 2024
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch 2 times, most recently from 2a16e90 to 08140ca Compare March 1, 2024 11:32
@yurimssilva yurimssilva added the enhancement New feature or request label Mar 1, 2024
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch from 08140ca to 4b0a7d1 Compare March 1, 2024 11:36
@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 80.72289% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 65.12%. Comparing base (d177a98) to head (3010144).
Report is 24 commits behind head on main.

Files Patch % Lines
...e/edc/connector/dataplane/aws/s3/S3DataSource.java 63.63% 6 Missing and 2 partials ⚠️
...ws/s3/validation/S3SourceDataAddressValidator.java 86.66% 0 Missing and 2 partials ⚠️
...pse/edc/connector/dataplane/aws/s3/S3DataSink.java 66.66% 1 Missing and 1 partial ⚠️
.../connector/dataplane/aws/s3/S3DataSinkFactory.java 88.88% 0 Missing and 2 partials ⚠️
...onnector/dataplane/aws/s3/S3DataSourceFactory.java 87.50% 0 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #248      +/-   ##
==========================================
+ Coverage   63.82%   65.12%   +1.30%     
==========================================
  Files          26       28       +2     
  Lines         633      671      +38     
  Branches       30       32       +2     
==========================================
+ Hits          404      437      +33     
+ Misses        222      220       -2     
- Partials        7       14       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch 3 times, most recently from a53dec0 to 03612d4 Compare March 4, 2024 15:57
- Introduces the "objectName" property to store the S3 object name
- Refactors "keyName" to exclusively handle secret aliases
- Renames "keyPrefix" to "objectPrefix"
- Utilizes Part list size for naming of destination objects
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch from 03612d4 to bbb2b1c Compare March 4, 2024 16:00
Copy link

This pull request is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Mar 12, 2024
…into feat/reusable_credentials_new_proposal

# Conflicts:
#	DEPENDENCIES
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch from 61d8d5b to 7910ff0 Compare March 18, 2024 10:00
@github-actions github-actions bot removed the stale label Mar 19, 2024
Copy link

Choose a reason for hiding this comment

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

@yurimssilva generally lgtm. I would be a bit more specific on the examples, providing an example for the use of keys via the vault and the use of the not-recommended clear-text credentials. Probably both examples right below the respective method of using the credentials.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @gerbigf . New examples have been added to the documentation.

@yurimssilva yurimssilva requested review from gerbigf, wolf4ood and ndr-brt and removed request for gerbigf March 20, 2024 21:50
@yurimssilva yurimssilva marked this pull request as ready for review March 20, 2024 21:51
@yurimssilva yurimssilva requested a review from ndr-brt March 21, 2024 16:34
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch 2 times, most recently from 5ad02aa to 8619651 Compare March 22, 2024 01:03
- variable renaming
- doc adjustments
- property deprecation
- validation for new attributes
…into feat/reusable_credentials_new_proposal

# Conflicts:
#	extensions/control-plane/provision/provision-aws-s3/src/test/java/org/eclipse/edc/connector/provision/aws/s3/S3ConsumerResourceDefinitionGeneratorTest.java
@yurimssilva yurimssilva force-pushed the feat/reusable_credentials_new_proposal branch from 8619651 to 7de30dd Compare March 22, 2024 02:12
}
});

if (Stream.of(OBJECT_NAME, KEY_NAME, OBJECT_PREFIX, KEY_PREFIX)
Copy link
Member

Choose a reason for hiding this comment

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

given that KEY_NAME and KEY_PREFIX have been deprecated, I would avoid checking them, given that this validator is triggered on asset create/update

Copy link
Contributor Author

@yurimssilva yurimssilva Mar 26, 2024

Choose a reason for hiding this comment

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

The idea was to include them to be compatible with assets already stored in previous versions, as the validation is also run at DataSource creation, and then remove them after the deprecation period.

- tests adjustments
- unnecessary code removed
- source creation methods simplified
@yurimssilva yurimssilva requested a review from ndr-brt March 26, 2024 18:04
@ndr-brt ndr-brt merged commit 86bdec8 into eclipse-edc:main Mar 27, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Reusable Credentials
4 participants