Skip to content

make "role" input optional#291

Merged
tomhjp merged 2 commits into
hashicorp:masterfrom
kdomanski:jwt-role-optional
Apr 7, 2022
Merged

make "role" input optional#291
tomhjp merged 2 commits into
hashicorp:masterfrom
kdomanski:jwt-role-optional

Conversation

@kdomanski

Copy link
Copy Markdown
Contributor

Per Vault documentation it doesn't have to be provided,
and the auth provider's "default_role" parameter is required
precisely for this case.
https://www.vaultproject.io/api/auth/jwt

@hashicorp-cla

hashicorp-cla commented Jan 27, 2022

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tvoran tvoran added the enhancement New feature or request label Jan 28, 2022

@tomhjp tomhjp left a comment

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.

Seems reasonable to me. It would be great to get a test case added to the JWT integration tests to exercise this: https://github.com/hashicorp/vault-action/blob/master/integrationTests/basic/jwt_auth.test.js

Comment thread src/auth.js
Per Vault documentation it doesn't have to be provided,
and the auth provider's "default_role" parameter is required
precisely for this case.
https://www.vaultproject.io/api/auth/jwt
@kdomanski
kdomanski force-pushed the jwt-role-optional branch from c2d70ba to 4bd5334 Compare April 7, 2022 01:45
@kdomanski

Copy link
Copy Markdown
Contributor Author

Seems reasonable to me. It would be great to get a test case added to the JWT integration tests to exercise this: https://github.com/hashicorp/vault-action/blob/master/integrationTests/basic/jwt_auth.test.js

I've amended the commit with an extra testcase.

@tomhjp tomhjp left a comment

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.

The test didn't look quite right to me - it needed the default_role to be set on the mount config, but was passing. I took a look and realised the mocks were interfering across tests (the new test was actually sending "role": "default" instead of null/empty). As it was only test code and I was in there anyway, I just pushed the fix, hope you don't mind.

Thanks for the contribution!

@tomhjp
tomhjp merged commit 2f64a97 into hashicorp:master Apr 7, 2022
@kdomanski

Copy link
Copy Markdown
Contributor Author

Thanks a lot for sorting out the tests. Pleasure to work with you.

@kdomanski

Copy link
Copy Markdown
Contributor Author

@tvoran How about releasing v2.5.0 now?

@kdomanski
kdomanski deleted the jwt-role-optional branch April 24, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants