17 lines
391 B
Go
17 lines
391 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// Deployment files identify credential environment variables, not secret bytes.
|
|
func fileCredential(field, reference string) (string, error) {
|
|
value, exists := os.LookupEnv(reference)
|
|
if !exists || strings.TrimSpace(value) == "" {
|
|
return "", fmt.Errorf("credential referenced by oss.%s is unavailable", field)
|
|
}
|
|
return value, nil
|
|
}
|