sefrone-api-e2e 1.2.8__tar.gz → 1.3.0__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.2.8 → sefrone_api_e2e-1.3.0}/PKG-INFO +1 -1
- sefrone_api_e2e-1.3.0/sefrone_api_e2e/e2e/Scenarios/Auth/7_email_2fa_flow.yaml +155 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/PKG-INFO +1 -1
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/setup.py +1 -1
- sefrone_api_e2e-1.2.8/sefrone_api_e2e/e2e/Scenarios/Auth/7_email_2fa_flow.yaml +0 -79
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/README.md +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/__init__.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/api_e2e_manager.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/0_check_features.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/1_normal_auth_flow.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/2_account_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/3_admin_account_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/4_workspace_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/5_apikey_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/6_project_endpoints.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Auth/8_temporary_passwords_flow.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Oidc/1_relying_party_admin.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Oidc/2_authorization_code_flow.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Oidc/3_disable_propagation_flow.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e/Scenarios/Oidc/4_multi_project_isolation.yaml +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/e2e_scenarios_manager.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/env_patch.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/json_mock_server.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/runner_assets.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/runner_email_mock.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/runner_rest_api.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/runner_satim_mock.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/runner_webhook_mock.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e/step_runner.py +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/SOURCES.txt +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/dependency_links.txt +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/requires.txt +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/top_level.txt +0 -0
- {sefrone_api_e2e-1.2.8 → sefrone_api_e2e-1.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
name: "Email 2FA Flow"
|
|
2
|
+
base_url: "http://localhost:$var(API_PUBLIC_PORT)"
|
|
3
|
+
|
|
4
|
+
# This scenario requires the Email2FA feature to be registered.
|
|
5
|
+
# It also requires the test runner to be started with email_mock=True so that
|
|
6
|
+
# outgoing SMTP mail is captured by the local mock server.
|
|
7
|
+
skip_if:
|
|
8
|
+
- "Email2FA not in {$stored.0_check_features.enabled_features}"
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- name: "Check 2FA project features"
|
|
12
|
+
method: "GET"
|
|
13
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/2fa/features"
|
|
14
|
+
expect:
|
|
15
|
+
status: 200
|
|
16
|
+
body:
|
|
17
|
+
errorCode: number
|
|
18
|
+
errorCodeStr: string
|
|
19
|
+
message: string
|
|
20
|
+
response:
|
|
21
|
+
autoCreateAccount: boolean
|
|
22
|
+
save:
|
|
23
|
+
auto_create_account: "{{body.response.autoCreateAccount}}"
|
|
24
|
+
|
|
25
|
+
- name: "Generate unique test email"
|
|
26
|
+
randomize:
|
|
27
|
+
email_suffix: 12
|
|
28
|
+
|
|
29
|
+
- name: "Trigger 2FA login — send OTP email"
|
|
30
|
+
method: "POST"
|
|
31
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa"
|
|
32
|
+
send_as: "json"
|
|
33
|
+
body:
|
|
34
|
+
email: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
35
|
+
device: "e2e_2fa_device"
|
|
36
|
+
expect:
|
|
37
|
+
status: 200
|
|
38
|
+
body:
|
|
39
|
+
errorCode: number
|
|
40
|
+
errorCodeStr: string
|
|
41
|
+
message: string
|
|
42
|
+
|
|
43
|
+
- name: "Wait for OTP email and extract code"
|
|
44
|
+
check_email:
|
|
45
|
+
to: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
46
|
+
retry:
|
|
47
|
+
attempts: 15
|
|
48
|
+
delay_seconds: 2
|
|
49
|
+
assertions:
|
|
50
|
+
- "{{email.to}} include e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
51
|
+
save:
|
|
52
|
+
otp_code:
|
|
53
|
+
from: "{{email.body}}"
|
|
54
|
+
regex: "(?is)otp\\s*code[\\s\\S]{0,4000}?\\b([0-9]{8})\\b"
|
|
55
|
+
|
|
56
|
+
- name: "Verify OTP and obtain auth token"
|
|
57
|
+
skip_if:
|
|
58
|
+
- "{$stored.7_email_2fa_flow.auto_create_account} == False"
|
|
59
|
+
method: "GET"
|
|
60
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa/verify"
|
|
61
|
+
request_query_params:
|
|
62
|
+
email: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
63
|
+
code: "{$stored.7_email_2fa_flow.otp_code}"
|
|
64
|
+
expect:
|
|
65
|
+
status: 200
|
|
66
|
+
body:
|
|
67
|
+
errorCode: number
|
|
68
|
+
errorCodeStr: string
|
|
69
|
+
message: string
|
|
70
|
+
response:
|
|
71
|
+
token: string
|
|
72
|
+
tokenExpiryDate: datetime
|
|
73
|
+
save:
|
|
74
|
+
auth_token: "{{body.response.token}}"
|
|
75
|
+
assertions:
|
|
76
|
+
- "{{body.errorCode}} == 0"
|
|
77
|
+
|
|
78
|
+
- name: "Verify token is valid — get account info"
|
|
79
|
+
skip_if:
|
|
80
|
+
- "{$stored.7_email_2fa_flow.auto_create_account} == False"
|
|
81
|
+
method: "GET"
|
|
82
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/info/{$stored.7_email_2fa_flow.auth_token}"
|
|
83
|
+
expect:
|
|
84
|
+
status: 200
|
|
85
|
+
body:
|
|
86
|
+
errorCode: number
|
|
87
|
+
errorCodeStr: string
|
|
88
|
+
message: string
|
|
89
|
+
response:
|
|
90
|
+
accountId: string
|
|
91
|
+
accountType: string
|
|
92
|
+
isActive: boolean
|
|
93
|
+
token: string
|
|
94
|
+
assertions:
|
|
95
|
+
- "{{body.errorCode}} == 0"
|
|
96
|
+
- "{{body.response.accountType}} == '2fa'"
|
|
97
|
+
- "{{body.response.isActive}} == True"
|
|
98
|
+
|
|
99
|
+
- name: "Login admin for invite"
|
|
100
|
+
skip_if:
|
|
101
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
102
|
+
retry:
|
|
103
|
+
attempts: 10
|
|
104
|
+
delay_seconds: 5
|
|
105
|
+
method: "POST"
|
|
106
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/login"
|
|
107
|
+
send_as: "json"
|
|
108
|
+
body:
|
|
109
|
+
device: "e2e_test_device"
|
|
110
|
+
pseudo: "$var(DEFAULT_USERNAME)"
|
|
111
|
+
password: "$var(DEFAULT_PASSWORD)"
|
|
112
|
+
expect:
|
|
113
|
+
status: 200
|
|
114
|
+
body:
|
|
115
|
+
response:
|
|
116
|
+
token: string
|
|
117
|
+
save:
|
|
118
|
+
admin_token: "{{body.response.token}}"
|
|
119
|
+
|
|
120
|
+
- name: "Generate unique invite email"
|
|
121
|
+
skip_if:
|
|
122
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
123
|
+
randomize:
|
|
124
|
+
invite_email_suffix: 12
|
|
125
|
+
|
|
126
|
+
- name: "Invite new user by email"
|
|
127
|
+
skip_if:
|
|
128
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
129
|
+
method: "POST"
|
|
130
|
+
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/2fa/invite"
|
|
131
|
+
request_headers:
|
|
132
|
+
- x-api-token: "{$stored.7_email_2fa_flow.admin_token}"
|
|
133
|
+
send_as: "json"
|
|
134
|
+
body:
|
|
135
|
+
email: "e2e_invite_{$stored.7_email_2fa_flow.invite_email_suffix}@mock.local"
|
|
136
|
+
accountType: "2fa"
|
|
137
|
+
expect:
|
|
138
|
+
status: 200
|
|
139
|
+
body:
|
|
140
|
+
errorCode: number
|
|
141
|
+
errorCodeStr: string
|
|
142
|
+
message: string
|
|
143
|
+
assertions:
|
|
144
|
+
- "{{body.errorCode}} == 0"
|
|
145
|
+
|
|
146
|
+
- name: "Verify invite email was sent"
|
|
147
|
+
skip_if:
|
|
148
|
+
- "InviteEmail2FA not in {$stored.0_check_features.enabled_features}"
|
|
149
|
+
check_email:
|
|
150
|
+
to: "e2e_invite_{$stored.7_email_2fa_flow.invite_email_suffix}@mock.local"
|
|
151
|
+
retry:
|
|
152
|
+
attempts: 15
|
|
153
|
+
delay_seconds: 2
|
|
154
|
+
assertions:
|
|
155
|
+
- "{{email.to}} include e2e_invite_{$stored.7_email_2fa_flow.invite_email_suffix}@mock.local"
|
|
@@ -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.
|
|
8
|
+
version="1.3.0",
|
|
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",
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
name: "Email 2FA Flow"
|
|
2
|
-
base_url: "http://localhost:$var(API_PUBLIC_PORT)"
|
|
3
|
-
|
|
4
|
-
# This scenario requires the Email2FA feature to be registered.
|
|
5
|
-
# It also requires the test runner to be started with email_mock=True so that
|
|
6
|
-
# outgoing SMTP mail is captured by the local mock server.
|
|
7
|
-
skip_if:
|
|
8
|
-
- "Email2FA not in {$stored.0_check_features.enabled_features}"
|
|
9
|
-
|
|
10
|
-
steps:
|
|
11
|
-
- name: "Generate unique test email"
|
|
12
|
-
randomize:
|
|
13
|
-
email_suffix: 12
|
|
14
|
-
|
|
15
|
-
- name: "Trigger 2FA login — send OTP email"
|
|
16
|
-
method: "POST"
|
|
17
|
-
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa"
|
|
18
|
-
send_as: "json"
|
|
19
|
-
body:
|
|
20
|
-
email: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
21
|
-
device: "e2e_2fa_device"
|
|
22
|
-
expect:
|
|
23
|
-
status: 200
|
|
24
|
-
body:
|
|
25
|
-
errorCode: number
|
|
26
|
-
errorCodeStr: string
|
|
27
|
-
message: string
|
|
28
|
-
|
|
29
|
-
- name: "Wait for OTP email and extract code"
|
|
30
|
-
check_email:
|
|
31
|
-
to: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
32
|
-
retry:
|
|
33
|
-
attempts: 15
|
|
34
|
-
delay_seconds: 2
|
|
35
|
-
assertions:
|
|
36
|
-
- "{{email.to}} include e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
37
|
-
save:
|
|
38
|
-
otp_code:
|
|
39
|
-
from: "{{email.body}}"
|
|
40
|
-
regex: "(?is)otp\\s*code[\\s\\S]{0,4000}?\\b([0-9]{8})\\b"
|
|
41
|
-
|
|
42
|
-
- name: "Verify OTP and obtain auth token"
|
|
43
|
-
method: "GET"
|
|
44
|
-
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/oauth/2fa/verify"
|
|
45
|
-
request_query_params:
|
|
46
|
-
email: "e2e_2fa_{$stored.7_email_2fa_flow.email_suffix}@mock.local"
|
|
47
|
-
code: "{$stored.7_email_2fa_flow.otp_code}"
|
|
48
|
-
expect:
|
|
49
|
-
status: 200
|
|
50
|
-
body:
|
|
51
|
-
errorCode: number
|
|
52
|
-
errorCodeStr: string
|
|
53
|
-
message: string
|
|
54
|
-
response:
|
|
55
|
-
token: string
|
|
56
|
-
tokenExpiryDate: datetime
|
|
57
|
-
save:
|
|
58
|
-
auth_token: "{{body.response.token}}"
|
|
59
|
-
assertions:
|
|
60
|
-
- "{{body.errorCode}} == 0"
|
|
61
|
-
|
|
62
|
-
- name: "Verify token is valid — get account info"
|
|
63
|
-
method: "GET"
|
|
64
|
-
endpoint: "/api/v1/apiAuth/account/$var(AUTH_PROJECT_NAME)/info/{$stored.7_email_2fa_flow.auth_token}"
|
|
65
|
-
expect:
|
|
66
|
-
status: 200
|
|
67
|
-
body:
|
|
68
|
-
errorCode: number
|
|
69
|
-
errorCodeStr: string
|
|
70
|
-
message: string
|
|
71
|
-
response:
|
|
72
|
-
accountId: string
|
|
73
|
-
accountType: string
|
|
74
|
-
isActive: boolean
|
|
75
|
-
token: string
|
|
76
|
-
assertions:
|
|
77
|
-
- "{{body.errorCode}} == 0"
|
|
78
|
-
- "{{body.response.accountType}} == '2fa'"
|
|
79
|
-
- "{{body.response.isActive}} == True"
|
|
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.2.8 → sefrone_api_e2e-1.3.0}/sefrone_api_e2e.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|