mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-01 02:57:59 +00:00 
			
		
		
		
	Remove cookie authentication.
This commit is contained in:
		| @@ -78,6 +78,25 @@ func (c *SSHAgentConfig) TLSClient(certPool *x509.CertPool) *http.Client { | ||||
| 		TLSClientConfig:     tlsConfig, | ||||
| 		TLSHandshakeTimeout: 10 * time.Second, | ||||
| 	} | ||||
|  | ||||
| 	// From https://github.com/michiwend/gomusicbrainz/pull/4/files | ||||
| 	defaultRedirectLimit := 30 | ||||
|  | ||||
| 	client.CheckRedirect = func(req *http.Request, via []*http.Request) error { | ||||
| 		if len(via) > defaultRedirectLimit { | ||||
| 			return fmt.Errorf("%d consecutive requests(redirects)", len(via)) | ||||
| 		} | ||||
| 		if len(via) == 0 { | ||||
| 			// No redirects | ||||
| 			return nil | ||||
| 		} | ||||
| 		// mutate the subsequent redirect requests with the first Header | ||||
| 		if token := via[0].Header.Get("X-Vault-Token"); len(token) != 0 { | ||||
| 			req.Header.Set("X-Vault-Token", token) | ||||
| 		} | ||||
| 		return nil | ||||
| 	} | ||||
|  | ||||
| 	return &client | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeff Mitchell
					Jeff Mitchell