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

Feature Request: HTTP Request Headers #53

Open
mikeroll opened this issue Apr 12, 2023 · 1 comment · Fixed by rfd59/terraform-provider-rabbitmq#27
Open

Feature Request: HTTP Request Headers #53

mikeroll opened this issue Apr 12, 2023 · 1 comment · Fixed by rfd59/terraform-provider-rabbitmq#27

Comments

@mikeroll
Copy link

I would love to be able to configure the provider to send specific headers with each API request. Theoretically something along these lines:

provider "rabbitmq" {
  endpoint = ...
  username = ...
  password = ...

  request_header {
    name = "X-Client-Id"
    value = "id"
  }

  request_header {
    name = "X-Client-Secret"
    value = "secret"
  }
}

My use case is a RabbitMQ instance secured with Cloudflare Access. The short story is that it adds an extra authentication layer in front of a web endpoint; completing the auth flow for non-interactive access (such as by a Terraform provider) results in obtaining a session token; the token value is then to be sent along with each request to the protected service.
Many other "ZTA" or "Delegated SSO" solutions employ the same approach so I believe supporting arbitrary headers would enable or simplify the usage of the provider in such environments.

Would you be up for including this functionality? If so I could take a stab at implementing it - from what I understand this is mostly about extending the configuration interface + probably adjusting the RoundTripper to plug the headers everywhere.

@rfavreau
Copy link

rfavreau commented Dec 6, 2024

@mikeroll @thomasLeclaire

This feature is available into rfd59/rabbitmq provider.

terraform {
  required_providers {
    rabbitmq = {
      source = "rfd59/rabbitmq"
      version = "2.3.0"
    }
  }
}

provider "rabbitmq" {
  endpoint = "http://127.0.0.1:15672"
  username = "guest"
  password = "guest"

  headers = {
    "X-Client-Id" = "id",
    "X-Client-Secret" = "secret"
  }
}

Thanks to @Dbzman

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 a pull request may close this issue.

2 participants