Commit Graph

13 Commits

Author SHA1 Message Date
divyaac
74abae6f01
Added Invalid Token Error Message that will be returned for bad tokens (#25953)
Edited changelog

Added dummy policy to CE file to make tests pass

Added changelog
2024-03-14 11:15:20 -07:00
suchsoon
f86e3d4a68
remove repetitive words (#25860)
Signed-off-by: suchsoon <silverjadebeauty@gmail.com>
2024-03-13 18:44:54 +00:00
Marc Boudreau
79b1912287
VAULT-21607: Provide Management Endpoints for Vault UI Custom Messages (#24263)
* Implement custom-message management endpoints in a namespace aware manner

* completion of non-enterprise version of custom-messages

* clean up of error handling and fixing a nil pointer error

* rename UICustomMessagesEntry to UICustomMessageEntry

* add unit tests to cover new functions in UIConfig related to custom messages

* unit tests for all custom message handling

* add missing header comments for new files

* add changelog file

* fix test setup error that led to unexpected failure

* change return type from slice of pointers to struct to slice of struct and add godocs to every function

* add Internal suffix to internal methods for the UIConfig struct

* add validation for start and end times of custom messages

* improvements based on review feedback

* explore new approach for custom messages

* introduce new error to force HTTP 404 when referencing non-existant UI custom message

* remove changelog entry until feature is complete

* implement CRUD endpoints using single storage entry per namespace

* add mutex to protect operations that read the storage entry and write it back

* add copyright header comment to new files

* fix failing tests due to change in target function behaviour in order to return 404 error when mandated

* feedback from review plus some improvements on my own as well

* define constants for recognized message types and replace hardcoded strings occurrences with new constants

* incorporate feedback comment

* beef up testing with non-root namespaces in putEntry and getEntryForNamespace

* renaming CreateMessage to AddMessage in uicustommessages.Manager and uicustommessages.Entry

* adding missing copyright header comments
2023-12-11 13:31:42 -05:00
Steven Clark
b7dff9777d
Allow backends to extract credentials from payloads and trigger an authentication workflow (#23924)
* wip

* Work on the tuneable allowance and some bugs

* Call handleCancellableRequest instead, which gets the audit order more correct and includes the preauth response

* Get rid of no longer needed operation

* Phew, this wasn't necessary

* Add auth error handling by the backend, and fix a bug with handleInvalidCredentials

* Cleanup req/resp naming

* Use the new form, and data

* Discovered that tokens werent really being checked because isLoginRequest returns true for the re-request into the backend, when it shouldnt

* Add a few more checks in the delegated request handler for bad inputs

 - Protect the delegated handler from bad inputs from the backend such
   as an empty accessor, a path that isn't registered as a login request
 - Add similar protections for bad auth results as we do in the normal
   login request paths. Technically not 100% needed but if somehow the
   handleCancelableRequest doesn't use the handleLoginRequest code path
   we could get into trouble in the future
 - Add delegated-auth-accessors flag to the secrets tune command and
   api-docs

* Unit tests and some small fixes

* Remove transit preauth test, rely on unit tests

* Cleanup and add a little more commentary in tests

* Fix typos, add another failure use-case which we reference a disabled auth mount

* PR Feedback

 - Use router to lookup mount instead of defining a new lookup method
 - Enforce auth table types and namespace when mount is found
 - Define a type alias for the handleInvalidCreds
 - Fix typos/grammar
 - Clean up globals in test

* Additional PR feedback

 - Add test for delegated auth handler
 - Force batch token usage
 - Add a test to validate failures if a non-batch token is used
 - Check for Data member being nil in test cases

* Update failure error message around requiring batch tokens

* Trap MFA requests

* Reword some error messages

* Add test and fixes for delegated response wrapping

* Move MFA test to dedicated mount

 - If the delegated auth tests were running in parallel, the MFA test
   case might influence the other tests, so move the MFA to a dedicated
   mount

* PR feedback: use textproto.CanonicalMIMEHeaderKey

 - Change the X-Vault-Wrap-Ttl constant to X-Vault-Wrap-TTL
   and use textproto.CanonicalMIMEHeaderKey to format it
   within the delete call.
 - This protects the code around changes of the constant typing

* PR feedback

 - Append Error to RequestDelegatedAuth
 - Force error interface impl through explicit nil var assignment on
   RequestDelegatedAuthError
 - Clean up test factory and leverage NewTestSoloCluster
 - Leverage newer maps.Clone as this is 1.16 only

---------

Co-authored-by: Scott G. Miller <smiller@hashicorp.com>
2023-11-21 14:36:49 -05:00
Hamid Ghaf
e55c18ed12
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00
akshya96
9d49bfa05d
Return errInvalidCredentials when wrong credentials is provided for existent users (#17104)
* adding errInvalidCredentials

* fixing tests

* add changelog

* fixing fmt errors

* test if routeErr is seen externally and fixing error comment

* adding fmt changes

* adding comments
2022-09-27 16:49:14 -07:00
swayne275
5230d79a2f
backport error changes from ent PR (#12926) 2021-10-26 10:11:24 -06:00
swayne275
9ed4d8f547
port relevant ent changes (#12823) 2021-10-13 18:15:54 -06:00
Pratyoy Mukhopadhyay
1749dcf5ae
[VAULT-2852] deprecate req counters in oss (#12197) 2021-07-29 10:21:40 -07:00
Nick Cabatoff
7679223da6
Reorganize request handling code so that we don't touch storage until we have the stateLock. (#11835) 2021-06-11 13:18:16 -04:00
swayne275
f8f289712a
Introduce Logical Unrecoverable Error, Use it in Expiration Manager (#11477)
* build out zombie lease system

* add typo for CI

* undo test CI commit

* time equality test isn't working on CI, so let's see what this does...

* add unrecoverable proto error, make proto, go mod vendor

* zombify leases if unrecoverable error, tests

* test fix: somehow pointer in pointer rx is null after pointer rx called

* tweaks based on roy feedback

* improve zombie errors

* update which errors are unrecoverable

* combine zombie logic

* keep subset of zombie lease in memory
2021-05-03 17:56:06 -06:00
Vishal Nayak
c68e270863
Resource Quotas: Rate Limiting (#9330) 2020-06-26 17:13:16 -04:00
Jeff Mitchell
170521481d
Create sdk/ and api/ submodules (#6583) 2019-04-12 17:54:35 -04:00