https://github.com/alan-turing-institute/fastapimsal

Authorization for FastAPI using Microsoft Azure Active Directory

https://github.com/alan-turing-institute/fastapimsal

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    2 of 5 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords

hut23 hut23-rcp
Last synced: 10 months ago · JSON representation

Repository

Authorization for FastAPI using Microsoft Azure Active Directory

Basic Info
  • Host: GitHub
  • Owner: alan-turing-institute
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 634 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 3
  • Releases: 13
Topics
hut23 hut23-rcp
Created over 4 years ago · Last pushed 12 months ago
Metadata Files
Readme License Security

README.md

FastAPI Auth

Authenticate users with FastAPI using the Microsoft MSAL Library and Azure Active Directory.

Getting started

Python dependencies

To get started install Poetry.

Then ensure all dependencies are installed:

bash poetry install

Pre-commit

Run to make CI-tests pass bash poetry run pre-commit run --all-files

Note: SAFETY_API_KEY environment variable needs to be set to run the pre-commit hooks. Create an account with the Safety package and then navigate to Organization > API keys to fetch the key. Once the key has been obtained, set the variable in your terminal using:

bash export SAFETY_API_KEY=your-api-key

Examples

See examples/app.py for a simple example.

Create a .auth.env file:

bash echo "session_expire_time_minutes=1 session_secret=<Session-Cookie-Secret> client_id=<Application-client-id> client_secret=<Application-Client-secret> tenant_id=<Tenant-id" > .auth.env

For the session_secret its a good idea to create a secret with openssl rand -hex 32

To run the example

bash poetry run uvicorn --reload --app-dir examples app:app --reload-dir examples

Owner

  • Name: The Alan Turing Institute
  • Login: alan-turing-institute
  • Kind: organization
  • Email: info@turing.ac.uk

The UK's national institute for data science and artificial intelligence.

GitHub Events

Total
  • Release event: 12
  • Delete event: 14
  • Issue comment event: 5
  • Push event: 14
  • Pull request review event: 3
  • Pull request event: 14
  • Create event: 20
Last Year
  • Release event: 12
  • Delete event: 14
  • Issue comment event: 5
  • Push event: 14
  • Pull request review event: 3
  • Pull request event: 14
  • Create event: 20

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 98
  • Total Committers: 5
  • Avg Commits per committer: 19.6
  • Development Distribution Score (DDS): 0.316
Past Year
  • Commits: 20
  • Committers: 2
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.45
Top Committers
Name Email Commits
Oscar Giles o****s@t****k 67
Iain 2****S 13
joseph-palmer 2****r 11
Markus Hauru m****u@t****k 6
pre-commit p****t@e****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 18 hours
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: about 18 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • Iain-S (8)
  • dependabot[bot] (4)
  • dlpbc (2)
  • joseph-palmer (1)
  • tomaslaz (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4) python (4)