Merge branch '5824-keep-web' into 5824-keep-web-workbench
[arvados.git] / services / keep-web / anonymous.go
1 package main
2
3 import (
4         "flag"
5         "fmt"
6 )
7
8 var anonymousTokens tokenSet
9
10 type tokenSet []string
11
12 func (ts *tokenSet) Set(t string) error {
13         *ts = append(*ts, t)
14         return nil
15 }
16
17 func (ts *tokenSet) String() string {
18         return fmt.Sprintf("%+v", (*ts)[:])
19 }
20
21 func init() {
22         flag.Var(&anonymousTokens, "anonymous-token",
23                 "Try using the specified token when a client does not provide a valid token. If this flag is used multiple times, each token will be tried in turn until one works.")
24 }