mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	VAULT-33758: IPv6 address conformance for proxy and agent (#29517)
This is a follow-up to our initial work[0] to address RFC-5952 §4 conformance for IPv6 addresses in Vault. The initial pass focused on the vault server configuration and start-up routines. This follow-up focuses on Agent and Proxy, with a few minor improvements for server. The approach generally mirrors the server implementation but also adds support for normalization with CLI configuration overrides. One aspect we do not normalize currently is Agent/Proxy client creation to the Vault server with credentials taken from environment variables, as it would require larger changes to the `api` module. In practice this ought to be fine for the majority of cases. [0]: https://github.com/hashicorp/vault/pull/29228
This commit is contained in:
		| @@ -865,10 +865,11 @@ func (c *ProxyCommand) applyConfigOverrides(f *FlagSets, config *proxyConfig.Con | ||||
| 	}) | ||||
|  | ||||
| 	c.setStringFlag(f, config.Vault.Address, &StringVar{ | ||||
| 		Name:    flagNameAddress, | ||||
| 		Target:  &c.flagAddress, | ||||
| 		Default: "https://127.0.0.1:8200", | ||||
| 		EnvVar:  api.EnvVaultAddress, | ||||
| 		Name:        flagNameAddress, | ||||
| 		Target:      &c.flagAddress, | ||||
| 		Default:     "https://127.0.0.1:8200", | ||||
| 		EnvVar:      api.EnvVaultAddress, | ||||
| 		Normalizers: []func(string) string{configutil.NormalizeAddr}, | ||||
| 	}) | ||||
| 	config.Vault.Address = c.flagAddress | ||||
| 	c.setStringFlag(f, config.Vault.CACert, &StringVar{ | ||||
| @@ -942,13 +943,13 @@ func (c *ProxyCommand) setStringFlag(f *FlagSets, configVal string, fVar *String | ||||
| 		// Don't do anything as the flag is already set from the command line | ||||
| 	case flagEnvSet: | ||||
| 		// Use value from env var | ||||
| 		*fVar.Target = flagEnvValue | ||||
| 		fVar.SetTarget(flagEnvValue) | ||||
| 	case configVal != "": | ||||
| 		// Use value from config | ||||
| 		*fVar.Target = configVal | ||||
| 		fVar.SetTarget(configVal) | ||||
| 	default: | ||||
| 		// Use the default value | ||||
| 		*fVar.Target = fVar.Default | ||||
| 		fVar.SetTarget(fVar.Default) | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ryan Cragun
					Ryan Cragun