mirror of
https://github.com/warmbly/warmbly.git
synced 2026-10-06 00:02:15 +00:00
18 lines
411 B
Go
18 lines
411 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// NodeAPIToken is the credential a fleet node presents on the node-only
|
|
// internal routes: NODE_BROKER_TOKEN, else the shared internal token.
|
|
func NodeAPIToken() string {
|
|
for _, key := range []string{"NODE_BROKER_TOKEN", "ENCRYPTED_KEYS_WORKER_TOKEN", "INTERNAL_API_TOKEN"} {
|
|
if v := strings.TrimSpace(os.Getenv(key)); v != "" {
|
|
return v
|
|
}
|
|
}
|
|
return ""
|
|
}
|