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

Kv preflight #4430

Merged
merged 19 commits into from
Apr 23, 2018
Merged

Kv preflight #4430

merged 19 commits into from
Apr 23, 2018

Conversation

briankassouf
Copy link
Member

No description provided.

@@ -97,14 +97,19 @@ func (c *KVPutCommand) Run(args []string) int {
stdin = c.testStdin
}

if len(args) < 1 {
switch {
case len(args) < 1:
c.UI.Error(fmt.Sprintf("Not enough arguments (expected 1, got %d)", len(args)))
Copy link
Member

Choose a reason for hiding this comment

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

This "expected 1" isn't true anymore, because if they provide 1 they hit the next error case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point!

jefferai and others added 2 commits April 23, 2018 12:29
* Enable `-field` in `vault kv get/put`

Fixes #4424

* Unify nil value handling

* Use preflight helper
return nil, err
}
if entity != nil && entity.Disabled {
return nil, logical.ErrPermissionDenied
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 return logical.ErrEntityDisabled instead?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, should

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying not to use different error message so as not to leak what mounts exist. And i wanted the ACL check to happen after making sure it's a valid mount

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ok.

@jefferai jefferai added this to the 0.10.1 milestone Apr 23, 2018
calvn
calvn previously approved these changes Apr 23, 2018
Copy link
Member

@calvn calvn left a comment

Choose a reason for hiding this comment

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

🎉

@briankassouf briankassouf merged commit a136c79 into master Apr 23, 2018
@briankassouf briankassouf deleted the kv-preflight branch April 23, 2018 22:00
truenorthcreative pushed a commit that referenced this pull request Apr 23, 2018
* Update kv command to use a preflight check

* Make the existing ui endpoint return the allowed mounts

* Add kv subcommand tests

* Enable `-field` in `vault kv get/put` (#4426)

* Enable `-field` in `vault kv get/put`

Fixes #4424

* Unify nil value handling

* Use preflight helper

* Update vkv plugin

* Add all the mount info when authenticated

* Add fix the error message on put

* add metadata test

* No need to sort the capabilities

* Remove the kv client header

* kv patch command (#4432)

* Fix test

* Fix tests

* Use permission denied instead of entity disabled
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