10 var anonymousTokens tokenSet
12 type tokenSet []string
14 func (ts *tokenSet) Set(s string) error {
15 v, err := strconv.ParseBool(s)
16 if v && len(*ts) == 0 {
17 *ts = append(*ts, os.Getenv("ARVADOS_API_TOKEN"))
24 func (ts *tokenSet) String() string {
25 return fmt.Sprintf("%v", len(*ts) > 0)
28 func (ts *tokenSet) IsBoolFlag() bool {
33 flag.Var(&anonymousTokens, "allow-anonymous",
34 "Serve public data to anonymous clients. Try the token supplied in the ARVADOS_API_TOKEN environment variable when none of the tokens provided in an HTTP request succeed in reading the desired collection.")