MCPcopy
hub / github.com/tinyauthapp/tinyauth / GetSecret

Function GetSecret

internal/utils/security_utils.go:14–29  ·  view source on GitHub ↗
(conf string, file string)

Source from the content-addressed store, hash-verified

12)
13
14func GetSecret(conf string, file string) string {
15 if conf == "" && file == "" {
16 return ""
17 }
18
19 if conf != "" {
20 return conf
21 }
22
23 contents, err := ReadFile(file)
24 if err != nil {
25 return ""
26 }
27
28 return ParseSecretFile(contents)
29}
30
31func ParseSecretFile(contents string) string {
32 lines := strings.Split(contents, "\n")

Callers 4

TestGetSecretFunction · 0.92
setHeadersMethod · 0.92
InitMethod · 0.92
SetupMethod · 0.92

Calls 2

ReadFileFunction · 0.85
ParseSecretFileFunction · 0.85

Tested by 1

TestGetSecretFunction · 0.74