sanic-security 1.17.0__tar.gz → 1.17.1__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.
- {sanic_security-1.17.0/sanic_security.egg-info → sanic_security-1.17.1}/PKG-INFO +3 -3
- {sanic_security-1.17.0 → sanic_security-1.17.1}/README.md +2 -2
- {sanic_security-1.17.0 → sanic_security-1.17.1}/pyproject.toml +1 -1
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/authentication.py +1 -1
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/test/server.py +1 -1
- {sanic_security-1.17.0 → sanic_security-1.17.1/sanic_security.egg-info}/PKG-INFO +3 -3
- {sanic_security-1.17.0 → sanic_security-1.17.1}/LICENSE +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/__init__.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/authorization.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/configuration.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/exceptions.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/models.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/oauth.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/test/__init__.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/test/tests.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/utils.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security/verification.py +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security.egg-info/SOURCES.txt +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security.egg-info/dependency_links.txt +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security.egg-info/requires.txt +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security.egg-info/top_level.txt +0 -0
- {sanic_security-1.17.0 → sanic_security-1.17.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sanic-security
|
3
|
-
Version: 1.17.
|
3
|
+
Version: 1.17.1
|
4
4
|
Summary: An async security library for the Sanic framework.
|
5
5
|
Author-email: Aidan Stewart <me@na-stewart.com>
|
6
6
|
Project-URL: Documentation, https://security.na-stewart.com/
|
@@ -268,7 +268,7 @@ Phone can be null or empty.
|
|
268
268
|
@app.post("api/security/register")
|
269
269
|
async def on_register(request):
|
270
270
|
account = await register(request)
|
271
|
-
two_step_session = await request_two_step_verification(request, account
|
271
|
+
two_step_session = await request_two_step_verification(request, account)
|
272
272
|
await email_code(
|
273
273
|
account.email, two_step_session.code # Code = 24KF19
|
274
274
|
) # Custom method for emailing verification code.
|
@@ -309,7 +309,7 @@ You can use a username as well as an email for login if `ALLOW_LOGIN_WITH_USERNA
|
|
309
309
|
async def on_login(request):
|
310
310
|
authentication_session = await login(request, require_second_factor=True)
|
311
311
|
two_step_session = await request_two_step_verification(
|
312
|
-
request, authentication_session.bearer
|
312
|
+
request, authentication_session.bearer, "2fa"
|
313
313
|
)
|
314
314
|
await email_code(
|
315
315
|
authentication_session.bearer.email, two_step_session.code # Code = XGED2U
|
@@ -235,7 +235,7 @@ Phone can be null or empty.
|
|
235
235
|
@app.post("api/security/register")
|
236
236
|
async def on_register(request):
|
237
237
|
account = await register(request)
|
238
|
-
two_step_session = await request_two_step_verification(request, account
|
238
|
+
two_step_session = await request_two_step_verification(request, account)
|
239
239
|
await email_code(
|
240
240
|
account.email, two_step_session.code # Code = 24KF19
|
241
241
|
) # Custom method for emailing verification code.
|
@@ -276,7 +276,7 @@ You can use a username as well as an email for login if `ALLOW_LOGIN_WITH_USERNA
|
|
276
276
|
async def on_login(request):
|
277
277
|
authentication_session = await login(request, require_second_factor=True)
|
278
278
|
two_step_session = await request_two_step_verification(
|
279
|
-
request, authentication_session.bearer
|
279
|
+
request, authentication_session.bearer, "2fa"
|
280
280
|
)
|
281
281
|
await email_code(
|
282
282
|
authentication_session.bearer.email, two_step_session.code # Code = XGED2U
|
@@ -185,7 +185,7 @@ async def fulfill_second_factor(request: Request) -> AuthenticationSession:
|
|
185
185
|
authentication_session = await AuthenticationSession.decode(request)
|
186
186
|
if not authentication_session.requires_second_factor:
|
187
187
|
raise DeactivatedError("Session second factor requirement already met.", 403)
|
188
|
-
two_step_session = await TwoStepSession.decode(request)
|
188
|
+
two_step_session = await TwoStepSession.decode(request, tag="2fa")
|
189
189
|
two_step_session.validate()
|
190
190
|
await two_step_session.check_code(request.form.get("code"))
|
191
191
|
authentication_session.requires_second_factor = False
|
@@ -101,7 +101,7 @@ async def on_login(request):
|
|
101
101
|
)
|
102
102
|
if str_to_bool(request.args.get("two-factor-authentication")):
|
103
103
|
two_step_session = await request_two_step_verification(
|
104
|
-
request, authentication_session.bearer
|
104
|
+
request, authentication_session.bearer, "2fa"
|
105
105
|
)
|
106
106
|
response = json(
|
107
107
|
"Login successful! Two-factor authentication required.",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sanic-security
|
3
|
-
Version: 1.17.
|
3
|
+
Version: 1.17.1
|
4
4
|
Summary: An async security library for the Sanic framework.
|
5
5
|
Author-email: Aidan Stewart <me@na-stewart.com>
|
6
6
|
Project-URL: Documentation, https://security.na-stewart.com/
|
@@ -268,7 +268,7 @@ Phone can be null or empty.
|
|
268
268
|
@app.post("api/security/register")
|
269
269
|
async def on_register(request):
|
270
270
|
account = await register(request)
|
271
|
-
two_step_session = await request_two_step_verification(request, account
|
271
|
+
two_step_session = await request_two_step_verification(request, account)
|
272
272
|
await email_code(
|
273
273
|
account.email, two_step_session.code # Code = 24KF19
|
274
274
|
) # Custom method for emailing verification code.
|
@@ -309,7 +309,7 @@ You can use a username as well as an email for login if `ALLOW_LOGIN_WITH_USERNA
|
|
309
309
|
async def on_login(request):
|
310
310
|
authentication_session = await login(request, require_second_factor=True)
|
311
311
|
two_step_session = await request_two_step_verification(
|
312
|
-
request, authentication_session.bearer
|
312
|
+
request, authentication_session.bearer, "2fa"
|
313
313
|
)
|
314
314
|
await email_code(
|
315
315
|
authentication_session.bearer.email, two_step_session.code # Code = XGED2U
|
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
|
{sanic_security-1.17.0 → sanic_security-1.17.1}/sanic_security.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|