Introduction
This package is to provide aliyun oss policy and sign from the backend to clients such as Android, iOS devices and specially mini programs on Weixin.
Many examples and demos even on the official page put access key and secrets directly in the clients, which can be very dangerous since all the code are actually not encrypted.
This package obtain policy and its encrypted sign in the backend, which is then passed by a request
Requirements
The package is based on django restframework, so both django and django rest framework should be installed.
If not, you can import from 'oss_poly_sign.generators' to generate the policy code and auth.
How to Use
- Step 1:
pip install oss-policy-sign - Added the following settings in your settings.py:
OSS_ACCESS_KEY = ""
OSS_ACCESS_SECRET = ""
OSS_TIMEOUT = 60 # 60 minutes, an hour
OSS_MAXSIZE = 10 # 10M
- Added the following to your urls.py:
from oss_policy_sign.views import OssAuthViewSet
urlpatterns = [
# ...
url(r'^oss/auth/', OssAuthViewSet),
]
- test it by making a request
Release files for oss-policy-sign 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oss_policy_sign-1.2.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oss_policy_sign-1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.5 kB
Release files / oss_policy_sign-1.2.tar.gz
| Download URL | oss_policy_sign-1.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
612a8ed0ba4c3f30e7cf60675fe8bb0e65445ef57079dd329af16a1ae7ad5cd4
|
|
BLAKE2b-256 checksum How to use checksums |
134094cc9f6c4dd0830eef1ff644b78c60310562b40f3619a2fa450f145c3b57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
|
Release files / oss_policy_sign-1.2-py3-none-any.whl
| Download URL | oss_policy_sign-1.2-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65dc0c615dbf61e267336feb04ad5c93945777e69e6c73b90501e8f766af86e7
|
|
BLAKE2b-256 checksum How to use checksums |
f5ef75330d9e6561d5bbb0b4f5605a6eaef3e2efa8de180e8ae1d852d1abb1e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3
|