Skip to content

consul: include Nomad node ID in Consul token login metadata#28133

Open
emmayusufu wants to merge 1 commit into
hashicorp:mainfrom
emmayusufu:feat/consul-token-node-id
Open

consul: include Nomad node ID in Consul token login metadata#28133
emmayusufu wants to merge 1 commit into
hashicorp:mainfrom
emmayusufu:feat/consul-token-node-id

Conversation

@emmayusufu

Copy link
Copy Markdown

Consul tokens issued by Nomad via workload identity login carry a requested_by meta value (for example nomad_task_<name>), but nothing identifies which Nomad client issued the token. This adds the issuing client's node ID to the login request metadata, so a token can be traced back to the node that created it.

As @jrasell noted on the issue, the token created via login prefix in the description is controlled by Consul, not Nomad, so the node ID goes into the meta (the part Nomad controls). The description then reads:

token created via login: {"node_id":"<node-id>","requested_by":"nomad_task_<name>"}

Changes:

  • Add node_id (from alloc.NodeID) to the Consul JWT login meta for both task and service tokens.
  • Record login requests in the test Consul mock and assert the node ID is passed through.
  • Changelog entry.

Fixes #28048

@emmayusufu emmayusufu requested review from a team as code owners June 16, 2026 10:55
Tokens issued via workload identity login now include the issuing client's node ID in the login meta, so a token can be traced back to the node that created it.
@emmayusufu emmayusufu force-pushed the feat/consul-token-node-id branch from 4bdd5d9 to 5ac09f2 Compare June 16, 2026 10:55
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Improve description of Consul tokens to include client information

2 participants