Custom authorization header for http backend is dropped #1656
Labels
bug
Something isn't working
pending-decision
This issue has not been accepted for implementation nor rejected. It's still open to discussion.
OpenTofu Version
OpenTofu Configuration Files
Debug Output
Initializing the backend...
2024-05-18T13:34:23.144-0500 [TRACE] Meta.Backend: built configuration for "http" backend with hash value 3930140512
2024-05-18T13:34:23.144-0500 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2024-05-18T13:34:23.144-0500 [DEBUG] New state was assigned lineage "8ef6b437-6995-5c21-7e6b-c8bed03ddc5c"
2024-05-18T13:34:23.144-0500 [TRACE] Meta.Backend: moving from default local state only to "http" backend
2024-05-18T13:34:23.144-0500 [DEBUG] checking for provisioner in "."
2024-05-18T13:34:23.145-0500 [DEBUG] checking for provisioner in "/opt/homebrew/bin"
2024-05-18T13:34:23.145-0500 [TRACE] backend/local: state manager for workspace "default" will:
2024-05-18T13:34:23.145-0500 [TRACE] statemgr.Filesystem: reading initial snapshot from terraform.tfstate
2024-05-18T13:34:23.145-0500 [TRACE] statemgr.Filesystem: snapshot file has nil snapshot, but that's okay
2024-05-18T13:34:23.145-0500 [TRACE] statemgr.Filesystem: read nil snapshot
2024-05-18T13:34:23.145-0500 [TRACE] Meta.Backend: ignoring local "default" workspace because its state is empty
2024-05-18T13:34:23.148-0500 [DEBUG] New state was assigned lineage "bb51cbaf-bd80-b95a-b781-5494d3af9f53"
2024-05-18T13:34:23.148-0500 [TRACE] Preserving existing state lineage "bb51cbaf-bd80-b95a-b781-5494d3af9f53"
Successfully configured the backend "http"! OpenTofu will automatically
use this backend unless the backend configuration changes.
2024-05-18T13:34:23.152-0500 [TRACE] Meta.Backend: instantiated backend of type *http.Backend
2024-05-18T13:34:23.152-0500 [DEBUG] checking for provisioner in "."
2024-05-18T13:34:23.152-0500 [DEBUG] checking for provisioner in "/opt/homebrew/bin"
2024-05-18T13:34:23.153-0500 [TRACE] Meta.Backend: backend *http.Backend does not support operations, so wrapping it in a local backend
2024-05-18T13:34:23.153-0500 [DEBUG] GET http://localhost:8000/
Error refreshing state: HTTP remote state endpoint invalid auth
Expected Behavior
On my server I printed the headers attached to the HTTP request and got the following:
Actual Behavior
I expect the authorization header to be contained in the list of headers. It looks like any other header works besides the
authorization
oneSteps to Reproduce
tofu init
Additional Context
I believe this is because of this line here: https://github.com/bunniseng/opentofu/blob/main/internal/backend/remote-state/http/backend.go#L261
which doesn't fall through to the default case
References
No response
The text was updated successfully, but these errors were encountered: