-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.go
37 lines (31 loc) · 1014 Bytes
/
data.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
26
27
28
29
30
31
32
33
34
35
36
37
package data
const (
ModuleName = "auth-svc"
OrchestratorName = "orchestrator"
TokenRegExpStr = `^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$`
RefreshCookie = "refresh_token"
AccessCookie = "access_token"
)
type GenerateTokens struct {
User User
AccessLife int64
RefreshLife int64
Secret string
PermissionsString string
}
type JwtClaims struct {
ExpiresAt int64 `json:"exp"`
CreatedAtNano int64 `json:"iat_nano"`
OwnerId int64 `json:"owner_id"`
Email string `json:"email"`
ModulePermission string `json:"module.permission"`
}
type ModulePayload struct {
RequestId string `json:"request_id"`
Action string `json:"action"`
//other fields that are required for module
ModulePermissions ModulePermissions `json:"module_permissions,omitempty"`
ModuleName string `json:"module_name"`
}
type StatusPermission map[string]string
type ModulePermissions map[string]StatusPermission