Skip to content

v0.6.8

Choose a tag to compare

@AghastyGD AghastyGD released this 28 Jan 21:13
· 13 commits to main since this release
377d254

🚀 What’s New in v0.6.8

This release introduces Lazy Ninja’s authentication module for the first time, alongside internal refinements and documentation improvements.

The authentication system was developed and refined over multiple iterations, and is now released as a stable, documented, and production-ready feature, aligned with Lazy Ninja’s zero-boilerplate philosophy.


✨ New Feature: Authentication

Lazy Ninja now ships with a built-in JWT-based authentication module.

Key capabilities:

  • JWT access and refresh tokens

  • Support for stateless (default) and stateful (revocable) authentication flows

  • Optional refresh token rotation

  • Configurable login identifiers (username, email, or unified login)

  • Validation of standard JWT claims (iss, aud, exp, jti)

  • Optional cache-backed token revocation for higher-security environments

  • Authentication lifecycle hooks:

    • ON_LOGIN

    • ON_REGISTER

    • ON_REFRESH

    • ON_LOGOUT

Authentication routes can be enabled explicitly and integrate cleanly with Django and Django Ninja without additional boilerplate.


📚 Documentation

This release adds full documentation for the new authentication feature:

  • Authentication Guide

    • Configuration

    • Endpoints

    • Stateless vs stateful behavior

    • Hooks and security notes

  • Authentication Architecture

    • Design goals and non-goals

    • Trade-offs behind JWT usage

    • Token claims and revocation strategy

    • Migration paths as security requirements evolve

The main documentation index was updated to highlight authentication and provide quick usage examples.


🛠️ Improvements & Refactors

  • Refactored the authentication codebase for clarity and maintainability.

  • Improved logging for authentication events (login, register, refresh, logout).

  • Added optional Django password validation during registration.

  • Simplified authentication responses to focus on user data.

  • Improved error handling and messaging across auth flows.


🧪 Testing & Maintenance

  • Validated authentication flows through existing and updated tests.

  • Covered both stateless and stateful configurations.

  • Updated pytest warning filters to match newer Django deprecation warnings.

  • Improved docstrings and inline documentation.


🔄 Backward Compatibility

  • ✅ No breaking changes.

  • ✅ Authentication is fully opt-in.

  • ✅ Existing Lazy Ninja APIs continue to work unchanged.

  • ✅ Projects can enable auth incrementally without affecting existing clients.


🔗 Pull Requests

Full Changelog: v0.6.7...v0.6.8