-
Notifications
You must be signed in to change notification settings - Fork 137
/
token.go
25 lines (20 loc) · 936 Bytes
/
token.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package consts
import "time"
// This is the list of possible audience values for JWT.
const (
AppAudience = "app" // used by client-side apps
KonnectorAudience = "konn" // used by konnectors
CLIAudience = "cli" // used by command line interface
ShareAudience = "share" // used for share by links code
RegistrationTokenAudience = "registration" // OAuth registration tokens
AccessTokenAudience = "access" // OAuth access tokens
RefreshTokenAudience = "refresh" // OAuth refresh tokens
)
// TokenValidityDuration is the duration where a token is valid in seconds (1 week)
var (
DefaultValidityDuration = 24 * time.Hour
AppTokenValidityDuration = 24 * time.Hour
KonnectorTokenValidityDuration = 30 * time.Minute
CLITokenValidityDuration = 30 * time.Minute
AccessTokenValidityDuration = 7 * 24 * time.Hour
)