Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Install application
run: |
pip install src/core "src/authentication[oidc]" src/build src/log src/permissions src/settings src/web
pip install src/core "src/authentication[all]" src/build src/log src/permissions src/settings src/web

- name: Run tests
run: pytest --import-mode=importlib
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ and this project adheres to
- settings: Support optional section-level documentation via `_doc` in settings
definition (#80).
- auth: Add `OIDCClient` for OpenID Connect Authorization Code flow (#76).
- auth: Add `[all]` extra on `RFL.authentication` to install all authentication
backends (jwt, ldap, oidc) (#84).

### Changed
- auth: Move PyJWT and python-ldap from core dependencies to optional `[jwt]` and
`[ldap]` extras on `RFL.authentication`; add `[all]` extra for the full stack
(#84).
- web: Depend on `RFL.authentication[jwt]` so web no longer pulls LDAP
transitively (#84).

## [1.7.0] - 2026-05-08

Expand Down
25 changes: 24 additions & 1 deletion src/authentication/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# RFL: authentication package

Generate and validate JWT tokens.
User identity types, JWT token management, LDAP authentication, and OpenID
Connect (OIDC) client support.

## Installation

The core package installs only `RFL.core`. Optional backends are installed via
pip extras:

| Extra | Dependencies | Use |
|-------|----------------|-----|
| `jwt` | PyJWT | `rfl.authentication.jwt` |
| `ldap` | python-ldap | `rfl.authentication.ldap` |
| `oidc` | Authlib, Flask, requests | `rfl.authentication.oidc` |
| `all` | All of the above | Full authentication stack |

Examples:

```bash
pip install RFL.authentication # user types and errors only
pip install "RFL.authentication[jwt]" # JWT support
pip install "RFL.authentication[ldap]" # LDAP support
pip install "RFL.authentication[oidc]" # OIDC support
pip install "RFL.authentication[all]" # all backends
```
11 changes: 9 additions & 2 deletions src/authentication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ authors = [
]
dependencies = [
"RFL.core",
"PyJWT",
"python-ldap",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -27,7 +25,16 @@ classifiers = [
readme = "README.md"

[project.optional-dependencies]
jwt = ["PyJWT"]
ldap = ["python-ldap"]
oidc = ["Authlib", "Flask", "requests"]
all = [
"PyJWT",
"python-ldap",
"Authlib",
"Flask",
"requests",
]

[project.urls]
"Homepage" = "https://github.com/rackslab/RFL"
Expand Down
5 changes: 4 additions & 1 deletion src/authentication/rfl/authentication/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import logging
from pathlib import Path

import jwt
try:
import jwt
except ImportError as err:
raise ImportError("PyJWT is required for RFL JWT Authentication") from err

from .user import AuthenticatedUser
from .errors import (
Expand Down
7 changes: 5 additions & 2 deletions src/authentication/rfl/authentication/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
from pathlib import Path
import logging

import ldap
import ldap.filter
try:
import ldap
import ldap.filter
except ImportError as err:
raise ImportError("python-ldap is required for RFL LDAP Authentication") from err

from .user import AuthenticatedUser
from .errors import LDAPAuthenticationError
Expand Down
2 changes: 1 addition & 1 deletion src/web/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ authors = [
dependencies = [
"Flask",
"RFL.permissions",
"RFL.authentication"
"RFL.authentication[jwt]"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down
Loading