Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
doc
example
.github

# Python build artifacts
build/
dist/
*.egg-info/
.eggs/
*.egg

# pip cache
.cache/

# Virtual environments
.venv/
venv/

# Development artifacts
__pycache__/
*.py[cod]
*$py.class
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install git+https://github.com/TeskaLabs/asab.git

pip install ".[dev]"

- name: Lint with flake8
run: |
flake8 seacatauth seacatauth.py
Expand All @@ -55,13 +54,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bson
pip install pymongo
pip install bcrypt
pip install argon2-cffi
pip install jwcrypto
pip install "asab[encryption] @ git+https://github.com/TeskaLabs/asab.git"

pip install ".[test]"

- name: Test with unittest
run: |
python3 -m unittest test
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ __pycache__/

# Distribution / packaging
.Python
build/
dist/
*.egg-info/
.eggs/
*.egg
MANIFEST

# Unit test / coverage reports
htmlcov/
Expand Down
44 changes: 19 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apk add --no-cache \
xmlsec \
openldap

# Create build environment so that dependencies like aiohttp can be build
# Create build environment so that dependencies like aiohttp can be built
# Run all as a single command in order to reduce image size --virtual buildenv
RUN apk add --no-cache \
git \
Expand All @@ -28,34 +28,28 @@ RUN apk add --no-cache \
musl-dev \
openldap-dev \
rust \
cargo \
&& python3 -m venv /venv \
&& /venv/bin/pip3 install --upgrade pip \
&& /venv/bin/pip3 install --no-cache-dir \
aiohttp \
aiosmtplib \
motor \
cryptography \
jwcrypto>=0.9.1 \
fastjsonschema \
bcrypt \
argon2_cffi \
python-ldap \
aiomysql \
jinja2 \
pyotp \
webauthn \
pyyaml \
pysaml2 \
pymongo \
sentry-sdk \
"asab[encryption] @ git+https://github.com/TeskaLabs/asab.git"
cargo

RUN cat /venv/lib/python3.12/site-packages/asab/__version__.py
# Create virtual environment
RUN python3 -m venv /venv \
&& /venv/bin/pip3 install --upgrade pip

RUN mkdir -p /app/seacat-auth
# Set working directory for the build
WORKDIR /app/seacat-auth

# Copy project metadata files first for better layer caching
COPY pyproject.toml README.md CHANGELOG.md /app/seacat-auth/

# Copy the source code
COPY seacatauth /app/seacat-auth/seacatauth
COPY seacatauth.py /app/seacat-auth/seacatauth.py

# Install dependencies from pyproject.toml and install the package
RUN /venv/bin/pip3 install --no-cache-dir .

# Verify ASAB version
RUN cat /venv/lib/python3.12/site-packages/asab/__version__.py
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

# Create MANIFEST.json in the working directory
# The manifest script requires git to be installed
COPY ./.git /app/seacat-auth/.git
Expand Down
109 changes: 109 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "seacat-auth"
# VERSION: Extracted from CHANGELOG.md (latest: v26.15)
# Update this to match your current release version
version = "26.15.0"
description = "SeaCat Auth is a microservice that provides authentication, authorization, identity management, session management and other access control features."
readme = "README.md"
license = {text = "GPL-3.0-or-later"}
authors = [
{name = "TeskaLabs Ltd", email = "support@teskalabs.com"}
]
maintainers = [
{name = "TeskaLabs Ltd", email = "support@teskalabs.com"}
]
keywords = [
"authentication",
"authorization",
"identity",
"session-management",
"openid-connect",
"oauth2",
"rbac",
"microservice",
"access-control",
"webauthn",
"2fa",
"mfa",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Topic :: Security",
"Topic :: Security :: Cryptography",
"Topic :: System :: Systems Administration :: Authentication/Directory",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
]
requires-python = ">=3.12"

# Dependencies extracted from Dockerfile (line 34-52)
dependencies = [
"aiohttp",
"aiosmtplib",
"motor",
"cryptography",
"jwcrypto>=0.9.1",
"fastjsonschema",
"bcrypt",
"argon2_cffi",
"python-ldap",
"aiomysql",
"jinja2",
"pyotp",
"webauthn",
"pyyaml",
"pysaml2",
"pymongo",
"sentry-sdk",
# ASAB framework with encryption extras - installed from git (Dockerfile line 52)
"asab[encryption] @ git+https://github.com/TeskaLabs/asab.git",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
]

[project.optional-dependencies]
# Development dependencies - not specified in Dockerfile, add as needed
dev = [
"pytest",
"pytest-asyncio",
"flake8",
]

# Minimal test dependencies for CI - subset needed to run unit tests
# This keeps CI fast by not installing all runtime dependencies
test = [
"bson",
"pymongo",
"bcrypt",
"argon2-cffi",
"jwcrypto>=0.9.1",
"asab[encryption] @ git+https://github.com/TeskaLabs/asab.git",
]

[project.urls]
"Homepage" = "https://github.com/TeskaLabs/seacat-auth"
"Documentation" = "https://docs.teskalabs.com/seacat-auth"
"Docker Image" = "https://hub.docker.com/r/teskalabs/seacat-auth"
"Changelog" = "https://github.com/TeskaLabs/seacat-auth/blob/main/CHANGELOG.md"
"Bug Tracker" = "https://github.com/TeskaLabs/seacat-auth/issues"

[tool.setuptools]
packages = ["seacatauth"]

[tool.setuptools.package-data]
# Include message templates and other static files
seacatauth = [
"../etc/message_templates/**/*",
"../CHANGELOG.md",
]

[tool.flake8]
# From setup.cfg - flake8 configuration
ignore = ["W191", "W503", "E117", "E501", "E303", "E301"]
Loading