Skip to main content

A small authentication package using FastAPI and magic

Project description

Pyvise: A FastAPI implementation of account authorization

This project aims to implement authentication using FastAPI and JWT to enable authenticated requests to a backend.

Setup

Prerequisites

A magic.link account

Environment

A sample app using magic.link and gatsby can be seen in the tests/ directory


Overview

Backend Model

The backend uses graphql to communicate with a Hasura graphql instance. I'm using Hasura as a reference design.

Reference Design (https://devhints.io/devise)

Model

create_table :account_profiles do |t|
  t.database_authenticatable
  t.confirmable
  t.recoverable
  t.rememberable
  t.trackable
  t.timestamps
end

Helpers

user_signed_in? current_user user_session destroy_user_session_path (Logout) new_user_session_path (Login) edit_user_registration_path (Edit registration) new_user_registration_path (Register new user)

Middleware

before_filter :authenticate_user!

Routes

Session routes for Authenticatable (default)

#      new_user_session GET  /users/sign_in                    {:controller=>"devise/sessions", :action=>"new"}
#          user_session POST /users/sign_in                    {:controller=>"devise/sessions", :action=>"create"}
#  destroy_user_session GET  /users/sign_out                   {:controller=>"devise/sessions", :action=>"destroy"}

# # Password routes for Recoverable, if User model has :recoverable configured
#     new_user_password GET  /users/password/new(.:format)     {:controller=>"devise/passwords", :action=>"new"}
#    edit_user_password GET  /users/password/edit(.:format)    {:controller=>"devise/passwords", :action=>"edit"}
#         user_password PUT  /users/password(.:format)         {:controller=>"devise/passwords", :action=>"update"}
#                       POST /users/password(.:format)         {:controller=>"devise/passwords", :action=>"create"}

# # Confirmation routes for Confirmable, if User model has :confirmable configured
# new_user_confirmation GET  /users/confirmation/new(.:format) {:controller=>"devise/confirmations", :action=>"new"}
#     user_confirmation GET  /users/confirmation(.:format)     {:controller=>"devise/confirmations", :action=>"show"}
#                       POST /users/confirmation(.:format)     {:controller=>"devise/confirmations", :action=>"create"}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvise-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvise-0.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pyvise-0.1.0.tar.gz.

File metadata

  • Download URL: pyvise-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyvise-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66888111d5fa4605a84ea53066edaa01ff81ae590d08a953314a39efcef16841
MD5 e4e30d6c7b605964342e1212354b71d9
BLAKE2b-256 0d1f30d934f2ba80ee4afb325f6351c1e357adf1adecabf75214be6d86817b28

See more details on using hashes here.

File details

Details for the file pyvise-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyvise-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pyvise-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59dc6bf6cee999b671af9f614c458a7c79404187e196a47ef02f41f49ff3794f
MD5 5bb10f8d7703b2b50674fcdc2f977b52
BLAKE2b-256 bbc97adb216c7ea75a2d7a23f4a33afdcde1047553f2bab7338d848f34a56b18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page