atproto blogging
1{
2 "lexicon": 1,
3 "id": "app.bsky.ageassurance.defs",
4 "defs": {
5 "access": {
6 "type": "string",
7 "description": "The access level granted based on Age Assurance data we've processed.",
8 "knownValues": [
9 "unknown",
10 "none",
11 "safe",
12 "full"
13 ]
14 },
15 "config": {
16 "type": "object",
17 "description": "",
18 "required": [
19 "regions"
20 ],
21 "properties": {
22 "regions": {
23 "type": "array",
24 "description": "The per-region Age Assurance configuration.",
25 "items": {
26 "type": "ref",
27 "ref": "app.bsky.ageassurance.defs#configRegion"
28 }
29 }
30 }
31 },
32 "configRegion": {
33 "type": "object",
34 "description": "The Age Assurance configuration for a specific region.",
35 "required": [
36 "countryCode",
37 "rules"
38 ],
39 "properties": {
40 "countryCode": {
41 "type": "string",
42 "description": "The ISO 3166-1 alpha-2 country code this configuration applies to."
43 },
44 "regionCode": {
45 "type": "string",
46 "description": "The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country."
47 },
48 "rules": {
49 "type": "array",
50 "description": "The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item.",
51 "items": {
52 "type": "union",
53 "refs": [
54 "#configRegionRuleDefault",
55 "#configRegionRuleIfDeclaredOverAge",
56 "#configRegionRuleIfDeclaredUnderAge",
57 "#configRegionRuleIfAssuredOverAge",
58 "#configRegionRuleIfAssuredUnderAge",
59 "#configRegionRuleIfAccountNewerThan",
60 "#configRegionRuleIfAccountOlderThan"
61 ]
62 }
63 }
64 }
65 },
66 "configRegionRuleDefault": {
67 "type": "object",
68 "description": "Age Assurance rule that applies by default.",
69 "required": [
70 "access"
71 ],
72 "properties": {
73 "access": {
74 "type": "ref",
75 "ref": "app.bsky.ageassurance.defs#access"
76 }
77 }
78 },
79 "configRegionRuleIfAccountNewerThan": {
80 "type": "object",
81 "description": "Age Assurance rule that applies if the account is equal-to or newer than a certain date.",
82 "required": [
83 "date",
84 "access"
85 ],
86 "properties": {
87 "access": {
88 "type": "ref",
89 "ref": "app.bsky.ageassurance.defs#access"
90 },
91 "date": {
92 "type": "string",
93 "description": "The date threshold as a datetime string.",
94 "format": "datetime"
95 }
96 }
97 },
98 "configRegionRuleIfAccountOlderThan": {
99 "type": "object",
100 "description": "Age Assurance rule that applies if the account is older than a certain date.",
101 "required": [
102 "date",
103 "access"
104 ],
105 "properties": {
106 "access": {
107 "type": "ref",
108 "ref": "app.bsky.ageassurance.defs#access"
109 },
110 "date": {
111 "type": "string",
112 "description": "The date threshold as a datetime string.",
113 "format": "datetime"
114 }
115 }
116 },
117 "configRegionRuleIfAssuredOverAge": {
118 "type": "object",
119 "description": "Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age.",
120 "required": [
121 "age",
122 "access"
123 ],
124 "properties": {
125 "access": {
126 "type": "ref",
127 "ref": "app.bsky.ageassurance.defs#access"
128 },
129 "age": {
130 "type": "integer",
131 "description": "The age threshold as a whole integer."
132 }
133 }
134 },
135 "configRegionRuleIfAssuredUnderAge": {
136 "type": "object",
137 "description": "Age Assurance rule that applies if the user has been assured to be under a certain age.",
138 "required": [
139 "age",
140 "access"
141 ],
142 "properties": {
143 "access": {
144 "type": "ref",
145 "ref": "app.bsky.ageassurance.defs#access"
146 },
147 "age": {
148 "type": "integer",
149 "description": "The age threshold as a whole integer."
150 }
151 }
152 },
153 "configRegionRuleIfDeclaredOverAge": {
154 "type": "object",
155 "description": "Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age.",
156 "required": [
157 "age",
158 "access"
159 ],
160 "properties": {
161 "access": {
162 "type": "ref",
163 "ref": "app.bsky.ageassurance.defs#access"
164 },
165 "age": {
166 "type": "integer",
167 "description": "The age threshold as a whole integer."
168 }
169 }
170 },
171 "configRegionRuleIfDeclaredUnderAge": {
172 "type": "object",
173 "description": "Age Assurance rule that applies if the user has declared themselves under a certain age.",
174 "required": [
175 "age",
176 "access"
177 ],
178 "properties": {
179 "access": {
180 "type": "ref",
181 "ref": "app.bsky.ageassurance.defs#access"
182 },
183 "age": {
184 "type": "integer",
185 "description": "The age threshold as a whole integer."
186 }
187 }
188 },
189 "event": {
190 "type": "object",
191 "description": "Object used to store Age Assurance data in stash.",
192 "required": [
193 "createdAt",
194 "status",
195 "access",
196 "attemptId",
197 "countryCode"
198 ],
199 "properties": {
200 "access": {
201 "type": "string",
202 "description": "The access level granted based on Age Assurance data we've processed.",
203 "knownValues": [
204 "unknown",
205 "none",
206 "safe",
207 "full"
208 ]
209 },
210 "attemptId": {
211 "type": "string",
212 "description": "The unique identifier for this instance of the Age Assurance flow, in UUID format."
213 },
214 "completeIp": {
215 "type": "string",
216 "description": "The IP address used when completing the Age Assurance flow."
217 },
218 "completeUa": {
219 "type": "string",
220 "description": "The user agent used when completing the Age Assurance flow."
221 },
222 "countryCode": {
223 "type": "string",
224 "description": "The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow."
225 },
226 "createdAt": {
227 "type": "string",
228 "description": "The date and time of this write operation.",
229 "format": "datetime"
230 },
231 "email": {
232 "type": "string",
233 "description": "The email used for Age Assurance."
234 },
235 "initIp": {
236 "type": "string",
237 "description": "The IP address used when initiating the Age Assurance flow."
238 },
239 "initUa": {
240 "type": "string",
241 "description": "The user agent used when initiating the Age Assurance flow."
242 },
243 "regionCode": {
244 "type": "string",
245 "description": "The ISO 3166-2 region code provided when beginning the Age Assurance flow."
246 },
247 "status": {
248 "type": "string",
249 "description": "The status of the Age Assurance process.",
250 "knownValues": [
251 "unknown",
252 "pending",
253 "assured",
254 "blocked"
255 ]
256 }
257 }
258 },
259 "state": {
260 "type": "object",
261 "description": "The user's computed Age Assurance state.",
262 "required": [
263 "status",
264 "access"
265 ],
266 "properties": {
267 "access": {
268 "type": "ref",
269 "ref": "app.bsky.ageassurance.defs#access"
270 },
271 "lastInitiatedAt": {
272 "type": "string",
273 "description": "The timestamp when this state was last updated.",
274 "format": "datetime"
275 },
276 "status": {
277 "type": "ref",
278 "ref": "app.bsky.ageassurance.defs#status"
279 }
280 }
281 },
282 "stateMetadata": {
283 "type": "object",
284 "description": "Additional metadata needed to compute Age Assurance state client-side.",
285 "required": [],
286 "properties": {
287 "accountCreatedAt": {
288 "type": "string",
289 "description": "The account creation timestamp.",
290 "format": "datetime"
291 }
292 }
293 },
294 "status": {
295 "type": "string",
296 "description": "The status of the Age Assurance process.",
297 "knownValues": [
298 "unknown",
299 "pending",
300 "assured",
301 "blocked"
302 ]
303 }
304 }
305}