Skip to content

Release Notes 🎞

0.4.0

HTTPCache

Overview

HTTP caching occurs when the browser stores local copies of web resources for faster retrieval the next time the resource is required. As your application serves resources it can attach cache headers to the response specifying the desired cache behavior.

Overview

When an item is fully cached, the browser may choose to not contact the server at all and simply use its cached copy:

Overview

HTTP cache headers

There are two primary cache headers, Cache-Control and Expires.

Cache-Control

The Cache-Control header is the most important header to set as it effectively switches on caching in the browser. With this header in place, and set with a value that enables caching, the browser will cache the file for as long as specified. Without this header, the browser will re-request the file on each subsequent request.

Expires

When accompanying the Cache-Control header, Expires simply sets a date from which the cached resource should no longer be considered valid. From this date forward the browser will request a fresh copy of the resource.

This Introduction to HTTP Caching is based on the HTTP Caching Guide.

AuthX provides a simple HTTP caching model designed to work with FastAPI,

Initialize the cache

from authx import HTTPCache
from pytz import timezone

africa_Casablanca = timezone('Africa/Casablanca')
HTTPCache.init(redis_url=REDIS_URL, namespace='test_namespace', tz=africa_Casablanca)

What's Changed

New Contributors

Full Changelog: https://github.com/yezz123/authx/compare/0.3.1...0.4.0

0.3.1

Session

This is a supported Redis Based Session Storage for your FastAPI Application, you can use it with any Session Backend.

pip install authx[session]

Note: The requirements in authx[redis] are not the same used in Sessions features.

Features


  • Dependency injection to protect routes
  • Compatible with FastAPI's auto-generated docs
  • Pydantic models for verifying session data
  • Abstract session backend so you can build one that fits your needs
  • Abstract frontends to choose how you extract the session ids (cookies, header, etc.)
  • Create verifiers based on the session data.
  • Compatible with any Redis Configuration.
Redis Configuration

Before setting up our Sessions Storage and our CRUD Backend, we need to configure our Redis Instance.

BasicConfig is a function that helps us set up the Instance Information like Redis Link Connection or ID Name or Expiration Time.

Default Config
  • url of Redis: redis://localhost:6379/0
  • name of sessionId: ssid
  • generator function of sessionId: lambda :uuid.uuid4().hex
  • expire time of session in redis: 6 hours
import random
from datetime import timedelta
from authx.cache import basicConfig

basicConfig(
    redisURL="redis://localhost:6379/1",
    sessionIdName="sessionId",
    sessionIdGenerator=lambda: str(random.randint(1000, 9999)),
    expireTime=timedelta(days=1),
)

What's Changed

Full Changelog: https://github.com/yezz123/authx/compare/0.3.0...0.3.1

0.3.0

What's Changed

Release Notes

Finally, we drop the full support from MongoDB Thanks to @stephane That's implemented some functionality under the name of BaseDBBackend and Create some Database Crud Functionality without a database.

  • Database Plugins:
  • MongoDB: Using MongoDB as a Database Backend is now supported as a plugin based on BaseDBBackend.
  • EncodeDB: Databases give you simple asyncio support for a range of databases.

    It allows you to make queries using the powerful SQLAlchemy Core expression language and provides support for PostgreSQL, MySQL, and SQLite.

    We can now provide some SQL queries to the database on the top of BaseDBBackend.

MongoDB

from authx import MongoDBBackend

EncodeDB

from authx import EncodeDBBackend

Note: Don't forget to set up the database connection as a client that will be functioned under pre-built Methods.

  • Improve the package by Switching to flit to build the package.
  • Improve Workflow and integrate codecov.yml.
  • Use the issue of new Functionalities in Github.
  • Create New Directory called scripts to store the shell scripts to run tests or linting.
  • Improve Importing the package https://github.com/yezz123/authx/blob/main/authx/__init__.py.
  • Calling the function or the class directly from the __init__.py file.
  • Improve Documentation, and Describe different new Addons, that AuthX now provide such as new Database Backends or Plugins or the new middleware add-ons, Thanks to @AbderrahimSoubaiElidrissi
  • Update and upgrade Dependencies.
  • Inline and improve IDLE Support.

