Skip to content

Commit 53b9445

Browse files
committed
Address code review feedback
1 parent 411836d commit 53b9445

File tree

10 files changed

+100
-58
lines changed

10 files changed

+100
-58
lines changed

reference/auth.v1.yaml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ paths:
692692
schema:
693693
$ref: ./auth/models/consent/consents.v1.yaml
694694
operationId: ListConsents
695-
description: Retrieves the list of all different consent types and their content. By default returns only the latest version for each consent type. This can be override by setting the `version` query parameter to `all`
695+
description: Retrieves the list of all different consent types and their content. By default returns only the latest version for each consent type. This can be overriden by setting the `version` query parameter to `all`
696696
requestBody:
697697
content: {}
698698
parameters:
@@ -706,13 +706,9 @@ paths:
706706
name: version
707707
description: Whether to return all versions or only the most recent one.
708708
parameters: []
709-
'/v1/consents/{type}':
709+
'/v1/consents/{consentType}':
710710
parameters:
711-
- schema:
712-
type: string
713-
name: type
714-
in: path
715-
required: true
711+
- $ref: '#/components/parameters/consentType'
716712
get:
717713
summary: Get Latest Consent By Type
718714
tags: []
@@ -725,13 +721,9 @@ paths:
725721
$ref: ./auth/models/consent/consent.v1.yaml
726722
operationId: GetLatestConsentByType
727723
description: Returns the latest consent version for the given type
728-
'/v1/consent/{type}/versions':
724+
'/v1/consent/{consentType}/versions':
729725
parameters:
730-
- schema:
731-
type: string
732-
name: type
733-
in: path
734-
required: true
726+
- $ref: '#/components/parameters/consentType'
735727
get:
736728
summary: Get Consent Versions
737729
tags: []
@@ -742,15 +734,11 @@ paths:
742734
application/json:
743735
schema:
744736
$ref: ./auth/models/consent/consents.v1.yaml
745-
operationId: GetConentVersions
737+
operationId: GetConsentVersions
746738
description: Returns a list of all consent versions for a given type
747739
'/v1/users/{userId}/consents':
748740
parameters:
749-
- schema:
750-
type: string
751-
name: userId
752-
in: path
753-
required: true
741+
- $ref: '#/components/parameters/userId'
754742
get:
755743
summary: Get User Consent Records
756744
tags: []
@@ -795,11 +783,7 @@ paths:
795783
$ref: ./auth/models/consent/recordcreate.v1.yaml
796784
'/v1/users/{userId}/consents/{recordId}':
797785
parameters:
798-
- schema:
799-
type: string
800-
name: userId
801-
in: path
802-
required: true
786+
- $ref: '#/components/parameters/userId'
803787
- schema:
804788
type: string
805789
name: recordId
@@ -818,7 +802,7 @@ paths:
818802
operationId: GetUserConsentRecord
819803
description: Retrieves a consent record by ID for a given user.
820804
patch:
821-
summary: ''
805+
summary: Update User Consent Record
822806
operationId: UpdateUserConsentRecord
823807
responses:
824808
'200':
@@ -833,6 +817,13 @@ paths:
833817
application/json:
834818
schema:
835819
$ref: ./auth/models/consent/recordupdate.v1.yaml
820+
delete:
821+
summary: ''
822+
operationId: RevokeConsent
823+
responses:
824+
'200':
825+
description: OK
826+
description: Revokes a consent record
836827
components:
837828
securitySchemes:
838829
basicAuth:
@@ -1094,3 +1085,16 @@ components:
10941085
required:
10951086
- code
10961087
- reason
1088+
parameters:
1089+
consentType:
1090+
name: consentType
1091+
in: path
1092+
required: true
1093+
schema:
1094+
$ref: ./auth/models/consent/type.v1.yaml
1095+
userId:
1096+
name: userId
1097+
in: path
1098+
required: true
1099+
schema:
1100+
$ref: ./common/models/tidepooluserid.yaml

reference/auth/models/consent/consent.v1.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ description: Consent
33
type: object
44
properties:
55
type:
6-
description: Test
7-
type: string
6+
$ref: ./type.v1.yaml
87
version:
98
type: integer
109
example: 1

reference/auth/models/consent/consentrecord.v1.yaml

Whitespace-only changes.

