mirror of https://github.com/hashicorp/consul
42eec33b0e
* Persist HCP management token from server config We want to move away from injecting an initial management token into Consul clusters linked to HCP. The reasoning is that by using a separate class of token we can have more flexibility in terms of allowing HCP's token to co-exist with the user's management token. Down the line we can also more easily adjust the permissions attached to HCP's token to limit it's scope. With these changes, the cloud management token is like the initial management token in that iit has the same global management policy and if it is created it effectively bootstraps the ACL system. * Update SDK and mock HCP server The HCP management token will now be sent in a special field rather than as Consul's "initial management" token configuration. This commit also updates the mock HCP server to more accurately reflect the behavior of the CCM backend. * Refactor HCP bootstrapping logic and add tests We want to allow users to link Consul clusters that already exist to HCP. Existing clusters need care when bootstrapped by HCP, since we do not want to do things like change ACL/TLS settings for a running cluster. Additional changes: * Deconstruct MaybeBootstrap so that it can be tested. The HCP Go SDK requires HTTPS to fetch a token from the Auth URL, even if the backend server is mocked. By pulling the hcp.Client creation out we can modify its TLS configuration in tests while keeping the secure behavior in production code. * Add light validation for data received/loaded. * Sanitize initial_management token from received config, since HCP will only ever use the CloudConfig.MangementToken. * Add changelog entry --------- Co-authored-by: freddygv <freddy@hashicorp.com> Co-authored-by: John Murret <john.murret@hashicorp.com> |
||
---|---|---|
.. | ||
testdata | ||
agent_limits.go | ||
builder.go | ||
builder_oss.go | ||
builder_oss_test.go | ||
builder_test.go | ||
config.go | ||
config_oss.go | ||
default.go | ||
default_oss.go | ||
deprecated.go | ||
deprecated_test.go | ||
doc.go | ||
file_watcher.go | ||
file_watcher_test.go | ||
flags.go | ||
flags_test.go | ||
flagset.go | ||
golden_test.go | ||
limits.go | ||
limits_windows.go | ||
merge.go | ||
merge_test.go | ||
ratelimited_file_watcher.go | ||
ratelimited_file_watcher_test.go | ||
runtime.go | ||
runtime_oss.go | ||
runtime_oss_test.go | ||
runtime_test.go | ||
segment_oss.go | ||
segment_oss_test.go |