Skip to content

Conversation

@rrajagopalan-equinix
Copy link
Contributor

@rrajagopalan-equinix rrajagopalan-equinix commented Jun 17, 2025

This pull request introduces support for Workload Identity Federation (WIF) using Equinix STS, along with updates to documentation, provider configuration, and acceptance testing. The changes enable authentication via OIDC tokens, enhance the Equinix Terraform provider, and improve testing capabilities.

Workload Identity Federation (WIF) Support:

  • docs/guides/sts_wif_setup.md: Added a comprehensive guide for setting up Workload Identity Federation using Equinix STS, including steps for obtaining authentication tokens, establishing trust with an identity provider, and authorizing workloads.
  • docs/index.md: Updated documentation to include details about using Workload Identity Tokens for authentication with Equinix Fabric, including alpha feature limitations and configuration examples. [1] [2] [3]
  • examples/example_4.tf: Added an example Terraform configuration demonstrating the use of Workload Identity Federation with sts_auth_scope and sts_source_token.

Provider Enhancements:

  • equinix/provider.go: Added new provider arguments (sts_auth_scope, sts_endpoint, sts_source_token) for configuring STS authentication. Updated the configureProvider function to support STS-based authentication. [1] [2]
  • internal/config/config.go: Introduced STS-related environment variables and default values. Enhanced the Config struct and authentication logic to support STS tokens. Refactored client creation methods for improved modularity. [1] [2] [3] [4] [5] [6] [7] [8]

Acceptance Testing Improvements:

  • internal/acceptance/acceptance.go: Updated acceptance testing utilities to include checks for STS authentication credentials. Enhanced pre-check methods to validate STS setup alongside existing authentication mechanisms. [1] [2] [3] [4]

Dependency Updates:

  • go.mod: Upgraded github.com/equinix/equinix-sdk-go to version v0.54.0 to support new STS features. Removed unused dependencies.

Documentation Improvements:

@codecov
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

❌ Patch coverage is 43.58974% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.14%. Comparing base (dfd8929) to head (b32d706).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/sts/context_aware_token_source.go 0.00% 58 Missing ⚠️
internal/sts/context_aware_transport.go 0.00% 32 Missing ⚠️
internal/config/config.go 54.76% 15 Missing and 4 partials ⚠️
internal/sts/config.go 0.00% 13 Missing ⚠️
internal/acceptance/acceptance.go 0.00% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #908       +/-   ##
===========================================
+ Coverage   29.30%   59.14%   +29.83%     
===========================================
  Files         242      245        +3     
  Lines       28101    28297      +196     
===========================================
+ Hits         8236    16737     +8501     
+ Misses      19715    10698     -9017     
- Partials      150      862      +712     

☔ View full report in Codecov by Sentry.
📢 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.

This comment was marked as outdated.

Replaces direct token value with environment variable name for STS source token in provider configuration and documentation. Clarifies usage and updates parameter descriptions to reflect this change.
TestAccPreCheck now checks both custom and default STS source token environment variables, allowing authentication to succeed if either is set. This improves flexibility in environment configuration.
Corrected inconsistent indentation in the error handling block of TestAccPreCheck for improved code readability and maintainability.
Refactors provider configuration, environment variables, and documentation to replace 'sts_auth_scope' and related STS fields with 'token_exchange_scope' and corresponding token exchange fields. Updates code, examples, and docs to reflect the new naming and clarify usage of token exchange subject tokens for authentication. This improves clarity and aligns terminology with current Equinix authentication features.
Replaces EQUINIX_TOKEN_EXCHANGE_SCOPE_PFCR with EQUINIX_STS_AUTH_SCOPE_PFCR in the fabric_acctest GitHub Actions workflow to use the correct secret for token exchange.
Copy link
Contributor

@ctreatma ctreatma left a comment

Choose a reason for hiding this comment

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

Looks good to me! Acceptance test workflow results demonstrate that the introduction of token exchange support has not impacted existing usage of the provider. I appreciate the introduction of multiple acceptance test jobs to exercise different provider configurations! Long-term, we should enact/adopt that pattern more broadly across the provider.

@ctreatma ctreatma merged commit d6be488 into main Oct 30, 2025
13 of 16 checks passed
@ctreatma ctreatma deleted the fabric-sts-support branch October 30, 2025 20:47
@github-actions
Copy link

This PR is included in version 4.7.0 🎉

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.

6 participants