feat: support S3 data connections on non-AWS providers using temp credentials#844
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 5685611 | Triggered | Generic High Entropy Secret | 5cbe99f | tests/streaming/test_resolver.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #844 +/- ##
===================================
Coverage 81% 81%
===================================
Files 54 54
Lines 7671 7683 +12
===================================
+ Hits 6198 6210 +12
Misses 1473 1473 🚀 New features to boost your workflow:
|
Before submitting
What does this PR do?
Enables S3 data connections marked available on non-AWS providers to be resolved and accessed directly (bypassing the FUSE mount) from non-AWS Studios (GCP, Nebius, etc.), by minting temporary project-role credentials — mirroring the existing R2 /
lightning_storageflow.Previously
_resolve_s3_connectionsreturned aDirwithout adata_connection_id, so thes3://path fell back to ambient AWS credentials (instance profile / shared credentials file). Off AWS there are none, soS3Client._create_clientcrashed:Changes
streaming/resolver.py:_resolve_s3_connectionsnow threadsdata_connection_idthrough when the connection hasavailable_in_non_aws_providersset (parallel to_resolve_lightning_storage). AWS-only connections leave it unset and keep using ambient credentials.streaming/client.py: extracted the shared token-login +temp-bucket-credentialsfetch into_login_and_get_temp_bucket_credentials, reused by both R2 and S3.S3Clientnow mints temporary project-role credentials when adata_connection_idis present (real AWS S3 — no custom endpoint). This covers both the read (S3Downloader) and write (S3FsProvider) paths, since both share thes3://scheme andS3Client.refetch_intervalmechanism.Note
Requires the
lightning_sdkV1AwsDataConnectionmodel to exposeavailable_in_non_aws_providers(added separately in the SDK). Without it the field is dropped on deserialize and the connection continues to use ambient credentials.PR review
Anyone in the community is free to review the PR once the tests have passed.
Did you have fun?
🙃
Made with Cursor