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

[BUG] Bearer token is not working when insecure = true #152

Open
360build opened this issue Jan 23, 2024 · 1 comment
Open

[BUG] Bearer token is not working when insecure = true #152

360build opened this issue Jan 23, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@360build
Copy link

360build commented Jan 23, 2024

What is the bug?

When setting up the opensearch provider it is not possible to use a bearer token and set the flag: insecure = true

How can one reproduce the bug?

`provider "opensearch" {
url = "https://localhost:5000"

token = var.opensearch_jwt_token
token_name = "Bearer"

insecure = true
healthcheck = false
}`

Basic auth is working

What is the expected behavior?

I would expect that when setting the insecure = true the bearer token is still set as header.
When I remove the insecure flag it works.

Do you have any additional context?

Link to the code that creates the issue.

The problem is in the if else statement. When setting the insecure flag the tlsHttpClient is always used. It can never go to the tokenHttpClient

@360build 360build added bug Something isn't working untriaged labels Jan 23, 2024
@prudhvigodithi prudhvigodithi added the good first issue Good for newcomers label Feb 13, 2024
@prudhvigodithi
Copy link
Member

[Triage]
Thanks @360build, we might need another condition to execute the tokenHttpClient while applying insecure as well.
Thanks

Adding @bbarani @rblcoder @peterzhuamazon for more thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: 📦 Backlog
Development

No branches or pull requests

2 participants