- Parse toml configuration file, see https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication - Retro-compatible with existing AND documented routes, until after v3.41 release - Log a warning if an unprotected-by-default route is accessed unprotected - Authentication methods: none, apikey, basic - `genkey` command to generate API keys Co-authored-by: Joe Jose <45399349+joejose97@users.noreply.github.com>
23 lines
413 B
Go
23 lines
413 B
Go
package auth
|
|
|
|
func andStrings(strings []string) (result string) {
|
|
return joinStrings(strings, "and")
|
|
}
|
|
|
|
func joinStrings(strings []string, lastJoin string) (result string) {
|
|
if len(strings) == 0 {
|
|
return ""
|
|
}
|
|
|
|
result = strings[0]
|
|
for i := 1; i < len(strings); i++ {
|
|
if i < len(strings)-1 {
|
|
result += ", " + strings[i]
|
|
} else {
|
|
result += " " + lastJoin + " " + strings[i]
|
|
}
|
|
}
|
|
|
|
return result
|
|
}
|