From 113a6dd8abf70ddafe8395a79fb0d266592affa8 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Sat, 20 Apr 2024 00:19:26 +0200 Subject: [PATCH] Remove reporting the CA mode from startup logs --- authority/authority.go | 21 --------------------- ca/ca.go | 1 - cas/apiv1/services.go | 17 ----------------- 3 files changed, 39 deletions(-) diff --git a/authority/authority.go b/authority/authority.go index e3da7f93..d3b93288 100644 --- a/authority/authority.go +++ b/authority/authority.go @@ -8,7 +8,6 @@ import ( "crypto/sha256" "crypto/x509" "encoding/hex" - "fmt" "log" "net/http" "strings" @@ -823,26 +822,6 @@ func (a *Authority) init() error { return nil } -func (a *Authority) Mode() string { - if a.isRA() { - return fmt.Sprintf("RA (%s)", casapi.TypeOf(a.x509CAService).Name()) - } - - return "CA" // TODO(hs): more info? I.e. KMS type? -} - -func (a *Authority) isRA() bool { - if a.x509CAService == nil { - return false - } - switch casapi.TypeOf(a.x509CAService) { - case casapi.StepCAS, casapi.CloudCAS, casapi.VaultCAS, casapi.ExternalCAS: - return true - default: - return false - } -} - // initLogf is used to log initialization information. The output // can be disabled by starting the CA with the `--quiet` flag. func (a *Authority) initLogf(format string, v ...any) { diff --git a/ca/ca.go b/ca/ca.go index d19f88d1..0b426ded 100644 --- a/ca/ca.go +++ b/ca/ca.go @@ -425,7 +425,6 @@ func (ca *CA) Run() error { log.Printf("Current context: %s", step.Contexts().GetCurrent().Name) } log.Printf("Config file: %s", ca.getConfigFileOutput()) - log.Printf("Mode: %s", ca.auth.Mode()) baseURL := fmt.Sprintf("https://%s%s", authorityInfo.DNSNames[0], ca.config.Address[strings.LastIndex(ca.config.Address, ":"):]) diff --git a/cas/apiv1/services.go b/cas/apiv1/services.go index bee58869..00ecc2a8 100644 --- a/cas/apiv1/services.go +++ b/cas/apiv1/services.go @@ -67,23 +67,6 @@ func (t Type) String() string { return strings.ToLower(string(t)) } -// Name returns the name of the CAS implementation. -func (t Type) Name() (name string) { - switch t { - case CloudCAS: - name = "GCP CAS" - case StepCAS: - name = "Step CAS" - case VaultCAS: - name = "Vault" - case ExternalCAS: - name = "External" - default: - name = "SoftCAS" // TODO(hs): different name? It's not a "CAS" CAS, really - } - return -} - // TypeOf returns the type of the given CertificateAuthorityService. func TypeOf(c CertificateAuthorityService) Type { if ct, ok := c.(interface{ Type() Type }); ok {