summaryrefslogtreecommitdiff
path: root/modules/caddypki
diff options
context:
space:
mode:
authorJacob Gadikian <jacobgadikian@gmail.com>2023-08-08 03:40:31 +0800
committerGitHub <noreply@github.com>2023-08-07 19:40:31 +0000
commitb32f265ecad60404c3818cc9d42e367a8e4eb7d4 (patch)
tree16d79c3ad7ddf0cc6f7915d1e47bdd6d269bf8d5 /modules/caddypki
parent431adc09805972196314b2b188904942cbe5dfee (diff)
ci: Use gofumpt to format code (#5707)
Diffstat (limited to 'modules/caddypki')
-rw-r--r--modules/caddypki/acmeserver/acmeserver.go8
-rw-r--r--modules/caddypki/ca.go4
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/caddypki/acmeserver/acmeserver.go b/modules/caddypki/acmeserver/acmeserver.go
index 0f739ec..454720b 100644
--- a/modules/caddypki/acmeserver/acmeserver.go
+++ b/modules/caddypki/acmeserver/acmeserver.go
@@ -239,7 +239,7 @@ func (ash Handler) openDatabase() (*db.AuthDB, error) {
dbFolder := filepath.Join(caddy.AppDataDir(), "acme_server", key)
dbPath := filepath.Join(dbFolder, "db")
- err := os.MkdirAll(dbFolder, 0755)
+ err := os.MkdirAll(dbFolder, 0o755)
if err != nil {
return nil, fmt.Errorf("making folder for CA database: %v", err)
}
@@ -310,8 +310,10 @@ func (c resolverClient) LookupTxt(name string) ([]string, error) {
const defaultPathPrefix = "/acme/"
-var keyCleaner = regexp.MustCompile(`[^\w.-_]`)
-var databasePool = caddy.NewUsagePool()
+var (
+ keyCleaner = regexp.MustCompile(`[^\w.-_]`)
+ databasePool = caddy.NewUsagePool()
+)
type databaseCloser struct {
DB *db.AuthDB
diff --git a/modules/caddypki/ca.go b/modules/caddypki/ca.go
index 1ba0890..d52fc5f 100644
--- a/modules/caddypki/ca.go
+++ b/modules/caddypki/ca.go
@@ -376,15 +376,19 @@ func (ca CA) genIntermediate(rootCert *x509.Certificate, rootKey crypto.Signer)
func (ca CA) storageKeyCAPrefix() string {
return path.Join("pki", "authorities", certmagic.StorageKeys.Safe(ca.ID))
}
+
func (ca CA) storageKeyRootCert() string {
return path.Join(ca.storageKeyCAPrefix(), "root.crt")
}
+
func (ca CA) storageKeyRootKey() string {
return path.Join(ca.storageKeyCAPrefix(), "root.key")
}
+
func (ca CA) storageKeyIntermediateCert() string {
return path.Join(ca.storageKeyCAPrefix(), "intermediate.crt")
}
+
func (ca CA) storageKeyIntermediateKey() string {
return path.Join(ca.storageKeyCAPrefix(), "intermediate.key")
}