reference/auth/models/consent/consents.v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ properties:
77
x-stoplight:
88
id: iepviv3jm8m9m
99
type: array
10+
uniqueItems: true
1011
items:
1112
$ref: ./consent.v1.yaml
1213
x-stoplight:
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
title: metadata.tbddp.v1
2+
x-stoplight:
3+
id: 95q0hhj045suc
4+
type: object
5+
properties:
6+
supportedOrganizations:
7+
type: array
8+
uniqueItems: true
9+
description: >-
10+
The list of supported organizations when the consent grant is for the
11+
Tidepool Big Data Donation Project
12+
items:
13+
x-stoplight:
14+
id: whfmccxwfj7zx
15+
type: string
16+
enum:
17+
- ADCES Foundation
18+
- Beyond Type 1
19+
- Children With Diabetes
20+
- The Diabetes Link
21+
- Diabetes Youth Families (DYF)
22+
- DiabetesSisters
23+
- The diaTribe Foundation
24+
- Breakthrough T1D
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
11
title: metadata.v1
22
x-stoplight:
33
id: 8ctwq6xjg496g
4-
type: object
5-
properties:
6-
supportedOrganizations:
7-
type: array
8-
uniqueItems: true
9-
description: The list of supported organizations when the consent grant is for the Tidepool Big Data Donation Project
10-
items:
11-
x-stoplight:
12-
id: iew30v83r2ce5
13-
type: string
14-
enum:
15-
- ADCES Foundation
16-
- Beyond Type 1
17-
- Children With Diabetes
18-
- The Diabetes Link
19-
- Diabetes Youth Families (DYF)
20-
- DiabetesSisters
21-
- The diaTribe Foundation
22-
- Breakthrough T1D
4+
oneOf:
5+
- $ref: ./metadata.tbddp.v1.yaml

reference/auth/models/consent/record.v1.yaml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,39 @@ properties:
1515
- active
1616
- revoked
1717
readOnly: true
18-
type:
18+
ageGroup:
19+
type: string
20+
x-stoplight:
21+
id: u5whtndrytunl
22+
enum:
23+
- <12
24+
- 13-17
25+
- 18+
26+
ownerName:
27+
type: string
28+
x-stoplight:
29+
id: 2cw4335ateapa
30+
description: The name of the account owner
31+
parentGuardianName:
32+
type: string
33+
x-stoplight:
34+
id: 94pqubqvzwigs
35+
description: The name of the parent or legal guardian granting the consent. Required if ageGroup is '<12' or '13-17'.
36+
grantorType:
1937
type: string
38+
x-stoplight:
39+
id: zc8e4q8t37yig
40+
enum:
41+
- owner
42+
- parent/guardian
43+
type:
44+
$ref: ./type.v1.yaml
2045
x-stoplight:
2146
id: jub0w6n4sx03g
22-
minLength: 1
23-
maxLength: 100
47+
metadata:
48+
$ref: ./metadata.v1.yaml
49+
x-stoplight:
50+
id: u4fzjwa9iivzp
2451
version:
2552
type: integer
2653
x-stoplight:
@@ -50,13 +77,12 @@ properties:
5077
id: ohlc8mndn74ov
5178
format: date-time
5279
readOnly: true
53-
metadata:
54-
$ref: ./metadata.v1.yaml
55-
x-stoplight:
56-
id: u4fzjwa9iivzp
5780
required:
5881
- id
5982
- status
83+
- ageGroup
84+
- ownerName
85+
- grantorType
6086
- type
6187
- version
6288
- grantTime

reference/auth/models/consent/records.v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ properties:
77
type: array
88
x-stoplight:
99
id: whbezmg3q7pxh
10+
uniqueItems: true
1011
items:
1112
$ref: ./record.v1.yaml
1213
x-stoplight:

reference/auth/models/consent/recordupdate.v1.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ x-stoplight:
33
id: c8oq1dn4m4uak
44
type: object
55
properties:
6-
status:
7-
type: string
6+
metadata:
7+
$ref: ./metadata.v1.yaml
88
x-stoplight:
99
id: 2hnhmpwbyck12
10-
enum:
11-
- revoked
1210
required:
13-
- status
11+
- metadata
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
title: Consent Type
2+
x-stoplight:
3+
id: r396s741z1sca
4+
type: string
5+
pattern: '^[a-z0-9_-]{3,64}$'
6+
example: big_data_donation_project

0 commit comments

Comments
 (0)