Skip to content

Conversation

cbcoutinho
Copy link

@cbcoutinho cbcoutinho commented Sep 21, 2025

Motivation

This PR adds support for various auth implementations to the HTTP Template.

Previously, HTTP authentication implementations were duplicated between HTTP templates and input/output artifacts, leading to code duplication and potential inconsistencies. This change consolidates the authentication logic into a shared module to improve maintainability and ensure consistent behavior across all HTTP operations.

Modifications

  • Created new workflow/common/http_auth.go module with unified HTTP authentication functions
  • Added ApplyHTTPAuth() function to apply authentication to HTTP requests
  • Added CreateHTTPClientWithAuth() function to create authenticated HTTP clients
  • Implemented support for Basic Auth, Client Certificate Auth, and OAuth2 authentication methods
  • Updated workflow/artifacts/http/http.go to use the new unified authentication functions
  • Updated workflow/executor/agent.go to leverage the shared authentication module
  • Enhanced pkg/apis/workflow/v1alpha1/http_types.go with additional auth configuration fields

Verification

  • Existing HTTP template and artifact authentication functionality preserved
  • All authentication methods (Basic Auth, Client Cert, OAuth2) work consistently across both use cases
  • No breaking changes to existing API or configuration

Documentation

No documentation changes required as this is an internal refactoring that maintains existing API compatibility. The unified authentication approach is transparent to users and doesn't change how authentication is configured.

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.

1 participant