AuthCore
The simple membership system for cross-platform application.
Member System
SERVER: setup a member system
# 啟動系統(則一使用)
import AuthCore as ac
## Using Json File
itf = ac.SimpleMemberSystem(db_file_path="./")
## Using MongoDB Cloud
itf = ac.MongoDBMemberSystem(account_label="<account_label>", user="<user>", pws="<pws>", collection="<collection>")
APP: sign up for third-part application
# 註冊平台
decode_key, label = itf.signup_platform()
SERVER: signup a user
# 註冊會員
account = "root"
pws = "root"
itf.signup_user(account, pws)
## Raise RuntimeError if user exist
SERVER: update info of the user
# update or increase info of user
data = {
"var1": idx,
"var2": idx,
"var3": idx,
}
itf.update_user(account, pws, **data)
APP: login as user
from AuthCore import DecryptITF
# the label from the step 1 (setup a member system)
# decode_key from the step 1 (setup a member system)
# user login
### Raise RuntimeError if user is did NOT exist
encode_text = itf.login_user(label, "root", "root")
# decode the secret user info
decode_text = DecryptITF.decrypt(decode_key, encode_text)
print(f"解析會員資料: decode_text:{decode_text}")
SERVER: Delete a user
# Delete a user
itf.delete_user(account, pws)
Example:
without rsa
import AuthCore as ac
# 啟動系統
itf = ac.SimpleMemberSystem(db_file_path="./")
# 註冊會員
account = "root"
pws = "root"
itf.signup_user(account, pws)
# 更新會員資料
data = {
"var1": 1,
"var2": 1,
"var3": 1,
}
itf.update_user(account, pws, **data)
# user login
user_dict = itf.login_user(None, "root", "root",encode=False)
# delete user
itf.delete_user(account, pws)
rsa login
import AuthCore as ac
import json
# 啟動系統
itf = ac.SimpleMemberSystem(db_file_path="./")
# 註冊平台
decode_key, platform_label = itf.signup_platform()
# 註冊會員
account = "root"
pws = "root"
itf.signup_user(account, pws)
# 更新會員資料
data = {
"var1": 1,
"var2": 1,
"var3": 1,
}
itf.update_user(account, pws, **data)
# the label from the step 1 (setup a member system)
# decode_key from the step 1 (setup a member system)
# user login
encode_text = itf.login_user(platform_label, "root", "root")
# decode the secret user info
decode_text = ac.DecryptITF.decrypt(decode_key, encode_text)
decode_obj = json.loads(decode_text)
itf.delete_user(account, pws)
Other:
連接至DB
# jsonfile
from AuthCore.sdb import jsonfile
db = jsonfile.JsonDBInterface("TableName")
# mongo
from AuthCore.sdb import mongo
db = mongo.MongoDBInterface("ooglx")
db.select_table("unittest", "user")
新增資料
db.__insert__("user1", {"a": 1, "b": 2})
result = db.__select__("user1")
搜索資料
result = db.__select__("user1")
更新資料
db.__update__("user1", {"var1": 1, "var2": 2})
result = db.__select__("user1")
刪除資料
db.__remove__("user1")
result = db.__select__("user1")
Metadata
Release files for AuthCore 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| AuthCore-0.1.3.tar.gz | 6.9 kB | Without provenance | Details for AuthCore-0.1.3.tar.gz |
Release files / AuthCore-0.1.3.tar.gz
| Download URL | AuthCore-0.1.3.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
56bb3fb2410ff18535000e0322ebb2d89cdb0a2238ffe7a82a9aa5bbb31ebf6b
|
|
BLAKE2b-256 checksum How to use checksums |
16e233a37640767a198f67537aedd68ff2cc17eac2377f2b67246a4778267ceb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
|
Security for AuthCore 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.