Skip to content

Add credential_process support#695

Open
sebsto wants to merge 7 commits into
soto-project:mainfrom
sebsto:feat/add_credentials_process
Open

Add credential_process support#695
sebsto wants to merge 7 commits into
soto-project:mainfrom
sebsto:feat/add_credentials_process

Conversation

@sebsto

@sebsto sebsto commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements the credential_process configuration key from AWS shared credentials/config files (#641)
  • Executes the specified command via /bin/sh -c, parses JSON credentials from stdout, and returns either static or expiring credentials
  • Integrates with RotatingCredentialProvider for automatic credential refresh when Expiration is present
  • Supports credential_process as a source credential for role_arn assume-role chains

Changes

File Description
Package.swift Added credential-process-test-helper executable target
CredentialProcessProvider.swift New provider using Foundation.Process, error types, JSON decoding
ConfigFileLoader.swift Added credentialProcess field to structs, new SharedCredentials case, resolution logic
ConfigFileCredentialProvider.swift Handle .credentialProcess dispatch
CredentialProvider.swift Added .credentialProcess(command:) factory method
iso8601.swift Shared ISO8601 date parsing utility
credential-process-test-helper/main.swift Test binary with flags for all code paths
CredentialProcessProviderTests.swift 16 tests using Swift Testing framework

Test plan

  • swift build compiles without errors or warnings
  • swift test — all 346 XCTest + 62 Swift Testing tests pass (0 failures)
  • Test helper binary verified: swift run credential-process-test-helper outputs valid JSON
  • Verify Linux compilation via CI

Closes #641

Implement the `credential_process` configuration key from AWS shared
credentials/config files. When a profile specifies this key, the SDK
executes the command via /bin/sh -c, parses JSON credentials from stdout,
and returns either static or expiring credentials depending on the
presence of an Expiration field.

Includes a test helper binary for end-to-end testing and comprehensive
Swift Testing coverage for config parsing, process execution, and error
handling.

Closes soto-project#641

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sebsto sebsto requested review from 0xTim and adam-fowler as code owners June 6, 2026 17:22
@sebsto sebsto force-pushed the feat/add_credentials_process branch from 111dc42 to f5570bb Compare June 6, 2026 17:27
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.47107% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.29%. Comparing base (2c78153) to head (3903dc3).

Files with missing lines Patch % Lines
Sources/SotoCore/Utils/iso8601.swift 60.71% 11 Missing ⚠️
...otoCore/Credential/CredentialProcessProvider.swift 89.85% 7 Missing ⚠️
...urces/SotoCore/Credential/CredentialProvider.swift 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #695      +/-   ##
==========================================
+ Coverage   81.13%   81.29%   +0.15%     
==========================================
  Files          91       93       +2     
  Lines        6580     6665      +85     
==========================================
+ Hits         5339     5418      +79     
- Misses       1241     1247       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

sebsto and others added 4 commits June 6, 2026 19:35
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Foundation.Process is not available on iOS/tvOS/watchOS. The
credential_process feature only makes sense on platforms with a shell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Support credential_process for AWSClient

1 participant