Pebble client tool for authenticate user and licence management written in Python
Project description
Pebble Authentication Client for NodeJS
Introduction
This library offer a client for authenticate user and licence management written in Python compatible with may python API Server.
Installation
Requirements
The following procedures explains the installation of the following packages :
- Python 3.9 or higher
- pip (provided with Python package)
- PyJWT (tested with version 2.8.0)
- cryptography (tested with version 41.0.5)
Solution 1 : requirement.txt configuration
The best way to ensure that the correct version of all modules are correctly installed for your project is to use a requirement.txt file :
cryptography==41.0.5
PyJWT==2.8.0
Then run the following on your project :
pip install -r requirements.txt
Solution 2 : Local installation
Check python3 is properly installed on your local machine (with pip working), then run the following in the application directory.
pip install cryptography PyJWT
Solution 3 : Dockerfile configuration
Add the following in your Dockerfile after the initialization of docker image and the implementation of Python3 in the docker container :
RUN pip install cryptography PyJWT
Dockerfile example
WARNING : This is an example in order to explain when you have to run the pip install command. Your own Dockerfile should vary from this configuration.
# syntax=docker/dockerfile:1.2
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y python3.9 python3.9-dev
RUN pip install cryptography PyJWT
COPY . .
CMD ["python"]
Usage
Configuration
Before you can work with the library, you must define to a system environment variable the URI were is stored the public Json Web Key Set (JWKS file).
This file will be requested and store temporary on your API Server. Your server should be able to write on ./var/credentials/auth/jwks.json . If the file does not exist, it will be created.
If you start your server directly from a terminal, run this command on your terminal before starting your server :
export PBL_JWKS_REMOTE_URI=https://SERVER_URI/path/jwks.json
If you start your server within a Docker container, you should add this line to your Dockefile :
RUN export PBL_JWKS_REMOTE_URI=https://SERVER_URI/path/jwks.json
Test keys pair
Warn : These key files are not secured and must be used FOR TESTING PURPOSE ONLY on a local development environment !
JWKS URI (for PBL_JWKS_REMOTE_URI environment variable)
https://storage.googleapis.com/pebble-public-cdn/test_auth/jwks_test.json
Public and private keys used to sign a token
https://storage.googleapis.com/pebble-public-cdn/test_auth/public_test.pem
https://storage.googleapis.com/pebble-public-cdn/test_auth/private_test.pem
Authenticate with token string
Content will be published soon.
Authenticate with HTTP Authorization header
This might work only if an Authorization header has been sent in the current client request. Authorization header must start with Bearer string followed by a valid JWT.
Content will be published soon.
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
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 pebbleauthclient-0.1.0.tar.gz.
File metadata
- Download URL: pebbleauthclient-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5958b21b272b0b39fdb58ffc620c3a5da55921cac12ecb20e690d1bc5f9126ed
|
|
| MD5 |
a3a86390d4d3aeb30c79171dcf629675
|
|
| BLAKE2b-256 |
f1faed354a28dd16245ad3d1fdda5500b4f84a7c109669fd3d7135f63b08797f
|
File details
Details for the file pebbleauthclient-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pebbleauthclient-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d217467e06fe092464d47bdd221d148b13b13325f0c0f8f788e5c4a771fb49
|
|
| MD5 |
857e89ad4f7036a6ade23314b177e0fe
|
|
| BLAKE2b-256 |
2e6a18be1cec9d4fc002ede1bc23805702197fc6b3a862631614788896360ab5
|