-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yaml
451 lines (451 loc) · 14.5 KB
/
openapi.yaml
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
openapi: 3.0.1
info:
title: GDPR Subject Rights API
version: 0.1.0
description: >-
This is an OpenAPI specification that intends to be a partial solution for
managing the European Global Data Protection Regulation (GDPR) data subject
rights in an enterprise setting. It standardizes the way back office
services comply to data export and deletion requests.
contact:
name: Open Github issue
url: 'https://github.com/F-Secure/gdpr-api/issues/new'
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
externalDocs:
description: Supporting documentation on GitHub
url: 'https://github.com/F-Secure/gdpr-api'
tags:
- name: flags
description: Togglable flags on personal data use
- name: export
description: Access to personal data
- name: deletion
description: Deletion of personal data
paths:
/contexts:
get:
tags:
- flags
- export
- deletion
summary: Get personal data contexts
description: >-
The API exposes actions against contexts (logical groups) of personal
data in the given system. The grouping should be based on usage, e.g.,
personal data used for marketing, personal data collected for usage
analysis, or personal data processed for technical realisation of the
service. The same personal data type (e.g., an email address) may be in
several contexts; this does not imply it would be actually duplicated in
the system, but it could be used in different contexts. Typically, a
single context should not contain data that is processed under different
basis of processing.
parameters:
- name: Accept-Language
description: A list of accepted languages.
in: header
schema:
type: string
required: false
example: fi_FI
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ContextsResponse'
'400':
description: Invalid Request
'404':
description: No UUID found
'/exportrequests/{context_uuid}':
post:
tags:
- export
summary: Export personal data
description: >-
Create an export request to export all personal data stored within a
particular personal data context. This will only schedule an export. The
status and result must be polled for separately.
parameters:
- in: path
name: context_uuid
required: true
description: The personal data context (data category) to export.
schema:
$ref: '#/components/schemas/ContextUUID'
requestBody:
description: >-
Authenticated identifiers for the data subject whose data should be
operated on.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExportRequest'
responses:
'202':
description: Export request queued
content:
application/json:
schema:
$ref: '#/components/schemas/ExportRequestResponse'
'400':
description: Invalid
'403':
description: Insufficient authenticated identifiers
'404':
description: No UUID for these identifiers found
/exportrequeststatus:
post:
tags:
- export
summary: Query the status of an export request
description: >-
Query the status of an export request. The status should be polled for
until completed. The location of the exported content is communicated
once the export request is completed.
parameters:
- name: Accept-Language
description: A list of accepted languages.
in: header
schema:
type: string
required: false
example: fi_FI
requestBody:
description: The unique id for a particular on-going export request.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExportRequestResponse'
responses:
'102':
description: Export request being processed
'200':
description: Export ready
content:
application/json:
schema:
$ref: '#/components/schemas/ExportReadyResponse'
'400':
description: Invalid
'404':
description: No data for these identifiers found.
'451':
description: Partial export ready
content:
application/json:
schema:
$ref: '#/components/schemas/ExportPartialReadyResponse'
'/deletionrequests/{context_uuid}':
post:
tags:
- deletion
summary: Delete personal data
description: >-
Create a deletion request to delete all personal data stored within a
particular personal data context. This will only schedule a deletion.
The status and result must be polled for separately.
parameters:
- in: path
name: context_uuid
required: true
description: The personal data context (data category) to delete.
schema:
$ref: '#/components/schemas/ContextUUID'
requestBody:
description: >-
Authenticated identifiers for the data subject whose data should be
operated on. A deletion request must have a justification from a data
subject.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeletionRequest'
responses:
'202':
description: Deletion request queued
content:
application/json:
schema:
$ref: '#/components/schemas/DeletionRequestResponse'
'400':
description: Invalid
'403':
description: Insufficient authenticated identifiers
'404':
description: No UUID for these identifiers found
/deletionrequeststatus:
post:
tags:
- deletion
summary: Query the status of a deletion request
description: >-
Query the status of a deletion request. The status should be polled for
until completed.
parameters:
- name: Accept-Language
description: A list of accepted languages
in: header
schema:
type: string
required: false
example: fi_FI
requestBody:
description: The unique id for a particular on-going deletion request.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeletionRequestResponse'
responses:
'102':
description: Deletion request being processed
'200':
description: Deletion request processed
content:
application/json:
schema:
$ref: '#/components/schemas/DeletionReadyResponse'
'400':
description: Invalid
'404':
description: Deletion request not found
'451':
description: Deletion not possible
content:
application/json:
schema:
$ref: '#/components/schemas/DeletionDeniedResponse'
components:
schemas:
ContextsResponse:
type: array
description: >-
This is a list of personal data contexts, together with required
authentication identifiers needed for the export and delete operations.
items:
type: object
properties:
context-uuid:
$ref: '#/components/schemas/ContextUUID'
deletion_required_auths:
$ref: '#/components/schemas/RequiredAuth'
export_required_auths:
$ref: '#/components/schemas/RequiredAuth'
context_description:
$ref: '#/components/schemas/ContextDescription'
RequiredAuth:
type: array
description: >-
This list contains alternative authentication options (lists) of
required authentication identifiers needed for an export or delete
operation.
items:
type: array
items:
anyOf:
- $ref: '#/components/schemas/TelephoneNumber'
- $ref: '#/components/schemas/EmailAddress'
- $ref: '#/components/schemas/GovernmentIdNumber'
- $ref: '#/components/schemas/CustomIdentifier'
example:
- tel
- email
SuppliedAuth:
type: object
description: >-
A collection of authenticated identifiers uniquely identifying a data
subject. The collection must match one of the alternatives dictated by
the context for the given operation.
properties:
tel:
type: string
description: A telephone number.
example: '+3581234567'
email:
type: string
description: An email address.
example: [email protected]
government_id_number:
type: object
description: A governmental identification number.
required:
- id
- country_code
properties:
id:
type: string
example: 111213-1337
country_code:
type: string
example: fi
custom_identifier:
type: object
description: Any custom identifier.
required:
- name
- value
properties:
name:
type: string
example: our-homegrown-id-foobar
value:
type: string
example: homegrown-id-example
example:
tel: '+3581234567'
email: [email protected]
ExportRequest:
type: object
properties:
authenticated_identifiers:
$ref: '#/components/schemas/SuppliedAuth'
ExportReadyResponse:
type: object
properties:
export-uri:
type: string
description: A unique URL. Should be a short-lived resource.
example: 'https://example.com/data-export/<uuid_token>'
ExportPartialReadyResponse:
type: object
properties:
export-uri:
type: string
description: A unique URL. Should be a short-lived resource.
example: 'https://example.com/data-export/<uuid_token>'
reason:
type: string
description: Human readable reason for why all data could not be exported
example: Legal obligation to not disclose data.
DeletionRequest:
type: object
properties:
request_grounds:
$ref: '#/components/schemas/DeletionRequestGrounds'
authenticated_identifiers:
$ref: '#/components/schemas/SuppliedAuth'
DeletionRequestGrounds:
type: string
description: The data subject's reason for her personal data deletion request.
enum:
- no_longer_necessary
- consent_withdrawn
- objection_to_processing
- processing_unlawful
- legal_compliance
- underage_data_subject
- unspecified
example: consent_withdrawn
TelephoneNumber:
type: string
enum:
- tel
EmailAddress:
type: string
enum:
- email
GovernmentIdNumber:
type: object
enum:
- government_id_number
description: >-
A government-issued ID number, such as a Social Security Number or
Personal ID Number. A country code must be supplied to determine the
issuing country. If not issued by an entity that can be identified using
as country code, use a generic CustomIdentifier instead.
required:
- country_code
properties:
country_code:
type: string
CustomIdentifier:
type: object
description: >-
Any custom, service specific identifier, such as a customer or
subscriber reference number.
required:
- custom_id_name
properties:
custom_id_name:
type: string
ContextDescription:
type: object
properties:
human-readable:
type: string
description: >-
The description of data collected in this context. Should describe
the purpose of processing. Should use the languages in the request
Accept-Language header or a language preference expressed by the
data subject earlier.
example: For use in direct marketing.
ContextUUID:
type: string
example: '1234'
description: A unique context identifier.
ExportRequestResponse:
type: object
properties:
export_request_id:
$ref: '#/components/schemas/ExportRequestUUID'
ExportRequestUUID:
type: string
description: A unique export request identifier.
DeletionRequestResponse:
type: object
properties:
deletion_request_id:
$ref: '#/components/schemas/DeletionRequestUUID'
DeletionRequestUUID:
type: string
description: A unique deletion request identifier.
DeletionReadyResponse:
type: object
required:
- context_uuid
- deletion_feedback
properties:
context_uuid:
$ref: '#/components/schemas/ContextUUID'
deletion_feedback:
type: string
description: State of the performed deletion request.
enum:
- completed
DeletionDeniedReason:
type: string
description: >-
A justification for why a deletion request could not be completely or
partially complied to.
enum:
- freedom_of_expression
- legal_obligation
- public_health_interest
- archival
- legal_claims
- no_personal_data_to_delete
- no_grounds_for_deletion_request
example: public_health_interest
DeletionDeniedResponse:
type: object
required:
- context_uuid
- retention_reason
- retention_human_readable_reason
properties:
context_uuid:
$ref: '#/components/schemas/ContextUUID'
retention_reason:
type: array
items:
$ref: '#/components/schemas/DeletionDeniedReason'
retention_human_readable_reason:
type: string
description: A human readable reason for why the request was denied.