open-consul/agent/connect/ca
Chris S. Kim 8671448b73
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
..
common.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
mock_Provider.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_aws.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_aws_test.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_consul.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_consul_config.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_consul_test.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
provider_vault_auth.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_alicloud.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_approle.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_aws.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_azure.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_gcp.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_jwt.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_k8s.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_auth_test.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
provider_vault_test.go Connect CA Primary Provider refactor (#16749) 2023-04-03 11:40:33 -04:00
testing.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00