consul/agent/connect
Chris S. Kim a5397b1f23
Connect CA Primary Provider refactor (#16749)
* Rename Intermediate cert references to LeafSigningCert

Within the Consul CA subsystem, the term "Intermediate"
is confusing because the meaning changes depending on
provider and datacenter (primary vs secondary). For
example, when using the Consul CA the "ActiveIntermediate"
may return the root certificate in a primary datacenter.

At a high level, we are interested in knowing which
CA is responsible for signing leaf certs, regardless of
its position in a certificate chain. This rename makes
the intent clearer.

* Move provider state check earlier

* Remove calls to GenerateLeafSigningCert

GenerateLeafSigningCert (formerly known
as GenerateIntermediate) is vestigial in
non-Vault providers, as it simply returns
the root certificate in primary
datacenters.

By folding Vault's intermediate cert logic
into `GenerateRoot` we can encapsulate
the intermediate cert handling within
`newCARoot`.

* Move GenerateLeafSigningCert out of PrimaryProvidder

Now that the Vault Provider calls
GenerateLeafSigningCert within
GenerateRoot, we can remove the method
from all other providers that never
used it in a meaningful way.

* Add test for IntermediatePEM

* Rename GenerateRoot to GenerateCAChain

"Root" was being overloaded in the Consul CA
context, as different providers and configs
resulted in a single root certificate or
a chain originating from an external trusted
CA. Since the Vault provider also generates
intermediates, it seems more accurate to
call this a CAChain.
2023-04-03 11:40:33 -04:00
..
ca Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
authz.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
authz_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
common_names.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
csr.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
csr_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
generate.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
generate_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
parsing.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
sni.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
sni_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
testing_ca.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
testing_ca_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
testing_spiffe.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_agent.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_agent_oss.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_agent_oss_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_mesh_gateway.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_mesh_gateway_oss.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_mesh_gateway_oss_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_server.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_service.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_service_oss.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_service_oss_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_signing.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_signing_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
uri_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
x509_patch.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
x509_patch_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00