Skip to content

Releases: yezz123/authx

🔖 0.3.1 - SessionStorage

15 Jan 14:29
cedd08e

Choose a tag to compare

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

  • chore(dev): Add Sessions Requirements by @yezz123 in #207
  • chore(docs): Documented the Functionality of Session Storing by @yezz123 in #208

Full Changelog: 0.3.0...0.3.1

0.3.0

08 Jan 03:29
88899ce

Choose a tag to compare

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: 0.2.0...0.3.0

Support Oauth2 Middleware 🎉

01 Jan 01:24
7312915

Choose a tag to compare

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

  • Remove unnecessary calls to enumerate when the index variable is not used. by @yezz123 in #179
  • chore: Create a Basic Example to serve the utility of AuthX by @yezz123 in #178
  • Clean DocString & Define Functions by @yezz123 in #189

Full Changelog: 0.1.4...0.2.0

0.1.4✨

12 Dec 22:49
3014635

Choose a tag to compare

What's Changed

  • Add FastAPI to Classifiers. #163
  • Drop the Using of Docker (CI). #165
  • Ignore some Functions and Classes from Tests. #168
  • Updates Development Dependencies. #155 ... #174 (Check full Changelog).
  • Update to FastAPI 0.70.1 #174

Full Changelog: 0.1.3...0.1.4

Bump PyJWT version from 1.7.1 to 2.3.0 ✨

14 Nov 19:00
df66af8

Choose a tag to compare

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

What's Changed

New Contributors

Full Changelog: 0.1.2...0.1.3

pep-0008: Fix Package and Module Names ✨

08 Nov 17:53
8215a2b

Choose a tag to compare

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: 0.1.1...0.1.2

Fix Partial Database Route ✨

26 Oct 02:19
175eb21

Choose a tag to compare

  • 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: 0.1.0...0.1.1

Bump to py3.10 ✨

24 Oct 01:28
e6810ad

Choose a tag to compare

What's Changed

Full Changelog: 0.0.9...0.1.0

Code Coverage ✨

20 Oct 16:25
bae7479

Choose a tag to compare

What's Changed

Full Changelog: 0.0.8...0.0.9

Switch License ✨

17 Oct 11:23
c79b36d

Choose a tag to compare

What's Changed

Full Changelog: 0.0.7...0.0.8