Skip to content

TFVP-Initial-Implementation-Sys-Backend-headers#2842

Open
itsjiyapatel wants to merge 9 commits intomainfrom
VAULT-43336-TFVP-Initial-Implementation-Sys-Backend-headers
Open

TFVP-Initial-Implementation-Sys-Backend-headers#2842
itsjiyapatel wants to merge 9 commits intomainfrom
VAULT-43336-TFVP-Initial-Implementation-Sys-Backend-headers

Conversation

@itsjiyapatel
Copy link
Copy Markdown
Contributor

@itsjiyapatel itsjiyapatel commented Mar 24, 2026

Description

Implements a new Terraform resource vault_config_ui_header for managing custom HTTP headers in the Vault UI. This provides a type-safe, user-friendly alternative to using vault_generic_endpoint for configuring security headers, CORS policies, and custom organizational headers.

Resource: vault_config_ui_header at internal/vault/sys/config/ui_header.go

  • Full CRUD operations with proper error handling
  • Vault 1.16.0+ version checking
  • Sudo capability requirement with helpful error messages
  • API asymmetry handling using multivalue=true parameter
  • Import support and Enterprise namespace support
  • RequiresReplace plan modifier on name field

Checklist

  • Added CHANGELOG entry (only for user-facing changes)
  • Acceptance tests where run against all supported Vault Versions

Output from acceptance testing:

$ go test -v -count=1 -run TestAccConfigUIHeader ./internal/vault/sys/config

=== RUN   TestAccConfigUIHeader
    ui_header_test.go:29: Vault server version "1.22.0-beta1+ent"
--- PASS: TestAccConfigUIHeader (0.85s)
=== RUN   TestAccConfigUIHeader_update
    ui_header_test.go:60: Vault server version "1.22.0-beta1+ent"
--- PASS: TestAccConfigUIHeader_update (1.73s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/internal/vault/sys/config 3.047s
...

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

PCI review checklist

  • I have documented a clear reason for, and description of, the change I am making.

  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.

  • If applicable, I've documented the impact of any changes to security controls.

    Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.

@itsjiyapatel itsjiyapatel marked this pull request as ready for review March 25, 2026 04:58
@itsjiyapatel itsjiyapatel requested review from a team as code owners March 25, 2026 04:58
@itsjiyapatel itsjiyapatel requested a review from claudiac-m March 25, 2026 04:58
Comment thread internal/vault/sys/config/ui_header.go Outdated
stringplanmodifier.RequiresReplace(),
},
},
consts.FieldValues: schema.ListAttribute{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can switch this to Set attribute type which would help ignore duplicates.

Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go
itsjiyapatel and others added 3 commits March 26, 2026 09:52
Added references to pull requests for new resource and improvements.
…ders' of github.com:hashicorp/terraform-provider-vault into VAULT-43336-TFVP-Initial-Implementation-Sys-Backend-headers
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread website/docs/r/config_ui_header.html.md Outdated
Comment thread website/docs/r/config_ui_header.html.md Outdated
Comment thread website/docs/r/config_ui_header.html.md Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go
Comment thread website/docs/r/config_ui_header.html.md
Comment thread website/docs/r/config_ui_header.html.md
@itsjiyapatel itsjiyapatel force-pushed the VAULT-43336-TFVP-Initial-Implementation-Sys-Backend-headers branch from fb1ff78 to 373beae Compare April 1, 2026 11:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Terraform Plugin Framework resource to manage Vault UI response headers via sys/config/ui/headers, providing a dedicated alternative to vault_generic_endpoint for security/CORS/custom headers.

Changes:

  • Introduces vault_config_ui_header resource with CRUD, import-by-name, and Vault version gating.
  • Registers the new resource in the framework provider and adds shared constant FieldValues.
  • Adds website documentation, acceptance tests, and a CHANGELOG entry.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
website/docs/r/config_ui_header.html.md New resource documentation and examples for UI headers
internal/vault/sys/config/ui_header.go New TF Plugin Framework resource implementation for UI header CRUD/import
internal/vault/sys/config/ui_header_test.go Acceptance tests for create/update/import behavior
internal/provider/fwprovider/provider.go Registers the new resource with the framework provider
internal/consts/consts.go Adds FieldValues constant used by the new resource/tests
CHANGELOG.md Adds an Unreleased FEATURES entry for the new resource

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread website/docs/r/config_ui_header.html.md Outdated
Comment thread website/docs/r/config_ui_header.html.md Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Copy link
Copy Markdown
Contributor

@harshit-nema harshit-nema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review comments provided for sys backend headers.

Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header_test.go Outdated
Comment thread internal/vault/sys/config/ui_header.go Outdated
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go
Comment thread internal/vault/sys/config/ui_header.go
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.

4 participants