Skip to content
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

feat: Add support for authentication credentials in ProviderConfig #63

Conversation

arielsepton
Copy link
Member

PR Description: Add Authentication Credentials Support in ProviderConfig

Summary

This PR enhances the ProviderConfig by adding support for authentication credentials via a Kubernetes Secret reference. This feature allows users to securely manage the Authorization header for all requests made with this configuration.

Changes

  • Added support in a secretRef field to reference a Kubernetes Secret containing the authentication token, which will be automatically included in the Authorization header for all requests.

Example Usage

apiVersion: http.crossplane.io/v1alpha1
kind: ProviderConfig
metadata:
  name: http-conf
spec:
  credentials:
    source: Secret
    # The value of this secret will be used to set the "Authorization" header for all requests made with this config.
    # It will be added as: "Authorization": "<secret-value>".
    secretRef:
      namespace: crossplane-system
      name: http-provider-secret
      key: token

Notes

This change is backward-compatible; existing configurations remain unaffected.
Fixes #53

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

Signed-off-by: Ariel Septon <arielsepton@Ariels-MBP.lan>
@arielsepton arielsepton merged commit 0702bc5 into crossplane-contrib:main Oct 2, 2024
7 checks passed
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.

feat request: use secret value from provider config's secret ref to authorize requests
1 participant