Full Changelog: https://github.com/yezz123/authx/compare/0.2.0...0.3.0

0.2.0

What's Changed

Middleware - Oauth2

The OAuth 2.0 authorization framework is a protocol that allows a user to grant a third-party website or application access to the user's protected resources, without necessarily revealing their long-term credentials or even their identity.

Starlette middleware for authentication through oauth2's via a secret key, which is often used to add authentication and authorization to a web application that interacts with an API on behalf of the user.

That's why AuthX provides a Configuration MiddlewareOauth2 to configure the OAuth2 middleware.

from authx import MiddlewareOauth2

class AuthenticateMiddleware(MiddlewareOauth2):
    PUBLIC_PATHS = {"/public"}

Code Enhancement

Full Changelog: https://github.com/yezz123/authx/compare/0.1.4...0.2.0

0.1.4

What's Changed

Full Changelog: https://github.com/yezz123/authx/compare/0.1.3...0.1.4

0.1.3

  • Fix the issue relate to PyJWT (Bumping version #151 )
  • Add sameSite to Cookies metadata ( #134)

What's Changed

New Contributors

Full Changelog: https://github.com/yezz123/authx/compare/0.1.2...0.1.3

0.1.2

After this discussion #124 with @stephane we need to change the package name that what pep's rules provide.

Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.

carbon

What's Changed

New Contributors

Full Changelog: https://github.com/yezz123/authx/compare/0.1.1...0.1.2

0.1.1

  • Kuddos to @AbderrahimSoubaiElidrissi for fixing multiple issues in docs ✨
  • Fix Database partial router.
  • Now we can call the cache or mongo only from a partial router.

Example

main py

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.1.0...0.1.1

0.1.0

  • Provide a full support for python 3.10 after adding a testcase (workflow), and fix the version of pytest.
  • Provide a full requirements for Setup.py with all the dependencies and classifiers.

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.9...0.1.0

0.0.9

  • Add Code coverage and local testing for AuthenticationX.
  • Add DocString to Some Functions relate to Services.
  • Bump multiple packages to last release.

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.8...0.0.9

0.0.8

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.7...0.0.8

0.0.7

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.6...0.0.7

0.0.6

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.5...0.0.6

0.0.5

All this is based on This PR #45 :

  • here I fix issues related to documentation.
  • Generate a docstring for the main file.

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.4...0.0.5

0.0.4

During the work on this PR #44 :

  • I generate a docstring to improve the project & clear some parts of the code.
  • Add an Issue Template (Pre-public).
  • Create a simple Readme For the whole users.
  • Adding New Commands relate to the bumpversion package in the Makefile.

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.3...0.0.4

0.0.3

  • Create a simple Readme.
  • Create a Build to release the package.
  • Fix Test Issues

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.2...0.0.3

0.0.2

Create a Testable Core for Email and work on Users and JWT. work on a PR to test the Services and Provide more Routers tests

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/compare/0.0.1...0.0.2

0.0.1

  • Create Authentication Routes ex. Register, login, logout, and Reset.
  • Add The Social Authentication Routes, Connecting using Google and Facebook.
  • Give the Admin the Permission of Adding a User to the Blacklist or Ban a User from The API.
  • Done with Setup of Multiple Routes and Fix The Crud Issues.
  • Use the JWT package For Creating tokens and checking, also the Email Provider works with booths aiosmtplib and email-validator.
  • Provide the Common Models ex. Users Models and Social Models.
  • Create a Multiple Errors Support for Route and Models Validation or also if the Social Authentication CallBack got Errors.
  • Add A Recaptcha Bypass using Httpx Library and Create A String and Signature Generator using Passlib.
  • Using passlib to Verify the Password and Hash it under sha256.
  • Set up a workflow to Test The Project in a Docker environment.

What's Changed

Full Changelog: https://github.com/yezz123/AuthX/commits/0.0.1