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

Enable workload identity for event stream #24849

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

mismithhisler
Copy link
Member

@mismithhisler mismithhisler commented Jan 13, 2025

Description

Enables Workload Identities to subscribe to event streams. Previously, the event broker used custom authentication logic that could only accept the secretID from an ACL Token. This change refactors the event broker to use an authentication callback for handling authentication while subscribing and after various ACL events. This allows us to inject the standardized Authenticator logic into the event broker.

Testing & Reproduction steps

Enable ACL's, create the appropriate policy, associate it with a workload, and use the WI as the Bearer token when subscribing to the events stream.

Links

Fixes GH #18186

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

@mismithhisler mismithhisler added backport/ent/1.7.x+ent Changes are backported to 1.7.x+ent backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.9.x backport to 1.9.x release line labels Jan 13, 2025
@mismithhisler mismithhisler self-assigned this Jan 13, 2025
@mismithhisler mismithhisler requested a review from jrasell January 13, 2025 20:40
@mismithhisler mismithhisler marked this pull request as ready for review January 13, 2025 20:40
@mismithhisler mismithhisler requested review from a team as code owners January 13, 2025 20:40
Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @mismithhisler!

I think the PR still needs a changelog entry and I added a couple of inline queries, so I'll comment as my approval will likely get removed with at least the changelog commit.

nomad/event_endpoint.go Outdated Show resolved Hide resolved
nomad/event_endpoint.go Show resolved Hide resolved
nomad/event_endpoint.go Show resolved Hide resolved
@mismithhisler mismithhisler merged commit 5befea6 into main Jan 23, 2025
30 checks passed
@mismithhisler mismithhisler deleted the f-enable-workload-identity-for-event-stream branch January 23, 2025 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/ent/1.7.x+ent Changes are backported to 1.7.x+ent backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.9.x backport to 1.9.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NOMAD_TOKEN provided by workload identity is not accepted in the events API endpoint.
3 participants