ExplicitSecretRingFile returns the path to the user's GPG secret ring file and true if it was ever set through the --secret-keyring flag or the CAMLI_SECRET_RING var. It returns "", false otherwise. Use of this function requires the program to call AddSecretRingFlag, and before flag.Parse is called.
()
| 247 | // Use of this function requires the program to call AddSecretRingFlag, |
| 248 | // and before flag.Parse is called. |
| 249 | func ExplicitSecretRingFile() (string, bool) { |
| 250 | if !secretRingFlagAdded { |
| 251 | panic("proper use of ExplicitSecretRingFile requires exposing flagSecretRing with AddSecretRingFlag") |
| 252 | } |
| 253 | if flagSecretRing != "" { |
| 254 | return flagSecretRing, true |
| 255 | } |
| 256 | if e := os.Getenv("CAMLI_SECRET_RING"); e != "" { |
| 257 | return e, true |
| 258 | } |
| 259 | return "", false |
| 260 | } |
| 261 | |
| 262 | // DefaultSecretRingFile returns the path to the default GPG secret |
| 263 | // keyring. It is not influenced by any flag or CAMLI* env var. |
no outgoing calls
no test coverage detected