Skip to content

Commit 18963b8

Browse files
Brent1LTBrent Bumann
and
Brent Bumann
authored
Spec Update 10/11/2022 (dropbox#75)
Change Notes: openid_openid_types Namespace - Add OpenIdError, UserInfoError unions - Remove UserInfoError structs - Remove AuthError unions - Update UserInfoArgs struct to include documentation team_policies Namespace - Add examples Co-authored-by: Brent Bumann <bbumann@dropbox.com>
1 parent c36ba27 commit 18963b8

File tree

3 files changed

+150
-10
lines changed

3 files changed

+150
-10
lines changed

openid_openid_types.stone

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ namespace openid
44

55
import common
66

7-
union AuthError
8-
invalid_token
9-
no_openid_auth
7+
union OpenIdError
8+
incorrect_openid_scopes
9+
"Missing openid claims for the associated access token."
1010

1111

12-
struct UserInfoError
13-
err err_union?
14-
union
15-
auth_error AuthError = invalid_token
16-
error_message String = ""
17-
"Brief explanation of the error."
12+
union UserInfoError
13+
openid_error OpenIdError = incorrect_openid_scopes
1814

1915
struct UserInfoArgs
20-
"This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."
16+
"No Parameters"
2117

2218
struct UserInfoResult
2319
family_name String?

team_policies.stone

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ struct TeamSharingPolicies
3232
"Which shared folders team members can join."
3333
shared_link_create_policy SharedLinkCreatePolicy
3434
"Who can view shared links owned by team members."
35+
group_creation_policy GroupCreation
36+
"Who can create groups."
3537

3638
example default
3739
shared_folder_member_policy = team
3840
shared_folder_join_policy = from_anyone
3941
shared_link_create_policy = team_only
42+
group_creation_policy = admins_only
4043

4144
# NOTE: we do not reuse sharing.MemberPolicy here since we may want to enable folder-specific member
4245
# policies that work on top of the broader team policies.

team_sharing_allowlist.stone

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
namespace team
2+
3+
import common
4+
5+
struct SharingAllowlistAddArgs
6+
"Structure representing Approve List entries. Domain and emails are supported.
7+
At least one entry of any supported type is required."
8+
domains List(String)?
9+
"List of domains represented by valid string representation (RFC-1034/5)."
10+
emails List(String)?
11+
"List of emails represented by valid string representation (RFC-5322/822)."
12+
13+
example default
14+
domains = ["test-domain.com", "subdomain.some.com"]
15+
emails = ["adam@test-domain.com", "john@some.com"]
16+
17+
struct SharingAllowlistAddResponse
18+
"This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."
19+
20+
union SharingAllowlistAddError
21+
malformed_entry String
22+
"One of provided values is not valid."
23+
no_entries_provided
24+
"Neither single domain nor email provided."
25+
too_many_entries_provided
26+
"Too many entries provided within one call."
27+
team_limit_reached
28+
"Team entries limit reached."
29+
unknown_error
30+
"Unknown error."
31+
entries_already_exist String
32+
"Entries already exists."
33+
34+
35+
struct SharingAllowlistListArg
36+
limit UInt32(max_value=1000, min_value=1) = 1000
37+
"The number of entries to fetch at one time."
38+
39+
example default
40+
limit = 100
41+
42+
struct SharingAllowlistListContinueArg
43+
cursor String
44+
"The cursor returned from a previous call to :route:`sharing_allowlist/list` or :route:`sharing_allowlist/list/continue`."
45+
46+
example default
47+
cursor = "dGVzdF9jdXJzb3IK"
48+
49+
struct SharingAllowlistListError
50+
"This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."
51+
52+
struct SharingAllowlistListResponse
53+
domains List(String)
54+
"List of domains represented by valid string representation (RFC-1034/5)."
55+
emails List(String)
56+
"List of emails represented by valid string representation (RFC-5322/822)."
57+
cursor String = ""
58+
"If this is nonempty, there are more entries that can be fetched with :route:`sharing_allowlist/list/continue`."
59+
has_more Boolean = false
60+
"if true indicates that more entries can be fetched with :route:`sharing_allowlist/list/continue`."
61+
62+
example default
63+
domains = ["test-domain.com", "subdomain.some.com"]
64+
emails = ["adam@test-domain.com", "john@some.com"]
65+
cursor = "dGVzdF9jdXJzb3IK"
66+
has_more = true
67+
68+
union SharingAllowlistListContinueError
69+
invalid_cursor
70+
"Provided cursor is not valid."
71+
72+
struct SharingAllowlistRemoveArgs
73+
domains List(String)?
74+
"List of domains represented by valid string representation (RFC-1034/5)."
75+
emails List(String)?
76+
"List of emails represented by valid string representation (RFC-5322/822)."
77+
78+
example default
79+
domains = ["test-domain.com", "subdomain.some.com"]
80+
emails = ["adam@test-domain.com", "john@some.com"]
81+
82+
83+
struct SharingAllowlistRemoveResponse
84+
"This struct is empty. The comment here is intentionally emitted to avoid indentation issues with Stone."
85+
86+
union SharingAllowlistRemoveError
87+
malformed_entry String
88+
"One of provided values is not valid."
89+
entries_do_not_exist String
90+
"One or more provided values do not exist."
91+
no_entries_provided
92+
"Neither single domain nor email provided."
93+
too_many_entries_provided
94+
"Too many entries provided within one call."
95+
unknown_error
96+
"Unknown error."
97+
98+
99+
route sharing_allowlist/add (SharingAllowlistAddArgs, SharingAllowlistAddResponse, SharingAllowlistAddError)
100+
"Endpoint adds Approve List entries. Changes are effective immediately.
101+
Changes are committed in transaction. In case of single validation error - all entries are rejected.
102+
Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted.
103+
Added entries cannot overflow limit of 10000 entries per team.
104+
Maximum 100 entries per call is allowed."
105+
106+
attrs
107+
auth = "team"
108+
is_preview = true
109+
scope = "team_info.write"
110+
111+
route sharing_allowlist/list (SharingAllowlistListArg, SharingAllowlistListResponse, SharingAllowlistListError)
112+
"Lists Approve List entries for given team, from newest to oldest, returning
113+
up to `limit` entries at a time. If there are more than `limit` entries
114+
associated with the current team, more can be fetched by passing the
115+
returned `cursor` to :route:`sharing_allowlist/list/continue`."
116+
117+
attrs
118+
auth = "team"
119+
is_preview = true
120+
scope = "team_info.read"
121+
122+
route sharing_allowlist/list/continue (SharingAllowlistListContinueArg, SharingAllowlistListResponse, SharingAllowlistListContinueError)
123+
"Lists entries associated with given team, starting from a the cursor. See :route:`sharing_allowlist/list`."
124+
125+
attrs
126+
auth = "team"
127+
is_preview = true
128+
scope = "team_info.read"
129+
130+
route sharing_allowlist/remove (SharingAllowlistRemoveArgs, SharingAllowlistRemoveResponse, SharingAllowlistRemoveError)
131+
"Endpoint removes Approve List entries. Changes are effective immediately.
132+
Changes are committed in transaction. In case of single validation error - all entries are rejected.
133+
Valid domains (RFC-1034/5) and emails (RFC-5322/822) are accepted.
134+
Entries being removed have to be present on the list.
135+
Maximum 1000 entries per call is allowed."
136+
137+
attrs
138+
auth = "team"
139+
is_preview = true
140+
scope = "team_info.write"
141+

0 commit comments

Comments
 (0)