vault/website/content/api-docs/system
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
..
inspect [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
mfa [DOCS] Confirm restricted endpoint alerts (main) (#23514) 2023-10-05 13:00:40 -04:00
replication Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
storage Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
audit-hash.mdx [DOCS] Confirm restricted endpoint alerts (main) (#23514) 2023-10-05 13:00:40 -04:00
audit.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
auth.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
capabilities-accessor.mdx [docs] Convert titles to sentense case (#21426) 2023-06-30 19:22:07 -04:00
capabilities-self.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
capabilities.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
config-auditing.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
config-control-group.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
config-cors.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
config-group-policy-application.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
config-reload.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
config-state.mdx Remove asterixes in header (#23548) 2023-10-09 13:03:54 -07:00
config-ui.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
control-group.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
decode-token.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
experiments.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
generate-recovery-token.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
generate-root.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
ha-status.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
health.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
host-info.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
in-flight-req.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
index.mdx [docs] Convert titles to sentense case (#21426) 2023-06-30 19:22:07 -04:00
init.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
internal-counters.mdx Add method and path for Read the client count configuration (#23551) 2023-10-12 10:10:04 -04:00
internal-specs-openapi.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
internal-ui-feature.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
internal-ui-mounts.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
internal-ui-namespaces.mdx [docs] Convert titles to sentense case (#21426) 2023-06-30 19:22:07 -04:00
internal-ui-resultant-acl.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
internal-ui-version.mdx VAULT-20669: Add New Authenticated Endpoint for Version (#23740) 2023-10-26 12:52:52 -04:00
key-status.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
leader.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
lease-count-quotas.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
leases.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
license.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
loggers.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
managed-keys.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
metrics.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
monitor.mdx [DOCS] Confirm restricted endpoint alerts (main) (#23514) 2023-10-05 13:00:40 -04:00
mounts.mdx Allow backends to extract credentials from payloads and trigger an authentication workflow (#23924) 2023-11-21 14:36:49 -05:00
namespaces.mdx [docs] Convert titles to sentense case (#21426) 2023-06-30 19:22:07 -04:00
plugins-catalog.mdx add API docs for plugin runtimes (#23223) 2023-09-28 05:35:22 +00:00
plugins-reload-backend.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
plugins-runtimes-catalog.mdx add API docs for plugin runtimes (#23223) 2023-09-28 05:35:22 +00:00
policies-password.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
policies.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
policy.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
pprof.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
quotas-config.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
rate-limit-quotas.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
raw.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
rekey-recovery-key.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
rekey.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
remount.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
rotate-config.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
rotate.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
seal-backend-status.mdx First draft of Seal HA documentation (#23252) 2023-09-22 13:18:48 -05:00
seal-status.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
seal.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
sealwrap-rewrap.mdx Update enterprise vs hcp alerts (#23619) 2023-10-11 17:59:27 -05:00
secrets-sync.mdx Document secrets sync LIST request modifications (#23975) 2023-11-10 09:04:26 -05:00
step-down.mdx Update step-down.mdx to describe behavior against non-active nodes (#23657) 2023-10-18 19:33:46 -07:00
tools.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
unseal.mdx [DOCS] Administrative namespace updates (#23208) 2023-09-21 12:07:25 -07:00
user-lockout.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
version-history.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
wrapping-lookup.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
wrapping-rewrap.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
wrapping-unwrap.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00
wrapping-wrap.mdx Fix the administrative banner for sys endpoints (#22888) 2023-09-11 09:20:31 +02:00