-
Notifications
You must be signed in to change notification settings - Fork 8
/
edgecontext.thrift
150 lines (115 loc) · 4.12 KB
/
edgecontext.thrift
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
namespace py reddit_edgecontext.thrift
namespace go reddit.edgecontext
namespace java com.reddit.edgecontext
/**A raw authentication token as returned by the authentication service.
*/
typedef string AuthenticationToken
/** IETF language tag representing the preferred locale for
the client, used for providing localized content. Consists of
an ISO 639-1 primary language subtag and an optional
ISO 3166-1 alpha-2 region subtag.
*/
typedef string LocaleCode
/** A two-character ISO 3166-1 country code representing the current
geographic location of the client.
*/
typedef string CountryCode
/** The components of the Reddit LoID cookie that we want to propagate between
services.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Loid {
/** The ID of the LoID cookie.
*/
1: string id;
/** The time when the LoID cookie was created in epoch milliseconds.
*/
2: i64 created_ms;
}
/** The components of the Reddit Session tracker cookie that we want to
propagate between services.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Session {
/** The ID of the Session tracker cookie.
*/
1: string id;
}
/** The components of the device making a request to our services that we want to
propogate between services.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Device {
/** The ID of the device.
*/
1: string id;
}
/** Metadata about the origin service for a request.
The "origin" service is the service responsible for handling the request from
the client.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct OriginService {
/** The name of the origin service.
*/
1: string name
}
/** Geolocation data from a request to our services that we want to
propagate between services.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Geolocation {
/** The country code of the requesting client based on geographic location.
*/
1: CountryCode country_code
}
/** Unique identifier of this Edge Request
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct RequestId {
/** The id of this Edge Request, in the most human-readable format.
*/
1: string readable_id
}
/** Locale data from a request to our services that we want to
propagate between services.
This model is a component of the "Edge-Request" header. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Locale {
/** IETF language tag representing the preferred locale for
the client, used for providing localized content. Consists of
an ISO 639-1 primary language subtag and an optional
ISO 3166-1 alpha-2 region subtag.
*/
1: LocaleCode locale_code
}
/** Container model for the Edge-Request context header.
Baseplate will automatically parse this from the "Edge-Request" header and
provides an interface that wraps this Thrift model. You should not need to
interact with this model directly, but rather through the EdgeRequestContext
interface provided by baseplate.
*/
struct Request {
1: Loid loid;
2: Session session;
3: AuthenticationToken authentication_token;
4: Device device;
5: OriginService origin_service;
6: Geolocation geolocation;
7: optional RequestId request_id;
8: optional Locale locale;
}