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

acl: JWT as SSO auth method #15897

Merged
merged 9 commits into from
Mar 30, 2023
Merged

acl: JWT as SSO auth method #15897

merged 9 commits into from
Mar 30, 2023

Conversation

pkazmierczak
Copy link
Contributor

@pkazmierczak pkazmierczak commented Jan 26, 2023

This PR introduces a new ACL Auth Method: JWT, which allows users to exchange 3rd party JSON Web Tokens for Nomad ACL Tokens. We achieve this by:

  • extending ACLAuthMethodConfig fields with JWT-specific properties
  • a new RPC endpoint ACL.Login
  • a new HTTP API endpoint /v1/acl/login
  • adjustments to the CLI that allow for new -type=JWT when creating and updating auth methods, and to the nomad login command
  • and adjustments to the sign in UI which now detects if there are JWT auth methods present, whether they are multiple and modifies the "sign in with token" field accordingly.

All the changes mentioned above were described in NMD-167, and all the commits in this pull request (except for changelog) were previously reviewed.

@pkazmierczak pkazmierczak force-pushed the f-sso-jwt-auth-method branch from dc70538 to 519c746 Compare March 16, 2023 14:01
@pkazmierczak pkazmierczak force-pushed the f-sso-jwt-auth-method branch from 5edd5d4 to f4c7b09 Compare March 17, 2023 18:25
@pkazmierczak pkazmierczak force-pushed the f-sso-jwt-auth-method branch from e76b325 to b526bac Compare March 23, 2023 13:18
@github-actions
Copy link

github-actions bot commented Mar 29, 2023

Ember Asset Size action

As of 696d4d4

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +3.42 kB +677 B
nomad-ui.css +81 B -28 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.js 0 B 0 B
vendor.css 0 B 0 B

@github-actions
Copy link

github-actions bot commented Mar 29, 2023

Ember Test Audit comparison

main 696d4d4 change
passes 1485 1489 +4
failures 0 0 0
flaky 0 0 0
duration 11m 26s 876ms 12m 36s 984ms +1m 10s 108ms

@pkazmierczak pkazmierczak marked this pull request as ready for review March 30, 2023 07:08
@pkazmierczak pkazmierczak self-assigned this Mar 30, 2023
@pkazmierczak pkazmierczak added backport/1.5.x backport to 1.5.x release line theme/auth labels Mar 30, 2023
pkazmierczak and others added 3 commits March 30, 2023 09:40
* Bones of JWT detection

* JWT to token pipeline complete

* Some live-demo fixes for template language

* findSelf and loginJWT funcs made async

* Acceptance tests and mirage mocks for JWT login

* [ui] Allow for multiple JWT auth methods in the UI (#16665)

* Split selectable jwt methods

* repositions the dropdown to be next to the input field
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM!

// Measure the OIDC endpoint performance.
defer metrics.MeasureSince([]string{"nomad", "acl", "jwt", "oidc_jwt"}, time.Now())

// TODO why do we have DiscoverCaPem as an array but JWKSCaPem as a single string?
Copy link
Member

Choose a reason for hiding this comment

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

Just a quick check that this TODO is ok to leave before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, this is "a note for future us." Something we'll definitely revisit.

defer metrics.MeasureSince([]string{"nomad", "acl", "login"}, time.Now())

// This endpoint can only be used once all servers in all federated regions
// have been upgraded to 1.5.2 or greater, since JWT Auth method was
Copy link
Member

Choose a reason for hiding this comment

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

Should this read 1.5.3? Or should we just remove the specific version here and let that live in the minACLJWTAuthMethodVersion constant so we don't need to update it if we have to ship a security update or whatever before this goes out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, I'll adjust.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See 696d4d4 for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.5.x backport to 1.5.x release line theme/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants