-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Store original request path in WrapInfo #3100
Conversation
vault/wrapping.go
Outdated
// Store creation_path if not a rewrap | ||
if req.Path != "sys/wrapping/rewrap" { | ||
cubbyReq.Data["creation_path"] = req.Path | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise this should be the wrapinfo creation path right?
http/handler_test.go
Outdated
@@ -282,6 +282,12 @@ func TestSysMounts_headerAuth_Wrapped(t *testing.T) { | |||
} | |||
expected["wrap_info"].(map[string]interface{})["creation_time"] = actualCreationTime | |||
|
|||
actualCreationPath, ok := actual["wrap_info"].(map[string]interface{})["creation_path"] | |||
if !ok || actualCreationPath == "" { | |||
t.Fatal("creation_time missing in wrap info") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"creation_path"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@@ -58,7 +58,7 @@ $ curl \ | |||
"token": "3b6f1193-0707-ac17-284d-e41032e74d1f", | |||
"ttl": 300, | |||
"creation_time": "2016-09-28T14:22:26.486186607-04:00", | |||
"wrapped_accessor": "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrapped_accessor
is not returned if it's empty.
Fixes #3009