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 tool for analyzing Vault API coverage #466

Merged
merged 1 commit into from
Jul 11, 2019

Conversation

tyrannosaurus-becks
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks commented Jul 10, 2019

This PR adds a tool for analyzing the level of Vault API coverage we have, as well as what is and isn't supported.

The report it produces is like this:

/auth/kubernetes/config is in the Terraform Vault Provider multiple times
/sys/policy/{name} is in the Terraform Vault Provider multiple times
/auth/kubernetes/role/{name} is in the Terraform Vault Provider multiple times
 
16 percent coverage
70 of 429 vault paths are supported
359 of 429 vault paths are unsupported
 
SUPPORTED
    /auth/approle/login
    /auth/approle/role/{role_name}
    /auth/approle/role/{role_name}/custom-secret-id
    ...more...
 
UNSUPPORTED
    /ad/config
    /ad/creds/{name}
    /ad/roles
    ...more...

It will also flag resources or datasources that haven't gotten inventoried by causing tests to fail with useful output.

This report will now be run as part of the CI tests, so it'll be possible to view it by simply viewing the CI tests run with the latest commit. For an example, see the "Details" of the last successful build of this PR.

cmd/coverage/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@malnick malnick left a comment

Choose a reason for hiding this comment

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

I love this new tool! Something like this would have been incredibly useful for other providers I wrote in previous roles. I left a couple of comments mostly geared towards linting and tests.

cmd/coverage/main_test.go Outdated Show resolved Hide resolved
cmd/coverage/main_test.go Outdated Show resolved Hide resolved
vault/provider.go Outdated Show resolved Hide resolved
vault/provider.go Outdated Show resolved Hide resolved
@tyrannosaurus-becks tyrannosaurus-becks changed the title Add tool for analyzing Vault API coverage WIP: Add tool for analyzing Vault API coverage Jul 11, 2019
@tyrannosaurus-becks tyrannosaurus-becks changed the title WIP: Add tool for analyzing Vault API coverage Add tool for analyzing Vault API coverage Jul 11, 2019
@tyrannosaurus-becks
Copy link
Contributor Author

All feedback is addressed. Merging so other contributors can work off this code.

@tyrannosaurus-becks tyrannosaurus-becks merged commit 2c8fc78 into master Jul 11, 2019
@tyrannosaurus-becks tyrannosaurus-becks deleted the add-ability-to-describe-paths branch July 11, 2019 18:17
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…-to-describe-paths

Add tool for analyzing Vault API coverage
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.

2 participants