mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 10:37:56 +00:00 
			
		
		
		
	Support trimming trailing slashes via a mount tuneable to support CMPv2 (#28752)
* Support trimming trailing slashes via a mount tuneable to support CMPv2 * changelog/ * Perform trimming in handleLoginRequest too * Eagerly fetch the mount entry so we only test this once * Add a mount match function that gets path and entry * Update vault/request_handling.go Co-authored-by: Steven Clark <steven.clark@hashicorp.com> * more docs * Some patches (from ENT) didnt apply * patch fail * Update vault/router.go Co-authored-by: Steven Clark <steven.clark@hashicorp.com> * PR feedback * dupe * another dupe * Add support for enabling trim_request_trailing_slashes on mount creation * Fix read mount api returning configuration for trim_request_trailing_slashes * Fix test assertion * Switch enable and tune arguments to BoolPtrVal to allow end-users to specify false flag * Add trim-request-trailing-slashes to the auth enable API and CLI --------- Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
This commit is contained in:
		| @@ -196,6 +196,7 @@ func TestSecretsTuneCommand_Run(t *testing.T) { | ||||
| 				"-listing-visibility", "unauth", | ||||
| 				"-plugin-version", version, | ||||
| 				"-delegated-auth-accessors", "authAcc1,authAcc2", | ||||
| 				"-trim-request-trailing-slashes=true", | ||||
| 				"mount_tune_integration/", | ||||
| 			}) | ||||
| 			if exp := 0; code != exp { | ||||
| @@ -232,6 +233,9 @@ func TestSecretsTuneCommand_Run(t *testing.T) { | ||||
| 			if exp := 3600; mountInfo.Config.MaxLeaseTTL != exp { | ||||
| 				t.Errorf("expected %d to be %d", mountInfo.Config.MaxLeaseTTL, exp) | ||||
| 			} | ||||
| 			if !mountInfo.Config.TrimRequestTrailingSlashes { | ||||
| 				t.Errorf("expected trim_request_trailing_slashes to be enabled") | ||||
| 			} | ||||
| 			if diff := deep.Equal([]string{"authorization", "www-authentication"}, mountInfo.Config.PassthroughRequestHeaders); len(diff) > 0 { | ||||
| 				t.Errorf("Failed to find expected values for PassthroughRequestHeaders. Difference is: %v", diff) | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Scott Miller
					Scott Miller