Maji Passport With custom authorisation
Project description
Maji Package
Library for client side passport functionality. Adding new auth backend behaviour. Working with passport tokens. Adding new endpoints.
Update library
https://pypi.org/project/maji-passport/
- Login to pypi via techoutlaw account.
- https://pypi.org/manage/account/ - API tokens. Generate new API to update library.
- Update the version of the library in 2 files (setup.py and pyproject.toml)
- Generate new binary files:
python setup.py sdist bdist_wheel - Publish new binaries from dist folder:
twine upload --repository pypi dist/* - Update requirements on Brandon\Argo\etc
Installation
1. Instal thru pip
2. Add package maji_passport at LOCAL_APPS (django) https://pypi.org/project/maji-passport/
3. Add settings for your apllication
a. "maji_passport.apps.PassportConfig" into INSTALLED_APPS
b. "maji_passport.authentication.backend.PassportAuthBackend" add into DEFAULT_AUTHENTICATION_CLASSES
c. new envoronment variables ( Look it below )
d. develop your own tasks or move existed to argo/passport/tasks.py
e. overwrite 2 functions
* maji_passport.services.kafka.KafkaService = KafkaService
* maji_passport.KafkaUpdateUserSerializer = KafkaUpdateUserSerializer
f. add new routes:
path("api/auth/", include("maji_passport.urls")),
g. Put logic for auth backend env variable APPLICATION_AUTHENTICATION if it needs
h. Put logic for user serializer env variable USER_DETAIL_SERIALIZER if it needs
Env veriables
PASSPORT SETTINGS
PASSPORT_ENABLE = env("PASSPORT_ENABLE", default=True)
PASSPORT_SERVICE_KEY = env("PASSPORT_SERVICE_KEY", default="")
PASSPORT_UPDATE_TOKEN_URL = env(
"PASSPORT_UPDATE_TOKEN_URL",
default="https://test.com/api/v1/internal_auth/auth/update_token/",
)
PASSPORT_START_MIGRATE = env("PASSPORT_START_MIGRATE", default="")
PASSPORT_SET_PASSWORD = env("PASSPORT_SET_PASSWORD", default="")
PASSPORT_LOGIN_URL = env(
"PASSPORT_LOGIN_URL", default="https://test.com/auth/login"
)
PASSPORT_KAFKA_INTERNAL_SERVER_TOPIC = env(
"PASSPORT_KAFKA_INTERNAL_SERVER_TOPIC", default="internalServerTopic"
)
PASSPORT_EXCHANGE_KEY = env("PASSPORT_EXCHANGE_KEY", default="")
PASSPORT_PUBLIC_KEY_PATH = env(
"PASSPORT_PUBLIC_KEY_PATH", default="secrets/rsa_keys/public.pem"
)
APPLICATION_AUTHENTICATION = None
USER_DETAIL_SERIALIZER = None
KAFKA
KAFKA_SASL_PASSWORD = env("KAFKA_SASL_PASSWORD", default="")
KAFKA_SASL_USERNAME = env("KAFKA_SASL_USERNAME", default="")
KAFKA_BOOTSTRAP_SERVER = env("KAFKA_BOOTSTRAP_SERVER", default="")
KAFKA_SECURITY_PROTOCOL = env("KAFKA_SECURITY_PROTOCOL", default="SASL_SSL")
KAFKA_SASL_MECHANISM = env("KAFKA_SASL_MECHANISM", default="PLAIN")
KAFKA_SESSION_TIMEOUT_MS = env("KAFKA_SESSION_TIMEOUT_MS", default=45000)
KAFKA_GROUP_ID = env("KAFKA_GROUP_ID", default="argo_test_passport_group")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
maji_passport-1.0.10.tar.gz
(28.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maji_passport-1.0.10.tar.gz.
File metadata
- Download URL: maji_passport-1.0.10.tar.gz
- Upload date:
- Size: 28.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5e534f700d061d46fb0e5da10b253f6c909baea86c0784944906fd4f8220c28
|
|
| MD5 |
fd30635d4b00f5a51ebbc3293b59b09d
|
|
| BLAKE2b-256 |
a2886938634728dc8bc087f8cbe7c80e8066166729264212eeba8e47312abf7f
|
File details
Details for the file maji_passport-1.0.10-py3-none-any.whl.
File metadata
- Download URL: maji_passport-1.0.10-py3-none-any.whl
- Upload date:
- Size: 43.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43c7fe9bfcbfcadd45384ce60df723bff7a0b9f887e80d3caaefcd6fa1f45b1f
|
|
| MD5 |
95a7343d5596860ed0f4f0e2aecba5a7
|
|
| BLAKE2b-256 |
a11d1ae65228b155e89fe1dbb008008ed61c9d809d9dd0b0ba849333d36eac85
|