Skip to main content

HTTP basic authentication middleware for aiohttp.

Parameters

def bam_factory(login, password, bypass_ws=False)

创建一个basic auth的middleware

login:

username

password:

password

bypass_ws:

绕过websocket请求,默认为Flase,不绕过

Usage

# server_simple.py
from aiohttp import web
from aiohttp_bam import bam_factory


async def handle(request):
    return web.Response(text="Hello")


app = web.Application(middlewares=[bam_factory('your username', 'your password')])
app.add_routes([web.get("/", handle)])

web.run_app(app)

Metadata

Release files for aiohttp-bam 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiohttp-bam 0.0.2
File Size Uploaded
aiohttp-bam-0.0.2.tar.gz 1.7 kB Details

Release files / aiohttp-bam-0.0.2.tar.gz

Download URL aiohttp-bam-0.0.2.tar.gz
Size 1.7 kB
Tags Source
SHA-256 checksum
How to use checksums
78ccf70a450b8d9cdcbe124c9ea2ed65ddcbc0a4a8ddc384c5009d2011af6d02
BLAKE2b-256 checksum
How to use checksums
e05d628ef1b210e328c2f45c6aabe9c1708f51d464f81b7eb19968a144a2c940
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page