sefrone-api-e2e 1.4.1__tar.gz → 1.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/PKG-INFO +1 -1
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/1_normal_auth_flow.yaml +23 -0
- sefrone_api_e2e-1.4.3/sefrone_api_e2e/e2e/Scenarios/Auth/9a_email_identity_and_linked_projects_flow.yaml +236 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_postgresql.py +1 -1
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/PKG-INFO +1 -1
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/SOURCES.txt +1 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/setup.py +1 -1
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/README.md +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/__init__.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/api_e2e_manager.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/0_check_features.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/2_account_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/3_admin_account_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/4_workspace_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/5_apikey_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/6_project_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/7_email_2fa_flow.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/8_temporary_passwords_flow.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Auth/9_project_account_access_control_flow.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Oidc/1_relying_party_admin.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Oidc/2_authorization_code_flow.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Oidc/3_disable_propagation_flow.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e/Scenarios/Oidc/4_multi_project_isolation.yaml +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/e2e_scenarios_manager.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/env_patch.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/json_mock_server.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_assets.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_csv.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_email_mock.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_excel.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_mysql.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_rest_api.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_satim_mock.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/runner_webhook_mock.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e/step_runner.py +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/dependency_links.txt +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/requires.txt +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/top_level.txt +0 -0
- {sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/setup.cfg +0 -0
|
@@ -18,9 +18,32 @@ steps:
|
|
|
18
18
|
response:
|
|
19
19
|
token: string
|
|
20
20
|
projectId: string
|
|
21
|
+
tokenExpiryDate: datetime
|
|
21
22
|
save:
|
|
22
23
|
login_token: "{{body.response.token}}"
|
|
23
24
|
login_project_id: "{{body.response.projectId}}"
|
|
25
|
+
login_token_expiry: "{{body.response.tokenExpiryDate}}"
|
|
26
|
+
|
|
27
|
+
- name: "Extend token expiry"
|
|
28
|
+
method: "POST"
|
|
29
|
+
endpoint: "/api/v1/apiAuth/token/extend"
|
|
30
|
+
request_headers:
|
|
31
|
+
- x-api-token: "{$stored.login_token}"
|
|
32
|
+
expect:
|
|
33
|
+
status: 200
|
|
34
|
+
body:
|
|
35
|
+
errorCode: number
|
|
36
|
+
errorCodeStr: string
|
|
37
|
+
message: string
|
|
38
|
+
response:
|
|
39
|
+
id: string
|
|
40
|
+
accountId: string
|
|
41
|
+
token: string
|
|
42
|
+
expiryDate: datetime
|
|
43
|
+
device: string
|
|
44
|
+
assertions:
|
|
45
|
+
- "{{body.response.token}} == '{$stored.login_token}'"
|
|
46
|
+
- "{{body.response.expiryDate}} > '{$stored.login_token_expiry}'"
|
|
24
47
|
|
|
25
48
|
- name: "Generate unique test suffix"
|
|
26
49
|
randomize:
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Journey: an account is identified by email across the system. Email is normalized to lowercase on
|
|
2
|
+
# write, and lookups (e.g. login pseudo) are case-insensitive, so a user can log in regardless of the
|
|
3
|
+
# casing they type. The same account can then see which project(s) it is linked to, and with what
|
|
4
|
+
# account type it holds in each — a project link is no longer just an id/name pair.
|
|
5
|
+
name: "Email Identity And Linked Projects Flow"
|
|
6
|
+
base_url: "http://localhost:$var(API_PUBLIC_PORT)"
|
|
7
|
+
skip_if:
|
|
8
|
+
- "Accounts not in {$stored.0_check_features.enabled_features}"
|
|
9
|
+
steps:
|
|
10
|
+
- name: "Login admin"
|
|
11
|
+
retry:
|
|
12
|
+
attempts: 10
|
|
13
|
+
delay_seconds: 5
|
|
14
|
+
method: "POST"
|
|
15
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
|
|
16
|
+
send_as: "json"
|
|
17
|
+
body:
|
|
18
|
+
device: "e2e_test_device"
|
|
19
|
+
pseudo: "$var(DEFAULT_USERNAME)"
|
|
20
|
+
password: "$var(DEFAULT_PASSWORD)"
|
|
21
|
+
expect:
|
|
22
|
+
status: 200
|
|
23
|
+
body:
|
|
24
|
+
response:
|
|
25
|
+
token: string
|
|
26
|
+
save:
|
|
27
|
+
admin_token: "{{body.response.token}}"
|
|
28
|
+
|
|
29
|
+
- name: "Generate unique test suffix"
|
|
30
|
+
randomize:
|
|
31
|
+
seed_id: 8
|
|
32
|
+
|
|
33
|
+
- name: "Create standard account with a mixed-case email"
|
|
34
|
+
method: "POST"
|
|
35
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/create?accountType=standard"
|
|
36
|
+
request_headers:
|
|
37
|
+
- x-api-token: "{$stored.admin_token}"
|
|
38
|
+
send_as: "json"
|
|
39
|
+
body:
|
|
40
|
+
username: "e2e_linked_{$stored.seed_id}"
|
|
41
|
+
email: "E2E_Linked_{$stored.seed_id}@EXAMPLE.COM"
|
|
42
|
+
password: "e2e_linked_pwd_v1"
|
|
43
|
+
expect:
|
|
44
|
+
status: 200
|
|
45
|
+
body:
|
|
46
|
+
errorCode: number
|
|
47
|
+
errorCodeStr: string
|
|
48
|
+
message: string
|
|
49
|
+
response:
|
|
50
|
+
accountId: string
|
|
51
|
+
accountType: string
|
|
52
|
+
email: string
|
|
53
|
+
save:
|
|
54
|
+
created_account_id: "{{body.response.accountId}}"
|
|
55
|
+
assertions:
|
|
56
|
+
- "{{body.response.accountType}} == 'standard'"
|
|
57
|
+
- "{{body.response.email}} == 'e2e_linked_{$stored.seed_id}@example.com'"
|
|
58
|
+
|
|
59
|
+
- name: "Creating another account with a different casing of the same email is rejected as a duplicate"
|
|
60
|
+
method: "POST"
|
|
61
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/create?accountType=standard"
|
|
62
|
+
request_headers:
|
|
63
|
+
- x-api-token: "{$stored.admin_token}"
|
|
64
|
+
send_as: "json"
|
|
65
|
+
body:
|
|
66
|
+
username: "e2e_linked_dup_{$stored.seed_id}"
|
|
67
|
+
email: "e2e_linked_{$stored.seed_id}@example.com"
|
|
68
|
+
password: "e2e_linked_pwd_v2"
|
|
69
|
+
expect:
|
|
70
|
+
status: 422
|
|
71
|
+
body:
|
|
72
|
+
errorCode: number
|
|
73
|
+
errorCodeStr: string
|
|
74
|
+
message: string
|
|
75
|
+
|
|
76
|
+
- name: "Login using a different casing of the same email"
|
|
77
|
+
method: "POST"
|
|
78
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
|
|
79
|
+
send_as: "json"
|
|
80
|
+
body:
|
|
81
|
+
device: "e2e_test_device"
|
|
82
|
+
pseudo: "E2E_LINKED_{$stored.seed_id}@EXAMPLE.COM"
|
|
83
|
+
password: "e2e_linked_pwd_v1"
|
|
84
|
+
expect:
|
|
85
|
+
status: 200
|
|
86
|
+
body:
|
|
87
|
+
response:
|
|
88
|
+
accountId: string
|
|
89
|
+
token: string
|
|
90
|
+
save:
|
|
91
|
+
account_token: "{{body.response.token}}"
|
|
92
|
+
assertions:
|
|
93
|
+
- "{{body.response.accountId}} == '{$stored.created_account_id}'"
|
|
94
|
+
|
|
95
|
+
- name: "Get info - verify linked project carries this account's type"
|
|
96
|
+
method: "GET"
|
|
97
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/info/{$stored.account_token}"
|
|
98
|
+
expect:
|
|
99
|
+
status: 200
|
|
100
|
+
body:
|
|
101
|
+
errorCode: number
|
|
102
|
+
errorCodeStr: string
|
|
103
|
+
message: string
|
|
104
|
+
response:
|
|
105
|
+
accountId: string
|
|
106
|
+
email: string
|
|
107
|
+
linkedProjects:
|
|
108
|
+
- id: string
|
|
109
|
+
name: string
|
|
110
|
+
description: string
|
|
111
|
+
isActive: boolean
|
|
112
|
+
accountType: string
|
|
113
|
+
assertions:
|
|
114
|
+
- "{{body.response.email}} == 'e2e_linked_{$stored.seed_id}@example.com'"
|
|
115
|
+
- "{{body.response.linkedProjects.count()}} >= 1"
|
|
116
|
+
- "{{body.response.linkedProjects[0].name}} == '$var(AUTH_PROJECT_NAME)'"
|
|
117
|
+
- "{{body.response.linkedProjects[0].isActive}} == True"
|
|
118
|
+
- "{{body.response.linkedProjects[0].accountType}} == 'standard'"
|
|
119
|
+
|
|
120
|
+
- name: "Cleanup: deactivate the created account"
|
|
121
|
+
method: "POST"
|
|
122
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/activationState/{$stored.created_account_id}?isActive=false"
|
|
123
|
+
request_headers:
|
|
124
|
+
- x-api-token: "{$stored.admin_token}"
|
|
125
|
+
expect:
|
|
126
|
+
status: 200
|
|
127
|
+
body:
|
|
128
|
+
errorCode: number
|
|
129
|
+
errorCodeStr: string
|
|
130
|
+
message: string
|
|
131
|
+
|
|
132
|
+
- name: "Login should fail for deactivated account"
|
|
133
|
+
method: "POST"
|
|
134
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
|
|
135
|
+
send_as: "json"
|
|
136
|
+
body:
|
|
137
|
+
device: "e2e_test_device"
|
|
138
|
+
pseudo: "e2e_linked_{$stored.seed_id}"
|
|
139
|
+
password: "e2e_linked_pwd_v1"
|
|
140
|
+
expect:
|
|
141
|
+
status: 401
|
|
142
|
+
body:
|
|
143
|
+
errorCode: number
|
|
144
|
+
errorCodeStr: string
|
|
145
|
+
message: string
|
|
146
|
+
|
|
147
|
+
# --- Same identity rule for invited 2FA accounts: an account invited under one casing of its
|
|
148
|
+
# email must still be found (not duplicated, not rejected) when the user later logs in typing
|
|
149
|
+
# their email in a different casing. ---
|
|
150
|
+
|
|
151
|
+
- name: "Invite a new 2FA account with a mixed-case email"
|
|
152
|
+
skip_if:
|
|
153
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
154
|
+
method: "POST"
|
|
155
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/2fa/invite"
|
|
156
|
+
request_headers:
|
|
157
|
+
- x-api-token: "{$stored.admin_token}"
|
|
158
|
+
send_as: "json"
|
|
159
|
+
body:
|
|
160
|
+
email: "E2E_2fa_Case_{$stored.seed_id}@EXAMPLE.COM"
|
|
161
|
+
accountType: "2fa"
|
|
162
|
+
expect:
|
|
163
|
+
status: 200
|
|
164
|
+
body:
|
|
165
|
+
errorCode: number
|
|
166
|
+
errorCodeStr: string
|
|
167
|
+
message: string
|
|
168
|
+
assertions:
|
|
169
|
+
- "{{body.errorCode}} == 0"
|
|
170
|
+
|
|
171
|
+
- name: "Verify invite email was sent"
|
|
172
|
+
skip_if:
|
|
173
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
174
|
+
check_email:
|
|
175
|
+
to: "E2E_2fa_Case_{$stored.seed_id}@EXAMPLE.COM"
|
|
176
|
+
retry:
|
|
177
|
+
attempts: 15
|
|
178
|
+
delay_seconds: 2
|
|
179
|
+
assertions:
|
|
180
|
+
- "{{email.to}} include E2E_2fa_Case_{$stored.seed_id}@EXAMPLE.COM"
|
|
181
|
+
|
|
182
|
+
- name: "Trigger 2FA login with a different casing of the invited email"
|
|
183
|
+
skip_if:
|
|
184
|
+
- "Email2FA not in {$stored.0_check_features.enabled_features}"
|
|
185
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
186
|
+
method: "POST"
|
|
187
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa"
|
|
188
|
+
send_as: "json"
|
|
189
|
+
body:
|
|
190
|
+
email: "e2e_2fa_case_{$stored.seed_id}@example.com"
|
|
191
|
+
device: "e2e_test_device"
|
|
192
|
+
expect:
|
|
193
|
+
status: 200
|
|
194
|
+
body:
|
|
195
|
+
errorCode: number
|
|
196
|
+
errorCodeStr: string
|
|
197
|
+
message: string
|
|
198
|
+
|
|
199
|
+
- name: "Wait for OTP email and extract code"
|
|
200
|
+
skip_if:
|
|
201
|
+
- "Email2FA not in {$stored.0_check_features.enabled_features}"
|
|
202
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
203
|
+
check_email:
|
|
204
|
+
to: "e2e_2fa_case_{$stored.seed_id}@example.com"
|
|
205
|
+
retry:
|
|
206
|
+
attempts: 15
|
|
207
|
+
delay_seconds: 2
|
|
208
|
+
assertions:
|
|
209
|
+
- "{{email.to}} include e2e_2fa_case_{$stored.seed_id}@example.com"
|
|
210
|
+
save:
|
|
211
|
+
otp_code:
|
|
212
|
+
from: "{{email.body}}"
|
|
213
|
+
regex: "(?is)otp\\s*code[\\s\\S]{0,4000}?\\b([0-9]{8})\\b"
|
|
214
|
+
|
|
215
|
+
- name: "Verify OTP - login succeeds against the account created by the invite, not a new one"
|
|
216
|
+
skip_if:
|
|
217
|
+
- "Email2FA not in {$stored.0_check_features.enabled_features}"
|
|
218
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
219
|
+
method: "GET"
|
|
220
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa/verify"
|
|
221
|
+
request_query_params:
|
|
222
|
+
email: "e2e_2fa_case_{$stored.seed_id}@example.com"
|
|
223
|
+
code: "{$stored.otp_code}"
|
|
224
|
+
expect:
|
|
225
|
+
status: 200
|
|
226
|
+
body:
|
|
227
|
+
errorCode: number
|
|
228
|
+
errorCodeStr: string
|
|
229
|
+
message: string
|
|
230
|
+
response:
|
|
231
|
+
accountId: string
|
|
232
|
+
accountType: string
|
|
233
|
+
token: string
|
|
234
|
+
assertions:
|
|
235
|
+
- "{{body.errorCode}} == 0"
|
|
236
|
+
- "{{body.response.accountType}} == '2fa'"
|
|
@@ -75,7 +75,7 @@ class PostgresqlRunner(StepRunner):
|
|
|
75
75
|
def setup(self, env_file_path: str) -> None:
|
|
76
76
|
global psycopg2
|
|
77
77
|
from sefrone_bootstrap.bootstrap_package import PackageManager
|
|
78
|
-
PackageManager.setup([("psycopg2-binary", "2.9.
|
|
78
|
+
PackageManager.setup([("psycopg2-binary", "2.9.11")])
|
|
79
79
|
import psycopg2
|
|
80
80
|
import psycopg2.extras
|
|
81
81
|
|
|
@@ -30,6 +30,7 @@ sefrone_api_e2e/e2e/Scenarios/Auth/6_project_endpoints.yaml
|
|
|
30
30
|
sefrone_api_e2e/e2e/Scenarios/Auth/7_email_2fa_flow.yaml
|
|
31
31
|
sefrone_api_e2e/e2e/Scenarios/Auth/8_temporary_passwords_flow.yaml
|
|
32
32
|
sefrone_api_e2e/e2e/Scenarios/Auth/9_project_account_access_control_flow.yaml
|
|
33
|
+
sefrone_api_e2e/e2e/Scenarios/Auth/9a_email_identity_and_linked_projects_flow.yaml
|
|
33
34
|
sefrone_api_e2e/e2e/Scenarios/Oidc/1_relying_party_admin.yaml
|
|
34
35
|
sefrone_api_e2e/e2e/Scenarios/Oidc/2_authorization_code_flow.yaml
|
|
35
36
|
sefrone_api_e2e/e2e/Scenarios/Oidc/3_disable_propagation_flow.yaml
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="sefrone_api_e2e",
|
|
8
|
-
version="1.4.
|
|
8
|
+
version="1.4.3",
|
|
9
9
|
author="Sefrone",
|
|
10
10
|
author_email="contact@sefrone.com",
|
|
11
11
|
description="A Python package to provide e2e testing helpers for sefrone API projects",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sefrone_api_e2e-1.4.1 → sefrone_api_e2e-1.4.3}/sefrone_api_e2e.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|