Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9aab667
Refactor user registration to use PostgreSQL stored procedure and san…
Jun 9, 2025
7888715
Refactor user registration to use UserRegister schema and remove User…
Jun 9, 2025
4e0adaf
Refactor username sanitization: move sanitize_username function to st…
Jun 9, 2025
c3d4e3a
Enhance user registration: add HTTPException for existing users and i…
Jun 9, 2025
8579c8d
Add docstring to user registration endpoint for clarity
Jun 9, 2025
89e56e7
Fix attribute name in User model: update language_id to language_iso_…
Jun 9, 2025
ce222fb
Refactor language preference handling: rename language_iso_code to la…
Jun 9, 2025
86a04fe
Implement email confirmation feature and login endpoint
Jun 12, 2025
aec0f96
Enhance login endpoint
Jun 12, 2025
a416bbb
Implement 2FA login flow and enhance user registration with OTP secre…
Jun 12, 2025
a159a8b
Move in-memory store declaration for clarity
Jun 12, 2025
b3b5526
Bump version to 1.2.0 for API and 0.3.0 for application; update break…
Jun 12, 2025
bb83e80
Refactor tasks.json to improve structure and remove unnecessary runOp…
Jun 12, 2025
d37b9a5
Add pyotp dependency for OTP functionality
Jun 12, 2025
e66c900
Update default email configuration values in send_email.py for better…
Jun 12, 2025
79d3046
Enhance documentation and restructure email utility modules for clari…
Jun 12, 2025
c0d3f52
Update linter configuration and clean up unused init files
Jun 12, 2025
2ce2223
Update permissions in super-linter.yml to allow write access for cont…
Jun 12, 2025
c5c3441
Super-Linter: Fix linting issues
Vianpyro Jun 12, 2025
8542f8c
Refactor Super Linter configuration to simplify validation settings
Jun 12, 2025
9a05ef7
Super-Linter: Fix linting issues
Vianpyro Jun 12, 2025
ea601dc
Cleanup: Remove obsolete Super Linter output files and update .gitignore
Jun 12, 2025
24dad07
Update .gitignore to include Super Linter output files
Jun 12, 2025
1fbeb68
docs: Update module docstring for clarity and formatting
Jun 12, 2025
fee60a7
Add email confirmation tests
Jun 13, 2025
dea7c01
Super-Linter: Fix linting issues
Vianpyro Jun 13, 2025
269762a
Update dependency installation to use requirements-dev.txt
Jun 13, 2025
41778f1
Remove confirmation token from email response
Jun 13, 2025
475fc1e
Refactor security utility functions and enhance test coverage with ne…
Jun 13, 2025
51ad19b
Add test for non-empty encrypted fields to ensure encryption integrity
Jun 13, 2025
ace571e
Enhance OTP verification function to support HOTP counter parameter
Jun 13, 2025
f9aed57
Add test for hash field length to validate SHA-256 output
Jun 13, 2025
450457e
Add unit tests for OTP verification functionality
Jun 13, 2025
d9b1201
Refactor password verification function and add comprehensive tests f…
Jun 13, 2025
d8678a9
Refactor password verification tests to use fixtures for hashed and w…
Jun 13, 2025
f4e3292
Refactor test client setup in API tests to use FastAPI app instances …
Jun 13, 2025
96ae2a3
Implement session and refresh token management in authentication endp…
Jun 17, 2025
8ce3629
Refactor authentication endpoints to improve device info handling and…
Jun 19, 2025
40c9445
Refactor authentication endpoints to streamline device info handling …
Jun 19, 2025
a9c96d0
Refactor login tests to simplify function signatures by removing unne…
Jun 19, 2025
3a9da42
Refactor device info extraction and session creation in login endpoin…
Jun 19, 2025
0c3b014
Add user agent handling to session token saving and login process
Jun 19, 2025
5a04243
Remove unused TODO functions as the Database will handle the removal …
Jun 19, 2025
f3f595c
Add user agent string to login OTP session and refresh token saving
Jun 20, 2025
d4439b1
Add greenlet dependency to requirements for improved concurrency support
Jun 20, 2025
fe294f3
Refactor session creation to include user agent string and update tes…
Jun 20, 2025
6b16548
Refactor test_login_2fa_required_returns_2fa_token to simplify patchi…
Jun 20, 2025
11987f1
Update version constraints in requirements.txt for better dependency …
Jun 20, 2025
251c813
Add unit tests for sanitize_username function to validate username sa…
Jun 20, 2025
f303526
Update version constraints in requirements-dev.txt for build and test…
Jun 20, 2025
632be2c
Merge branch 'main' into feature/secure_registration_add_login
Vianpyro Jun 22, 2025
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
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
]
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"postStartCommand": "pip3 install --user -r requirements-dev.txt",
"postAttachCommand": "python3 -m pytest tests",
"remoteUser": "vscode"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pytest pytest-cov
pip install -r requirements-dev.txt
pip install pytest-cov

