MCPcopy
hub / github.com/caddyserver/certmagic / storageSafeUserKey

Method storageSafeUserKey

account.go:360–371  ·  view source on GitHub ↗

storageSafeUserKey returns a key for the given email, with the default filename, and the filename ending in the given extension.

(ca, email, defaultFilename, extension string)

Source from the content-addressed store, hash-verified

358// storageSafeUserKey returns a key for the given email, with the default
359// filename, and the filename ending in the given extension.
360func (am *ACMEIssuer) storageSafeUserKey(ca, email, defaultFilename, extension string) string {
361 if email == "" {
362 email = emptyEmail
363 }
364 email = strings.ToLower(email)
365 filename := am.emailUsername(email)
366 if filename == "" {
367 filename = defaultFilename
368 }
369 filename = StorageKeys.Safe(filename)
370 return path.Join(am.storageKeyUserPrefix(ca, email), filename+extension)
371}
372
373// emailUsername returns the username portion of an email address (part before
374// '@') or the original input if it can't find the "@" symbol.

Callers 2

storageKeyUserRegMethod · 0.95

Calls 3

emailUsernameMethod · 0.95
storageKeyUserPrefixMethod · 0.95
SafeMethod · 0.80

Tested by

no test coverage detected