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

Support OIDC auth backends #398

Merged
merged 6 commits into from
May 7, 2019
Merged

Conversation

sergeytrasko
Copy link
Contributor

Adding support for OIDC auth backends.

The implementation is an extension of JWT auth backend (reusing most of the logics) + adding some required attributes.

Documentation updated with examples and description of new attributes.
Tested with local Vault 1.1.1

@sergeytrasko
Copy link
Contributor Author

Any feedback on this PR?

vault/resource_jwt_auth_backend.go Outdated Show resolved Hide resolved
vault/resource_jwt_auth_backend.go Outdated Show resolved Hide resolved
@roidelapluie
Copy link
Contributor

Do you plan to add bound_claims to the roles too?

@sergeytrasko
Copy link
Contributor Author

Our use case does not expect bound_claims usage - we are more interested in basic functionality now.
I can try to add it later to this PR or I can also submit another one later.
What do you think would be the better approach?

@roidelapluie
Copy link
Contributor

I will need that feature but do not want to force anyone to code it.

@ghost ghost added size/XL and removed size/L labels Apr 29, 2019
@sergeytrasko
Copy link
Contributor Author

Actually, not only bound_claims support was missing. I've added it together with claim_mappings and oidc_scopes

As for oidc_scopes, see also hashicorp/vault-plugin-auth-jwt#44

@roidelapluie
Copy link
Contributor

awesome!

Type: schema.TypeString,
},
},
"bound_claims": {
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if that should be plural or singular

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using plurals to be in line with Vault's documentation - https://www.vaultproject.io/api/auth/jwt/index.html

@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Apr 29, 2019
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

Hi @sergeytrasko ! I noticed this isn't compiling for me when I try to run the tests:

# github.com/terraform-providers/terraform-provider-vault/vault [github.com/terraform-providers/terraform-provider-vault/vault.test]
./resource_jwt_auth_backend.go:27:19: undefined: jwtAuthType

@@ -29,6 +28,15 @@ func jwtAuthBackendResource() *schema.Resource {
ValidateFunc: validateNoTrailingSlash,
},

"type": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be role_type to correspond with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure... This type belongs to auth backend not to a role.

vault/resource_jwt_auth_backend_role.go Outdated Show resolved Hide resolved
@sergeytrasko
Copy link
Contributor Author

Fixed compilation issue - it was result of incorrect merge from master.

@roidelapluie
Copy link
Contributor

Awesome

@sergeytrasko
Copy link
Contributor Author

@tyrannosaurus-becks Does it seem ready from your side? Or is there something missing still?

Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

@sergeytrasko this looks great! Thanks for all your work on this!

@tyrannosaurus-becks tyrannosaurus-becks merged commit 21d0408 into hashicorp:master May 7, 2019
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants