Merge branch 'master' into 5538-arvadosclient-retry
[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                 "API token to try when none of the tokens provided in an HTTP request succeed in reading the desired collection. Multiple anonymous tokens can be provided by using this flag more than once; each token will be attempted in turn until one works.")
24 }