mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-27 10:18:34 +00:00
Remove reporting the CA mode from startup logs
This commit is contained in:
@@ -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) {
|
||||
|
||||
1
ca/ca.go
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, ":"):])
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user