-
Notifications
You must be signed in to change notification settings - Fork 423
/
services.go
executable file
·92 lines (86 loc) · 2.18 KB
/
services.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package main
// Configuration for back-end services
const (
// Public security means a user may be logged out or logged in
Public = iota
// Authenticated security means a user must be logged in
Authenticated = iota
// Admin security means a user must be both logged in and have sudo flag
Admin = iota
)
// ServiceDirectory allows access to a backend service using its subdomain
type ServiceDirectory map[string]Service
// Service is an app on Staffjoy that runs on a subdomain
type Service struct {
security int // Public, Authenticated, or Admin
restrictDev bool // If True, service is suppressed in stage and prod
backendDomain string // Backend service to query
}
// StaffjoyServices is a map of subdomains -> specs
// Sudomain is <string> + Env["rootDomain"]
// e.g. "login" service on prod is "login" + "staffjoy.com""
//
// KEEP THIS LIST IN ALPHABETICAL ORDER please
var StaffjoyServices = ServiceDirectory{
"account": {
security: Authenticated,
restrictDev: false,
backendDomain: "accountapi-service",
},
"app": {
security: Authenticated,
restrictDev: false,
backendDomain: "app-service",
},
"code": {
security: Public,
restrictDev: false,
backendDomain: "code-service",
},
"company": {
security: Authenticated,
restrictDev: false,
backendDomain: "companyapi-service",
},
"faraday": {
// Debug site for faraday
security: Public,
restrictDev: true,
backendDomain: "httpbin.org",
},
"login": {
security: Public,
restrictDev: false,
backendDomain: "login-service",
},
"myaccount": {
security: Authenticated,
restrictDev: false,
backendDomain: "myaccount-service",
},
"superpowers": {
security: Authenticated,
restrictDev: true,
backendDomain: "superpowers-service",
},
"signal": {
security: Admin,
restrictDev: false,
backendDomain: "signal.staffjoy.com",
},
"waitlist": {
security: Public,
restrictDev: false,
backendDomain: "waitlist-service",
},
"whoami": {
security: Public,
restrictDev: false,
backendDomain: "whoami-service",
},
"www": {
security: Public,
restrictDev: false,
backendDomain: "www-service",
},
}