Fixed null token panic from 'v1/auth/token/' endpoints and returned p… (#13233)
* Fixed null token panic from 'v1/auth/token/' endpoints and returned proper error response * added changelog entry for PR #13233 * changed error message from 'bad token' to 'null token' * rebased off of main * Revert "changed error message from 'bad token' to 'null token'" This reverts commit 381ed9b32c5ddd5e47adb1643ef7e46fb768bc76. * changed 'bad token' error message to 'invalid token' after revert * remove unnecessary vault-data folder
This commit is contained in:
parent
f574e75f11
commit
e0ac921b8f
|
@ -1,6 +1,8 @@
|
|||
package api
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
// TokenAuth is used to perform token backend operations on Vault
|
||||
type TokenAuth struct {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
core/token: Fix null token panic from 'v1/auth/token/' endpoints and return proper error response.
|
||||
```
|
|
@ -553,7 +553,7 @@ func (c *Core) handleCancelableRequest(ctx context.Context, req *logical.Request
|
|||
break
|
||||
}
|
||||
if token == nil {
|
||||
return logical.ErrorResponse("bad token"), logical.ErrPermissionDenied
|
||||
return logical.ErrorResponse("invalid token"), logical.ErrPermissionDenied
|
||||
}
|
||||
_, nsID := namespace.SplitIDFromString(token.(string))
|
||||
if nsID != "" {
|
||||
|
|
Loading…
Reference in New Issue