瀏覽代碼

Remove reporting the CA mode from startup logs

Herman Slatman 2 年之前
父節點
當前提交
113a6dd8ab
共有 3 個文件被更改,包括 0 次插入 和 39 次删除
  1. 0 21
      authority/authority.go
  2. 0 1
      ca/ca.go
  3. 0 17
      cas/apiv1/services.go

+ 0 - 21
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) {

+ 0 - 1
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, ":"):])

+ 0 - 17
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 {