diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-08 08:05:11 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-08 08:05:11 +0000 |
commit | 40043a076939b1b2445e0bc8c3b9185c14b675e5 (patch) | |
tree | c6e738758a8a25a403dff9985840141f916effd3 | |
parent | b6dec8f4028df6a7d8a0a58ab7bc5e608e7046eb (diff) |
automatic import of python-sanic-securityopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-sanic-security.spec | 93 | ||||
-rw-r--r-- | sources | 2 |
3 files changed, 56 insertions, 40 deletions
@@ -1 +1,2 @@ /sanic-security-1.10.3.tar.gz +/sanic-security-1.11.1.tar.gz diff --git a/python-sanic-security.spec b/python-sanic-security.spec index 7567c36..b8aa39e 100644 --- a/python-sanic-security.spec +++ b/python-sanic-security.spec @@ -1,11 +1,11 @@ %global _empty_manifest_terminate_build 0 Name: python-sanic-security -Version: 1.10.3 +Version: 1.11.1 Release: 1 Summary: An effective, simple, and async security library for the Sanic framework. License: GNU Affero General Public License v3.0 URL: https://github.com/na-stewart/sanic-security -Source0: https://mirrors.nju.edu.cn/pypi/web/packages/91/ab/7b7c945b7300d9262df8fc5be6a4b09b13476501de6b371395ca8eb4ff2a/sanic-security-1.10.3.tar.gz +Source0: https://mirrors.aliyun.com/pypi/web/packages/ec/70/6fd534db544ffa0cc8ae611624a1e72b868dc759ec29fd761f82ae44a8d8/sanic-security-1.11.1.tar.gz BuildArch: noarch @@ -95,6 +95,11 @@ pip3 install sanic-security[crypto] pip3 install -e ".[dev]"
````
+* Update sanic-security if already installed.
+```shell
+pip3 install --upgrade sanic-security
+```
+
### Configuration
Sanic Security configuration is merely an object that can be modified either using dot-notation or like a
@@ -148,7 +153,7 @@ The tables in the below examples represent example [request form-data](https://s * Initial Administrator Account
-This account can be logged into and has complete authoritative access. Login credentials can be modified in config.
+This account can be logged into and has complete authoritative access. Login credentials should be modified in config!
```python
create_initial_admin_account(app)
@@ -274,10 +279,10 @@ async def on_authenticate(request): ```python
@app.post("api/security/auth")
@requires_authentication()
-async def on_authenticate(request, authentication_session):
+async def on_authenticate(request):
return json(
"You have been authenticated.",
- authentication_session.bearer.json,
+ request.ctx.authentication_session.bearer.json,
)
```
@@ -327,8 +332,8 @@ async def on_captcha(request): ```python
@app.post("ap/security/captcha")
@requires_captcha()
-async def on_captcha(request, captcha_session):
- return json("Captcha attempt successful!", captcha_session.json)
+async def on_captcha(request):
+ return json("Captcha attempt successful!", request.ctx.captcha_session.json)
```
## Two-step Verification
@@ -390,9 +395,10 @@ async def on_two_step_verification(request): ```python
@app.post("api/security/two-step")
@requires_two_step_verification()
-async def on_two_step_verification(request, two_step_session):
+async def on_two_step_verification(request):
response = json(
- "Two-step verification attempt successful!", two_step_session.bearer.json
+ "Two-step verification attempt successful!",
+ request.ctx.two_step_session.bearer.json,
)
return response
```
@@ -431,13 +437,12 @@ async def on_check_perms(request): return text("Account is authorized.")
```
-
* Require Permissions (This method is not called directly and instead used as a decorator.)
```python
@app.post("api/security/perms")
@require_permissions("channels:view", "voice:*")
-async def on_check_perms(request, authentication_session):
+async def on_check_perms(request):
return text("Account is authorized.")
```
@@ -455,7 +460,7 @@ async def on_check_roles(request): ```python
@app.post("api/security/roles")
@require_roles("Chat Room Moderator")
-async def on_check_roles(request, authentication_session):
+async def on_check_roles(request):
return text("Account is authorized.")
```
@@ -658,6 +663,11 @@ pip3 install sanic-security[crypto] pip3 install -e ".[dev]"
````
+* Update sanic-security if already installed.
+```shell
+pip3 install --upgrade sanic-security
+```
+
### Configuration
Sanic Security configuration is merely an object that can be modified either using dot-notation or like a
@@ -711,7 +721,7 @@ The tables in the below examples represent example [request form-data](https://s * Initial Administrator Account
-This account can be logged into and has complete authoritative access. Login credentials can be modified in config.
+This account can be logged into and has complete authoritative access. Login credentials should be modified in config!
```python
create_initial_admin_account(app)
@@ -837,10 +847,10 @@ async def on_authenticate(request): ```python
@app.post("api/security/auth")
@requires_authentication()
-async def on_authenticate(request, authentication_session):
+async def on_authenticate(request):
return json(
"You have been authenticated.",
- authentication_session.bearer.json,
+ request.ctx.authentication_session.bearer.json,
)
```
@@ -890,8 +900,8 @@ async def on_captcha(request): ```python
@app.post("ap/security/captcha")
@requires_captcha()
-async def on_captcha(request, captcha_session):
- return json("Captcha attempt successful!", captcha_session.json)
+async def on_captcha(request):
+ return json("Captcha attempt successful!", request.ctx.captcha_session.json)
```
## Two-step Verification
@@ -953,9 +963,10 @@ async def on_two_step_verification(request): ```python
@app.post("api/security/two-step")
@requires_two_step_verification()
-async def on_two_step_verification(request, two_step_session):
+async def on_two_step_verification(request):
response = json(
- "Two-step verification attempt successful!", two_step_session.bearer.json
+ "Two-step verification attempt successful!",
+ request.ctx.two_step_session.bearer.json,
)
return response
```
@@ -994,13 +1005,12 @@ async def on_check_perms(request): return text("Account is authorized.")
```
-
* Require Permissions (This method is not called directly and instead used as a decorator.)
```python
@app.post("api/security/perms")
@require_permissions("channels:view", "voice:*")
-async def on_check_perms(request, authentication_session):
+async def on_check_perms(request):
return text("Account is authorized.")
```
@@ -1018,7 +1028,7 @@ async def on_check_roles(request): ```python
@app.post("api/security/roles")
@require_roles("Chat Room Moderator")
-async def on_check_roles(request, authentication_session):
+async def on_check_roles(request):
return text("Account is authorized.")
```
@@ -1218,6 +1228,11 @@ pip3 install sanic-security[crypto] pip3 install -e ".[dev]"
````
+* Update sanic-security if already installed.
+```shell
+pip3 install --upgrade sanic-security
+```
+
### Configuration
Sanic Security configuration is merely an object that can be modified either using dot-notation or like a
@@ -1271,7 +1286,7 @@ The tables in the below examples represent example [request form-data](https://s * Initial Administrator Account
-This account can be logged into and has complete authoritative access. Login credentials can be modified in config.
+This account can be logged into and has complete authoritative access. Login credentials should be modified in config!
```python
create_initial_admin_account(app)
@@ -1397,10 +1412,10 @@ async def on_authenticate(request): ```python
@app.post("api/security/auth")
@requires_authentication()
-async def on_authenticate(request, authentication_session):
+async def on_authenticate(request):
return json(
"You have been authenticated.",
- authentication_session.bearer.json,
+ request.ctx.authentication_session.bearer.json,
)
```
@@ -1450,8 +1465,8 @@ async def on_captcha(request): ```python
@app.post("ap/security/captcha")
@requires_captcha()
-async def on_captcha(request, captcha_session):
- return json("Captcha attempt successful!", captcha_session.json)
+async def on_captcha(request):
+ return json("Captcha attempt successful!", request.ctx.captcha_session.json)
```
## Two-step Verification
@@ -1513,9 +1528,10 @@ async def on_two_step_verification(request): ```python
@app.post("api/security/two-step")
@requires_two_step_verification()
-async def on_two_step_verification(request, two_step_session):
+async def on_two_step_verification(request):
response = json(
- "Two-step verification attempt successful!", two_step_session.bearer.json
+ "Two-step verification attempt successful!",
+ request.ctx.two_step_session.bearer.json,
)
return response
```
@@ -1554,13 +1570,12 @@ async def on_check_perms(request): return text("Account is authorized.")
```
-
* Require Permissions (This method is not called directly and instead used as a decorator.)
```python
@app.post("api/security/perms")
@require_permissions("channels:view", "voice:*")
-async def on_check_perms(request, authentication_session):
+async def on_check_perms(request):
return text("Account is authorized.")
```
@@ -1578,7 +1593,7 @@ async def on_check_roles(request): ```python
@app.post("api/security/roles")
@require_roles("Chat Room Moderator")
-async def on_check_roles(request, authentication_session):
+async def on_check_roles(request):
return text("Account is authorized.")
```
@@ -1690,7 +1705,7 @@ Distributed under the GNU Affero General Public License v3.0. See `LICENSE` for %prep -%autosetup -n sanic-security-1.10.3 +%autosetup -n sanic-security-1.11.1 %build %py3_build @@ -1704,20 +1719,20 @@ if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then - find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst + find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then - find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst + find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then - find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst + find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then - find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst + find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then - find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst + find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . @@ -1730,5 +1745,5 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog -* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.10.3-1 +* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.11.1-1 - Package Spec generated @@ -1 +1 @@ -06f9486112703f24660e9bb46404f9f0 sanic-security-1.10.3.tar.gz +a4f035fab053f41a6d66607ef2f26431 sanic-security-1.11.1.tar.gz |