-
Notifications
You must be signed in to change notification settings - Fork 32
/
gateway.go
51 lines (38 loc) · 1.9 KB
/
gateway.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
package consts
type contextKey struct {
name string
}
func (c *contextKey) String() string { return "context value " + c.name }
var (
// AuthenticatedPrincipalContextKey is context key that contains the principal object
AuthenticatedPrincipalContextKey = contextKey{name: "auth-principal"}
AuditActorContextKey = contextKey{name: "audit-actor"}
AuditMetadataContextKey = contextKey{name: "audit-metadata"}
AuditServiceContextKey = contextKey{name: "audit-service"}
// BillingStripeTestClockContextKey is context key that contains the stripe test clock id
BillingStripeTestClockContextKey = contextKey{name: "billing-stripe-test-clock"}
// BillingStripeWebhookSignatureContextKey is context key that contains the stripe webhook signature
BillingStripeWebhookSignatureContextKey = contextKey{name: "billing-stripe-webhook-signature"}
)
const (
// const keys used to pass values from gRPC methods to http mux interface
SessionIDGatewayKey = "gateway-session-id"
SessionDeleteGatewayKey = "gateway-session-delete"
UserTokenGatewayKey = "gateway-user-token"
LocationGatewayKey = "gateway-location"
UserSecretGatewayKey = "gateway-user-secret"
// UserTokenRequestKey is returned from the application to client containing user details in
// response headers
UserTokenRequestKey = "x-user-token"
// LocationRequestKey is used to set location response header for redirecting browser
LocationRequestKey = "location"
// ProjectRequestKey is used to set current project in jwt token
ProjectRequestKey = "x-project"
// SessionRequestKey is the key to store session value in browser
SessionRequestKey = "sid"
// StripeTestClockRequestKey is used to store stripe test clock id which will
// be used to simulate a customer & subscription
StripeTestClockRequestKey = "x-stripe-test-clock"
// StripeWebhookSignature is used to store stripe webhook signature
StripeWebhookSignature = "stripe-signature"
)