Skip to content

Commit ce831f6

Browse files
committed
Initial commit
0 parents  commit ce831f6

File tree

13 files changed

+720
-0
lines changed

13 files changed

+720
-0
lines changed

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Ruff and Mypy Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Triggers on all branches but not tag push
7+
pull_request: # Triggers on all PRs
8+
9+
jobs:
10+
lint:
11+
name: Run Ruff and Mypy
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install uv
27+
uv sync --group lint
28+
29+
- name: Run Ruff
30+
run: |
31+
uv run --frozen python -m ruff check
32+
33+
- name: Run Mypy
34+
run: |
35+
uv run --frozen python -m mypy
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build twine
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Publish to PyPI
29+
env:
30+
TWINE_USERNAME: __token__
31+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
twine check dist/*
34+
twine upload dist/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
venv/
3+
/dist/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 eXXcellent solutions
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README-pypi.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# 🔐 easySSP Authentication Python Client
2+
3+
This module provides a simple and secure way to authenticate with the easySSP API using JWT tokens. It performs the
4+
initial login with username and password, requests the access and refresh tokens from the authentication endpoint,
5+
and renews the access token when it expires using the refresh token.
6+
7+
---
8+
9+
## 🚀 Features
10+
11+
- 🔑 Retrieves JSON Web Tokens (JWTs) based on user credentials
12+
- 🗂️ Securely manages credentials and access/refresh tokens
13+
- ♻️ Automatically renews expired access tokens
14+
15+
## 🔐 Access Requirements
16+
17+
- Requires an easySSP **Pro** or **Process Edition** account
18+
19+
---
20+
21+
## 🛠️ How It Works
22+
23+
1. **Create the `AuthClient` instance**
24+
25+
```python
26+
from easyssp_auth.authentication import AuthClient, AuthError
27+
28+
try:
29+
auth_client = AuthClient("your_easyssp_username", "your_easyssp_password", "your-client-id")
30+
except AuthError as ex:
31+
print(ex)
32+
```
33+
34+
2. **Retrieve the access token**
35+
36+
```python
37+
access_token = auth_client.get_access_token()
38+
```
39+
40+
3. **Authenticate your requests**
41+
You can use the retrieved access token in the `Authorization` header of your requests to authenticate with the easySSP API.
42+
43+
---
44+
45+
## 📦 Installation
46+
47+
```bash
48+
pip install easyssp-auth-client
49+
```
50+
51+
Or clone and install from source:
52+
53+
```bash
54+
git clone https://github.com/exxcellent/easyssp-auth-client-python.git
55+
cd easyssp-auth-client-python
56+
pip install -e .
57+
```
58+
59+
---
60+
61+
## 📁 Project Structure
62+
63+
```bash
64+
easyssp_auth/
65+
├── __init__.py
66+
├── authentication.py # Core logic for obtaining and storing the token
67+
```
68+
69+
## 🛠️ Technical Requirements
70+
71+
- Python 3.11+
72+
73+
Install dependencies using uv:
74+
75+
```bash
76+
pip install uv
77+
uv sync
78+
```
79+
80+
## 🤝 Contributing
81+
82+
This module is maintained as part of the easySSP ecosystem. If you find issues or want to suggest improvements, please
83+
open an issue or submit a pull request.
84+
85+
## 📄 License
86+
87+
This project is licensed under the MIT License.

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# 🔐 easySSP Authentication Python Client
2+
3+
This module provides a simple and secure way to authenticate with the easySSP API using JWT tokens. It performs the
4+
initial login with username and password, requests the access and refresh tokens from the authentication endpoint,
5+
and renews the access token when it expires using the refresh token.
6+
7+
---
8+
9+
## 🚀 Features
10+
11+
- 🔑 Retrieves JSON Web Tokens (JWTs) based on user credentials
12+
- 🗂️ Securely manages credentials and access/refresh tokens
13+
- ♻️ Automatically renews expired access tokens
14+
15+
## 🔐 Access Requirements
16+
17+
- Requires an easySSP **Pro** or **Process Edition** account
18+
19+
---
20+
21+
## 🛠️ How It Works
22+
23+
1. **Create the `AuthClient` instance**
24+
25+
```python
26+
from easyssp_auth.authentication import AuthClient, AuthError
27+
28+
try:
29+
auth_client = AuthClient("your_easyssp_username", "your_easyssp_password", "your-client-id")
30+
except AuthError as ex:
31+
print(ex)
32+
```
33+
34+
2. **Retrieve the access token**
35+
36+
```python
37+
access_token = auth_client.get_access_token()
38+
```
39+
40+
3. **Authenticate your requests**
41+
You can use the retrieved access token in the `Authorization` header of your requests to authenticate with the easySSP API.
42+
43+
---
44+
45+
## 📦 Installation
46+
47+
```bash
48+
pip install easyssp-auth-client
49+
```
50+
51+
Or clone and install from source:
52+
53+
```bash
54+
git clone https://github.com/exxcellent/easyssp-auth-client-python.git
55+
cd easyssp-auth-client-python
56+
pip install -e .
57+
```
58+
59+
---
60+
61+
## 📁 Project Structure
62+
63+
```bash
64+
easyssp_auth/
65+
├── __init__.py
66+
├── authentication.py # Core logic for obtaining and storing the token
67+
```
68+
69+
## 🛠️ Technical Requirements
70+
71+
- Python 3.11+
72+
73+
Install dependencies using uv:
74+
75+
```bash
76+
pip install uv
77+
uv sync
78+
```
79+
80+
## 🤝 Contributing
81+
82+
This module is maintained as part of the easySSP ecosystem. If you find issues or want to suggest improvements, please
83+
open an issue or submit a pull request.
84+
85+
## 📄 License
86+
87+
This project is licensed under the MIT License.

easyssp_auth/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__all__ = ["AuthClient", "AuthError"]
2+
3+
from easyssp_auth.authentication import AuthClient, AuthError

0 commit comments

Comments
 (0)