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

Add credential library resource for Vault #114

Merged
merged 26 commits into from
Jun 23, 2021
Merged

Conversation

malnick
Copy link
Contributor

@malnick malnick commented Jun 1, 2021

Adds the credential library resource for Vault:

resource "boundary_credential_store_vault" "example" {
    name  =  "foo"
    description = "foo bar"
    address = 127.0.0.1"
    namespace = "default"
 }

resource "boundary_credential_library_vault" "example" {
  name  = "example"
  description = "example resource"
  credential_store_id = boundary_credential_store.example.id

  vault_path = "/my/secrets"
  vault_http_method = "POST"
  vault_request_body = <<EOF
{
  "key": "Value",
}
EOF
}

Built on https://github.com/hashicorp/boundary/tree/mgaffney-vault

@malnick malnick changed the title Add credential library resource Add credential library resource for Vault Jun 3, 2021
Copy link
Contributor

@talanknight talanknight left a comment

Choose a reason for hiding this comment

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

Looks like it is going in the right direction.

internal/provider/provider.go Show resolved Hide resolved
internal/provider/resource_credential_library_vault.go Outdated Show resolved Hide resolved
internal/provider/provider.go Show resolved Hide resolved
@louisruch
Copy link
Contributor

@malnick PTAL I exposed NewVaultTestServer in this PR hashicorp/boundary#1321
And then made these updates to get all tests to pass
@talanknight PTAL

@louisruch louisruch force-pushed the resource-credential-library branch from bab14bc to 3fafc4c Compare June 13, 2021 04:29
@louisruch
Copy link
Contributor

louisruch commented Jun 13, 2021

Just FYI I have now added the target cred lib Set functionality and associated tests...tests are all going green now, would be good to get a review so we can have this PR ready to merge once vault work merges to boundary@main

@malnick malnick marked this pull request as ready for review June 16, 2021 00:04
Copy link
Contributor

@talanknight talanknight left a comment

Choose a reason for hiding this comment

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

examples/resources/boundary_target/resource.tf Outdated Show resolved Hide resolved
internal/provider/const.go Outdated Show resolved Hide resolved

if len(opts) > 0 {
opts = append(opts, credentialstores.WithAutomaticVersioning(true))
aur, err := client.Update(ctx, d.Id(), 0, opts...)
Copy link
Contributor

Choose a reason for hiding this comment

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

If aur has a different value for credentialStoreVaultTokenHmacKey than we have stored we should issue another update just on the token or maybe we should issue a read before the update. Same thing for the clientCertificate Key. Please also add a test for this.

@malnick
Copy link
Contributor Author

malnick commented Jun 16, 2021

Just a note that this PR is ready to go but we're waiting to rebase the go.mod on boundary:main when that gets merged next week to ensure our provider main branch isn't pointed at a Boundary feature branch.

Relies on hashicorp/boundary#1308 being merged to main.

@louisruch louisruch force-pushed the resource-credential-library branch 2 times, most recently from 18fcc98 to 244e8a6 Compare June 19, 2021 23:11
@louisruch louisruch force-pushed the resource-credential-library branch from 244e8a6 to ac41548 Compare June 19, 2021 23:30
@louisruch louisruch merged commit 4f0509c into main Jun 23, 2021
@louisruch louisruch deleted the resource-credential-library branch June 23, 2021 04:07
louisruch added a commit that referenced this pull request Aug 16, 2021
* docs: update host catalog resource with correct value for type attribute

* build: add Makefile target for auto-generating docs

* bugfix: make OIDC account attribute for subject ForceNew

* docs: update auto-generated docs

* Add credential library resource for Vault (#114)

* Integrate with Vault to retrieve and manage per session credentials

Co-authored-by: Louis Ruch <[email protected]>

* Update token/clientKey on hmac change (#125)

* Update token/clientKey on hmac change

* Update changelog

* Update docs

* Prep for 1.0.3

* v1.0.3

* Update terraform-plugin-sdk

* Fix Typo

* Adopt American spelling

* fix the parameter that is actually being sent as the auth method id

Co-authored-by: Jeff Malnick <[email protected]>
Co-authored-by: Louis Ruch <[email protected]>
Co-authored-by: Jeff Mitchell <[email protected]>
Co-authored-by: tf-release-bot <[email protected]>
Co-authored-by: Lewis Cowper <[email protected]>
louisruch added a commit that referenced this pull request Aug 17, 2021
* feat: add managed group resource

* feat: add tests for managed group resource

* update go.sum

* update tests

* simplify the managed group resource

* use WithDefaultPasswordAuthMethodId

* Managed groups (#129)

* docs: update host catalog resource with correct value for type attribute

* build: add Makefile target for auto-generating docs

* bugfix: make OIDC account attribute for subject ForceNew

* docs: update auto-generated docs

* Add credential library resource for Vault (#114)

* Integrate with Vault to retrieve and manage per session credentials

Co-authored-by: Louis Ruch <[email protected]>

* Update token/clientKey on hmac change (#125)

* Update token/clientKey on hmac change

* Update changelog

* Update docs

* Prep for 1.0.3

* v1.0.3

* Update terraform-plugin-sdk

* Fix Typo

* Adopt American spelling

* fix the parameter that is actually being sent as the auth method id

Co-authored-by: Jeff Malnick <[email protected]>
Co-authored-by: Louis Ruch <[email protected]>
Co-authored-by: Jeff Mitchell <[email protected]>
Co-authored-by: tf-release-bot <[email protected]>
Co-authored-by: Lewis Cowper <[email protected]>

* nits and updates

* OIDC auth method + get filter from attributes

* Add changelog

* Fix schema description

Co-authored-by: Riley Guerin <[email protected]>
Co-authored-by: Louis Ruch <[email protected]>
Co-authored-by: Jeff Mitchell <[email protected]>
Co-authored-by: tf-release-bot <[email protected]>
Co-authored-by: Lewis Cowper <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants