8000 feat: create wrapper client for aws config for customizable defaults by sprutton1 · Pull Request #6095 · systeminit/si · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: create wrapper client for aws config for customizable defaults #6095

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

8000
Merged
merged 1 commit into from
May 16, 2025

Conversation

sprutton1
Copy link
Contributor

Adds a wrapper for the aws_config crate so we can supply different defaults (adaptive retry, more attempts, fallback region) and so we can validate the credentials are good as soon as we create them (rather than waiting until they are first used).

@sprutton1
Copy link
Contributor Author

/try

Copy link
github-actions bot commented May 12, 2025

Okay, starting a try! I'll update this comment once it's running...\n
🚀 Try running here! 🚀

Copy link
github-actions bot commented May 12, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
cargo/clap 4.5.38 🟢 5.2
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 6/19 approved changesets -- score normalized to 3
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Binary-Artifacts🟢 10no binaries found in the repo
License🟢 10license file detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 19 existing vulnerabilities detected
cargo/clap_builder 4.5.38 🟢 5.2
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 3Found 6/19 approved changesets -- score normalized to 3
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Binary-Artifacts🟢 10no binaries found in the repo
License🟢 10license file detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Vulnerabilities⚠️ 19 existing vulnerabilities detected
cargo/libloading 0.8.7 🟢 4.4
Details
CheckScoreReason
Binary-Artifacts🟢 8binaries present in source code
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 87 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 8
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 4Found 9/21 approved changesets -- score normalized to 4
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/tempfile 3.20.0 🟢 4.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 2/29 approved changesets -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
Vulnerabilities🟢 100 existing vulnerabilities detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
cargo/trybuild 1.0.105 🟢 5.8
Details
CheckScoreReason
Code-Review⚠️ 0Found 1/23 approved changesets -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 68 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Vulnerabilities🟢 100 existing vulnerabilities detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Security-Policy🟢 3security policy file detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • Cargo.lock

@sprutton1 sprutton1 requested review from Copilot, fnichol and nickgerace and removed request for Copilot May 12, 2025 15:32
Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a custom AWS config wrapper to support configurable defaults (adaptive retry, increased attempts, fallback region) and proactive validation of credentials, and updates dependent crates to use the new wrapper.

  • Introduces the new crate si-aws-config with a custom configuration loader and caller identity validation.
  • Updates si-data-ssm, si-data-acmpca, data-warehouse-stream-client, and associated Buck and Cargo files to remove direct aws_config usage in favor of si-aws-config.
  • Adjusts error handling in client constructors across multiple modules to propagate errors from the new wrapper.

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
third-party/rust/Cargo.toml Added aws-sdk-sts dependency with specified features.
lib/si-data-ssm/src/lib.rs Updated SSM client initialization to use si-aws-config and proper error propagation.
lib/si-data-ssm/Cargo.toml Replaced direct aws-config dependency with si-aws-config.
lib/si-data-ssm/BUCK Updated Buck dependency reference from aws-config to si-aws-config.
lib/si-data-acmpca/src/lib.rs Updated ACM PCA client error handling to use si-aws-config and propagate errors.
lib/si-data-acmpca/Cargo.toml Replaced direct aws-config dependency with si-aws-config.
lib/si-data-acmpca/BUCK Updated Buck dependency reference to use si-aws-config.
lib/si-aws-config/src/lib.rs New implementation of the AWS config wrapper with adaptive retry, fallback region, and immediate credential validation.
lib/si-aws-config/Cargo.toml New Cargo configuration for the si-aws-config crate.
lib/si-aws-config/BUCK Buck build file for the new si-aws-config crate.
lib/innit-server/src/server.rs Updated usage of ParameterStoreClient and PrivateCertManagerClient to propagate errors.
lib/innit-client/src/lib.rs Updated certificate generation to use the new error propagation style.
lib/forklift-server/src/server/app/billing_events.rs Adjusted DataWarehouseStreamClient initialization to propagate errors properly.
lib/data-warehouse-stream-client/src/lib.rs Updated Firehose client initialization to use si-aws-config with error propagation.
lib/data-warehouse-stream-client/Cargo.toml Replaced direct aws-config dependency with si-aws-config.
lib/data-warehouse-stream-client/BUCK Updated Buck dependency reference to use si-aws-config.
dev/Tiltfile Added auto_init flag to resource configuration.
Cargo.toml Added si-aws-config to workspace members and updated dependency versions.
Comments suppressed due to low confidence (2)

lib/si-data-ssm/src/lib.rs:52

  • [nitpick] The error message contains duplicate wording ('Error error'). Consider revising it to 'AWS Config Error: {0}' for clarity.
    #[error("AWS Config Error error: {0}")]

lib/si-data-acmpca/src/lib.rs:71

  • [nitpick] The error message contains redundant wording ('Error error'). Consider revising it to 'AWS Config Error: {0}' for improved clarity.
    #[error("AWS Config Error error: {0}")]

@sprutton1 sprutton1 enabled auto-merge May 15, 2025 16:12
fnichol
fnichol previously approved these changes May 15, 2025
Copy link
Contributor
@fnichol fnichol left a comment

Choose a reason for hiding this comment

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

Nice work!

let sts = aws_sdk_sts::Client::new(&config);
let ident = sts
.get_caller_identity()
.send()
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this default behavior before? Because I like that we can roughly confirm our identity this way!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the default behavior is to gather credentials from various places in the environment and then carry on. It makes no effort to validate the creds until the first API call made using them. Here we'll at least test them on startup.

@sprutton1 sprutton1 added this pull request to the merge queue May 15, 2025
@github-merge-queue < 8000 a class="author Link--primary text-bold" data-test-selector="pr-timeline-events-actor-profile-link" href="/apps/github-merge-queue">github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 15, 2025
@sprutton1 sprutton1 added this pull request to the merge queue May 15, 2025
@sprutton1 sprutton1 removed this pull request from the merge queue due to a manual request May 15, 2025
@sprutton1 sprutton1 added this pull request to the merge queue May 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 16, 2025
@sprutton1 sprutton1 force-pushed the scott/aws-config-with-retry branch from 6017cf0 to 814e205 Compare May 16, 2025 13:27
@sprutton1 sprutton1 enabled auto-merge May 16, 2025 13:27
@johnrwatson johnrwatson self-requested a review May 16, 2025 13:33
@sprutton1 sprutton1 added this pull request to the merge queue May 16, 2025
Merged via the queue into main with commit f06ce15 May 16, 2025
10 checks passed
@sprutton1 sprutton1 deleted the scott/aws-config-with-retry branch May 16, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0