Skip to content

Commit 874e738

Browse files
committed
test(client): loosen the restriction to have one admin member per team by setting permissions to full access
1 parent 2e20395 commit 874e738

File tree

3 files changed

+273
-224
lines changed

3 files changed

+273
-224
lines changed

tests/cassettes/test_create_team_invitation.yaml

Lines changed: 116 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -9,113 +9,127 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- pygitguardian/1.18.0 (Darwin;py3.11.8)
12+
- pygitguardian/1.19.0 (Darwin;py3.11.8)
1313
method: GET
1414
uri: https://api.gitguardian.com/v1/teams?cursor=&per_page=20&is_global=False
1515
response:
1616
body:
1717
string:
18-
'[{"id":19,"is_global":false,"name":"This is a test","description":"","gitguardian_url":"http://localhost:3000/workspace/6/settings/user/teams/19"},{"id":20,"is_global":false,"name":"Team
19-
test","description":"","gitguardian_url":"http://localhost:3000/workspace/6/settings/user/teams/20"},{"id":21,"is_global":false,"name":"PyGitGuardian
20-
team","description":"","gitguardian_url":"http://localhost:3000/workspace/6/settings/user/teams/21"}]'
18+
'[{"id":799237,"is_global":false,"name":"PyGitGuardian Team 1","description":"","gitguardian_url":"https://dashboard.gitguardian.com/workspace/628984/settings/user/teams/799237"},{"id":799238,"is_global":false,"name":"PyGitGuardian
19+
team","description":"","gitguardian_url":"https://dashboard.gitguardian.com/workspace/628984/settings/user/teams/799238"}]'
2120
headers:
22-
Access-Control-Expose-Headers:
21+
access-control-expose-headers:
2322
- X-App-Version
24-
Allow:
23+
allow:
2524
- GET, POST, HEAD, OPTIONS
26-
Connection:
27-
- keep-alive
28-
Content-Length:
29-
- '438'
30-
Content-Type:
25+
content-length:
26+
- '353'
27+
content-type:
3128
- application/json
32-
Cross-Origin-Opener-Policy:
29+
cross-origin-opener-policy:
3330
- same-origin
34-
Date:
35-
- Thu, 12 Dec 2024 16:59:32 GMT
36-
Link:
31+
date:
32+
- Thu, 09 Jan 2025 12:32:16 GMT
33+
link:
3734
- ''
38-
Referrer-Policy:
39-
- same-origin
40-
Server:
41-
- nginx/1.24.0
42-
Vary:
35+
referrer-policy:
36+
- strict-origin-when-cross-origin
37+
server:
38+
- istio-envoy
39+
strict-transport-security:
40+
- max-age=31536000; includeSubDomains
41+
vary:
4342
- Cookie
44-
X-App-Version:
45-
- dev
46-
X-Content-Type-Options:
43+
x-app-version:
44+
- v2.133.1
45+
x-content-type-options:
46+
- nosniff
4747
- nosniff
48-
X-Frame-Options:
48+
x-envoy-upstream-service-time:
49+
- '30'
50+
x-frame-options:
4951
- DENY
50-
X-Per-Page:
52+
- SAMEORIGIN
53+
x-per-page:
5154
- '20'
52-
X-Request-ID:
53-
- c2b0a05b57e590cfaf8f9fe2221eda91
54-
X-SCA-Engine-Version:
55-
- 2.2.0
56-
X-Secrets-Engine-Version:
57-
- 2.127.0
55+
x-sca-engine-version:
56+
- 2.3.0
57+
x-sca-last-vuln-fetch:
58+
- '2025-01-09T11:07:18.494922+00:00'
59+
x-secrets-engine-version:
60+
- 2.129.1
61+
x-xss-protection:
62+
- 1; mode=block
5863
status:
5964
code: 200
6065
message: OK
6166
- request:
62-
body: null
67+
body:
68+
'{"email": "pygitguardian+create_team_invitation@example.com", "access_level":
69+
"member"}'
6370
headers:
6471
Accept:
6572
- '*/*'
6673
Accept-Encoding:
6774
- gzip, deflate
6875
Connection:
6976
- keep-alive
77+
Content-Length:
78+
- '87'
79+
Content-Type:
80+
- application/json
7081
User-Agent:
71-
- pygitguardian/1.18.0 (Darwin;py3.11.8)
72-
method: GET
82+
- pygitguardian/1.19.0 (Darwin;py3.11.8)
83+
method: POST
7384
uri: https://api.gitguardian.com/v1/invitations
7485
response:
7586
body:
76-
string: '[{"id":13,"date":"2024-12-12T16:53:59.247129Z","email":"pygitguardian@example.com","role":"member","access_level":"member"},{"id":14,"date":"2024-12-12T16:54:44.192249Z","email":"example@test.com","role":"member","access_level":"member"}]'
87+
string: '{"id":25184,"date":"2025-01-09T12:32:17.009583Z","email":"pygitguardian+create_team_invitation@example.com","role":"member","access_level":"member"}'
7788
headers:
78-
Access-Control-Expose-Headers:
89+
access-control-expose-headers:
7990
- X-App-Version
80-
Allow:
91+
allow:
8192
- GET, POST, HEAD, OPTIONS
82-
Connection:
83-
- keep-alive
84-
Content-Length:
85-
- '238'
86-
Content-Type:
93+
content-length:
94+
- '148'
95+
content-type:
8796
- application/json
88-
Cross-Origin-Opener-Policy:
89-
- same-origin
90-
Date:
91-
- Thu, 12 Dec 2024 16:59:32 GMT
92-
Link:
93-
- ''
94-
Referrer-Policy:
97+
cross-origin-opener-policy:
9598
- same-origin
96-
Server:
97-
- nginx/1.24.0
98-
Vary:
99+
date:
100+
- Thu, 09 Jan 2025 12:32:17 GMT
101+
referrer-policy:
102+
- strict-origin-when-cross-origin
103+
server:
104+
- istio-envoy
105+
strict-transport-security:
106+
- max-age=31536000; includeSubDomains
107+
vary:
99108
- Cookie
100-
X-App-Version:
101-
- dev
102-
X-Content-Type-Options:
109+
x-app-version:
110+
- v2.133.1
111+
x-content-type-options:
112+
- nosniff
103113
- nosniff
104-
X-Frame-Options:
114+
x-envoy-upstream-service-time:
115+
- '63'
116+
x-frame-options:
105117
- DENY
106-
X-Per-Page:
107-
- '20'
108-
X-Request-ID:
109-
- df09bccf6aea67a2215c5dd905f6033e
110-
X-SCA-Engine-Version:
111-
- 2.2.0
112-
X-Secrets-Engine-Version:
113-
- 2.127.0
118+
- SAMEORIGIN
119+
x-sca-engine-version:
120+
- 2.3.0
121+
x-sca-last-vuln-fetch:
122+
- '2025-01-09T11:07:18.494922+00:00'
123+
x-secrets-engine-version:
124+
- 2.129.1
125+
x-xss-protection:
126+
- 1; mode=block
114127
status:
115-
code: 200
116-
message: OK
128+
code: 201
129+
message: Created
117130
- request:
118-
body: '{"invitation_id": 13, "is_team_leader": true, "incident_permission": "can_view"}'
131+
body: '{"invitation_id": 25184, "is_team_leader": true, "incident_permission":
132+
"can_view"}'
119133
headers:
120134
Accept:
121135
- '*/*'
@@ -124,49 +138,55 @@ interactions:
124138
Connection:
125139
- keep-alive
126140
Content-Length:
127-
- '80'
141+
- '83'
128142
Content-Type:
129143
- application/json
130144
User-Agent:
131-
- pygitguardian/1.18.0 (Darwin;py3.11.8)
145+
- pygitguardian/1.19.0 (Darwin;py3.11.8)
132146
method: POST
133-
uri: https://api.gitguardian.com/v1/teams/19/team_invitations
147+
uri: https://api.gitguardian.com/v1/teams/799237/team_invitations
134148
response:
135149
body:
136-
string: '{"id":7,"team_id":19,"invitation_id":13,"is_team_leader":true,"team_permission":"can_manage","incident_permission":"can_view"}'
150+
string: '{"id":52456,"team_id":799237,"invitation_id":25184,"is_team_leader":true,"team_permission":"can_manage","incident_permission":"can_view"}'
137151
headers:
138-
Access-Control-Expose-Headers:
152+
access-control-expose-headers:
139153
- X-App-Version
140-
Allow:
154+
allow:
141155
- GET, POST, HEAD, OPTIONS
142-
Connection:
143-
- keep-alive
144-
Content-Length:
145-
- '126'
146-
Content-Type:
156+
content-length:
157+
- '137'
158+
content-type:
147159
- application/json
148-
Cross-Origin-Opener-Policy:
149-
- same-origin
150-
Date:
151-
- Thu, 12 Dec 2024 16:59:32 GMT
152-
Referrer-Policy:
160+
cross-origin-opener-policy:
153161
- same-origin
154-
Server:
155-
- nginx/1.24.0
156-
Vary:
162+
date:
163+
- Thu, 09 Jan 2025 12:32:17 GMT
164+
referrer-policy:
165+
- strict-origin-when-cross-origin
166+
server:
167+
- istio-envoy
168+
strict-transport-security:
169+
- max-age=31536000; includeSubDomains
170+
vary:
157171
- Cookie
158-
X-App-Version:
159-
- dev
160-
X-Content-Type-Options:
172+
x-app-version:
173+
- v2.133.1
174+
x-content-type-options:
175+
- nosniff
161176
- nosniff
162-
X-Frame-Options:
177+
x-envoy-upstream-service-time:
178+
- '45'
179+
x-frame-options:
163180
- DENY
164-
X-Request-ID:
165-
- 9ce9f089220243eca87b41bc81b72b73
166-
X-SCA-Engine-Version:
167-
- 2.2.0
168-
X-Secrets-Engine-Version:
169-
- 2.127.0
181+
- SAMEORIGIN
182+
x-sca-engine-version:
183+
- 2.3.0
184+
x-sca-last-vuln-fetch:
185+
- '2025-01-09T11:07:18.494922+00:00'
186+
x-secrets-engine-version:
187+
- 2.129.1
188+
x-xss-protection:
189+
- 1; mode=block
170190
status:
171191
code: 201
172192
message: Created

0 commit comments

Comments
 (0)