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)
| 358 | // storageSafeUserKey returns a key for the given email, with the default |
| 359 | // filename, and the filename ending in the given extension. |
| 360 | func (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. |
no test coverage detected