Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

OAuth2 via Environment Variable #489

@rejoshed

Description

@rejoshed

What happened?

I was trying to use an injected oauth2 token in an environment variable via a vault webhook and the following ProviderConfig

apiVersion: gcp.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
  name: gcp-nexus
  namespace: crossplane-system
spec:
  projectID: infrastructure-terraform-prj
  credentials:
    source: Environment
    env:
      name: GCP_INFRA_CROSSPLANE_POC

Currently OAuth2 tokens are supported if the input credentials cannot be parsed as JSON.

Unfortunately when using the source: Environment method of providing creds, the data goes through a different logic path and doesn't know to use OAuth2 if the data cannot be JSON parsed.

How can we reproduce it?

Use a provider config like above and put a valid oauth token into the env var.

What environment did it happen in?

Crossplane version:

Latest of Each -- Will flesh out shortly.

  • Cloud provider or hardware configuration
  • Kubernetes version (use kubectl version)
  • Kubernetes distribution (e.g. Tectonic, GKE, OpenShift)
  • OS (e.g. from /etc/os-release)
  • Kernel (e.g. uname -a)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @rejoshed

        Issue actions

          OAuth2 via Environment Variable · Issue #489 · crossplane-contrib/provider-gcp