You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: auth.go
+32-1Lines changed: 32 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ package main
25
25
import (
26
26
"fmt"
27
27
"io/ioutil"
28
+
"strconv"
28
29
"strings"
29
30
"time"
30
31
@@ -56,6 +57,9 @@ var (
56
57
paths []string
57
58
expstring
58
59
expDuration time.Duration
60
+
61
+
fieldsOverride []string
62
+
fieldsOverrideMapmap[string]interface{}
59
63
}
60
64
)
61
65
@@ -69,6 +73,7 @@ func init() {
69
73
pf.StringVar(&authOptions.user, "auth.user", "", "name of a user to authenticate as. If empty, 'super-user' authentication is used")
70
74
pf.StringSliceVar(&authOptions.paths, "auth.paths", nil, "a list of allowed pathes. The path must not include the '_db/DBNAME' prefix.")
71
75
pf.StringVar(&authOptions.exp, "auth.exp", "", "a time in which token should expire - based on current time in UTC. Supported units: h, m, s (default)")
76
+
pf.StringSliceVar(&authOptions.fieldsOverride, "auth.fields", nil, "a list of additional fields set in the token. This flags override one auto-generated in token")
72
77
}
73
78
74
79
// mustAuthCreateJWTToken creates a the JWT token based on authentication options.
0 commit comments