- name: Run Pytest (Linux/macOS)
if: runner.os != 'Windows'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/suggest-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
BUMP="patch"
echo "$LABELS" | grep -q 'type: feature' && BUMP="minor"
echo "$LABELS" | grep -q 'type: security' && BUMP="minor"
echo "$LABELS" | grep -q 'type: breaking' && BUMP="major"
echo "$LABELS" | grep -q 'special: breaking change' && BUMP="major"
echo "bump=$BUMP" >> "$GITHUB_OUTPUT"

- name: Get latest tag
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Lint

permissions:
contents: read
contents: write
packages: read
statuses: write

Expand All @@ -27,10 +27,7 @@ jobs:
uses: super-linter/super-linter/slim@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_EXCLUDE: '(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)'
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
DISABLE_ERRORS: true

fix-lint:
name: Fix Lint
Expand All @@ -48,13 +45,18 @@ jobs:
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_EXCLUDE: '(.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false
FIX_HTML_PRETTIER: true
FIX_JSON: true
FIX_JSON_PRETTIER: true
FIX_MARKDOWN: true
FIX_MARKDOWN_PRETTIER: true
FIX_PYTHON_BLACK: true
FIX_PYTHON_RUFF: true
FIX_YAML_PRETTIER: true
VALIDATE_DOCKERFILE_HADOLINT: false

- name: Commit and push linting fixes
if: >
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,7 @@ cython_debug/
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore

# # Super Linter output
github_conf/branch_protection_rules.json
super-linter-output/super-linter-summary.md
6 changes: 5 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"singleQuote": true,
"overrides": [
{
"files": ["*.yml", "*.yaml", "*.md"],
"files": [
"*.yml",
"*.yaml",
"*.md"
],
"options": {
"tabWidth": 2
}
Expand Down
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
"files.trimTrailingWhitespace": true,
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true
"**/.pytest_cache": true,
"**/*.egg-info": true
},
"[python]": {
"editor.rulers": [88],
"editor.rulers": [80],
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
"source.organizeImports": "always"
}
},
"isort.args": ["--profile", "black"],
"triggerTaskOnSave.tasks": {
"Run on test file": ["tests/**/test_*.py"],
"Run file tests": ["tests/**/test_*.py"],
"Run all tests": ["app/**/*.py", "!tests/**"]
},
"python.testing.unittestEnabled": false,
Expand Down
42 changes: 15 additions & 27 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,52 @@
"label": "Delete old Git branches",
"type": "shell",
"command": "git fetch --prune && git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D",
"problemMatcher": [],
"presentation": {
"showReuseMessage": false
}
},
"problemMatcher": []
},
{
"label": "Package app",
"type": "shell",
"command": "rm -rf build dist *.egg-info && python -m build",
"problemMatcher": [],
"runOptions": {
"runOn": "default"
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "dedicated"
},
"group": {
"kind": "build",
"isDefault": true
}
"problemMatcher": []
},
{
"label": "Run all tests",
"type": "shell",
"command": "python3 -m pytest tests",
"group": "build",
"problemMatcher": [],
"runOptions": {
"runOn": "default"
}
"presentation": {
"close": true
},
"problemMatcher": []
},
{
"label": "Run on test file",
"label": "Run file tests",
"type": "shell",
"command": "python3 -m pytest '${relativeFile}' -v -x",
"command": "python3 -m pytest '${file}' -v -x",
"group": {
"kind": "test"
},
"presentation": {
"close": true
},
"problemMatcher": [],
"runOptions": {
"runOn": "default",
}
"problemMatcher": []
},
{
"label": "Start FastAPI server",
"type": "shell",
"command": "uvicorn app.main:app --reload",
"problemMatcher": [],
"runOptions": {
"runOn": "default"
},
"presentation": {
"panel": "dedicated",
"close": true
}
},
"problemMatcher": []
}
]
}
4 changes: 3 additions & 1 deletion app/routes/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
from fastapi import FastAPI

from .endpoints.authentication import router as auth_router
from .endpoints.email import router as email_router
from .endpoints.orders import router as order_router
from .endpoints.products import router as product_router

__version__ = "1.1.0"
__version__ = "1.2.0"

api = FastAPI(title="ChocoMax Shop API", version=__version__)

api.include_router(auth_router, prefix="/auth", tags=["Authentication"])
api.include_router(email_router, prefix="/email", tags=["Email"])
api.include_router(product_router, prefix="/products", tags=["Products"])
api.include_router(order_router, prefix="/orders", tags=["Orders"])
Loading