authstar


Nameauthstar JSON
Version 0.0.6 PyPI version JSON
download
home_pageNone
SummaryAuthstar ASGI Middleware for client authentication
upload_time2025-10-24 21:13:55
maintainerNone
docs_urlNone
authorJohn Wagenleitner
requires_python<3.15.0,>=3.12
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords authentication asgi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Authstar

ASGI Middleware that can be configured with various authenticator functions
that are used to authenticate clients from the ASGI Scope. The authenticated
client information (`client_id`, `scopes`, etc.) is added to the ASGI Scope
and can be retrieved later in the request lifecycle in order to secure
routes, require additional authentication and/or make other decisions during
the request lifecycle.

In addition to the middleware, **Authstar** provides an extension that can be
used with **FastAPI** in order to reduce the boilerplate when securing routes
and providing an OAuth2 Token endpoint.

## Middleware

The middleware should be one of the first to run. If the application is using
some type of session middleware, the **AuthstarMiddleware** should be
configured to run just after the session middleware.

Example configuring the middleware for **FastAPI**:

```python
import fastapi
from authstar import AuthstarMiddleware, Client, HeaderAuth, Scope

app = fastapi.FastAPI()


async def on_auth_bearer(token: str) -> Client | None:
    ...


async def on_auth_basic(username: str, password: str) -> Client | None:
    ...


async def on_auth_api_key(token: str) -> Client | None:
    ...


async def on_auth_scope_session(scope: Scope) -> Client | None:
    ...


app.add_middleware(
    AuthstarMiddleware,
    on_auth_bearer=on_auth_bearer,
    on_auth_basic=on_auth_basic,
    on_auth_header=HeaderAuth.x_api_key(on_auth_api_key),
    on_auth_scope=on_auth_scope_session,
)
```

The `scope_key` parameter defines the dict key in the ASGI Scope where the
client information will be stored. The default is `authstar.client`. For
example, using `scope_key="users"` would match what the **Starlette**
Authentication Middleware uses and allow for using `request.user` if using
that framework or a framework built on **Starlette**.

The `AuthstarClient` model can be subclassed to allow for additional
attributes or methods to be added. If subclassing is not desired, any object
that implements the `authstar.Client` protocol can be used.

## FastAPI Extension

The `authstar.fastapi` module provides functionality that helps to reduce
boilerplate when securing routes.

The `authstar.fastapi.RouteSecurity` class can be configured to use the
same `scope_key` that the middleware uses in order to retrieve the stored
client information. The class provides several methods that can be used to
secure routes.

### Route Authorization

Once an instance is configured with the `scope_key`, the methods can be used
as dependencies in order to secure routes.

Here are some examples. Note that the dependencies can be added to a route,
router and/or the application:

```python
from typing import Annotated, Any

import authstar.fastapi
from authstar import Client
from fastapi import APIRouter, Security

route_security = authstar.fastapi.RouteSecurity()

insecure_router = APIRouter()
router = APIRouter(dependencies=[Security(route_security.authenticated)])


@insecure_router.get("/")
async def homepage():
    ...


@insecure_router.get("/healthcheck", dependencies=[Security(route_security.internal)])
async def healthcheck() -> dict[str, str]:
    """Returns HTTP 403 unless client is making request from an internal network.

    This example shows how to secure a route that should be accessible by
    unauthenticated clients where security is associated with some other
    request attribute (client ip in this case).
    """
    return {"status": "ok"}


@insecure_router.get("/foo", dependencies=[Security(route_security.authenticated)])
async def foo() -> dict[str, str]:
    """Returns HTTP 403 unless client is authenticated.

    This example shows how to secure the route if the security is not applied
    at the router level, and if the client information is not required. If
    the client information is required, then see the example below that uses
    the Annotated parameter.
    """
    return {"status": "bar"}


@router.get("/me")
async def me(
    auth_client: Annotated[Client, Security(route_security.authenticated)]
) -> dict[str, Any]:
    """Returns HTTP 403 unless client is unauthenticated.

    Also provides the client info as a parameter. The `router` is already
    secured and requires an authenticated client. This example shows that
    the client information can be retrieved as a parameter. Even if this
    route used the `insecure_router`, it would still be secured because
    of the Annotated parameter.
    """
    return auth_client.model_dump()


@router.get("/me2")
async def me2(
    auth_client: Annotated[Client, Security(route_security.scopes, scopes=["api-user"])]
) -> dict[str, Any]:
    """Returns HTTP 403 unless client is unauthenticated and has the given scope(s).

    Similar to the `authenticated` method, but also checks that the client has at
    least one of the specified scope values.
    """
    return auth_client.model_dump()
```

### OAuth2 Token Endpoint

The `RouteSecurity` class provides a convenience method that handles the
boilerplate required to serve an OAuth2 Token Endpoint. It supports the
`client_credentials` grant type and can handle client auth using either HTTP
Basic auth (handled by the **AuthstarMiddleware**) or by using the `client_id`
and `client_secret` form fields (requires an authenticator function).

If an `on_auth_basic` authenticator function is not provided, only HTTP Basic
Auth will be supported by the endpoint.

```python
from authstar import Client
from authstar.fastapi import OAuth2TokenRequest, OAuth2TokenResponse, RouteSecurity
from fastapi import APIRouter

router = APIRouter()
route_security = RouteSecurity()

async def oauth2_token_builder(
    oauth_req: OAuth2TokenRequest, client: Client
) -> OAuth2TokenResponse:
   # build a JWT and use it to return the response
   pass

async def verify_auth_basic(username: str, password: str) -> Client | None:
    pass

router.post("/oauth2/token")(
    route_security.oauth2_token_endpoint(
        token_builder=oauth2_token_builder,
        on_auth_basic=verify_auth_basic,
    )
)
```

### OpenAPI Available Authorizations

The `RouteSecurity` class provides a set of methods that return dependencies
that can be used to control the list of available authorizations that will be
listed in the generated `openapi.json`.

- `openapi_api_key`
- `openapi_http_basic`
- `openapi_oauth2_client_credentials`

When used as dependencies on a route, router and/or application, they enable
clients to authorize using the given methods at the OpenAPI endpoint client.
They are strictly no-op markers and do not perform any actual
authentication/authorization.

For example, adding the dependencies to the `router` below will enable the
OpenAPI docs endpoint client to prompt for either an API Key or client
credentials (`client_id`/`client_secret`):

```python
from authstar.fastapi import RouteSecurity
from fastapi import APIRouter

route_security = RouteSecurity()

router = APIRouter(
    dependencies=[
        route_security.openapi_api_key(),
        route_security.openapi_oauth2_client_credentials(),
    ],
)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "authstar",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.15.0,>=3.12",
    "maintainer_email": null,
    "keywords": "Authentication, ASGI",
    "author": "John Wagenleitner",
    "author_email": "John Wagenleitner <johnwa@mail.fresnostate.edu>",
    "download_url": "https://files.pythonhosted.org/packages/d3/1f/fa1b8f35e7b0dc251f7bae3e7fe7d1cea451cd65a563f30f457527f6eb4c/authstar-0.0.6.tar.gz",
    "platform": null,
    "description": "# Authstar\n\nASGI Middleware that can be configured with various authenticator functions\nthat are used to authenticate clients from the ASGI Scope. The authenticated\nclient information (`client_id`, `scopes`, etc.) is added to the ASGI Scope\nand can be retrieved later in the request lifecycle in order to secure\nroutes, require additional authentication and/or make other decisions during\nthe request lifecycle.\n\nIn addition to the middleware, **Authstar** provides an extension that can be\nused with **FastAPI** in order to reduce the boilerplate when securing routes\nand providing an OAuth2 Token endpoint.\n\n## Middleware\n\nThe middleware should be one of the first to run. If the application is using\nsome type of session middleware, the **AuthstarMiddleware** should be\nconfigured to run just after the session middleware.\n\nExample configuring the middleware for **FastAPI**:\n\n```python\nimport fastapi\nfrom authstar import AuthstarMiddleware, Client, HeaderAuth, Scope\n\napp = fastapi.FastAPI()\n\n\nasync def on_auth_bearer(token: str) -> Client | None:\n    ...\n\n\nasync def on_auth_basic(username: str, password: str) -> Client | None:\n    ...\n\n\nasync def on_auth_api_key(token: str) -> Client | None:\n    ...\n\n\nasync def on_auth_scope_session(scope: Scope) -> Client | None:\n    ...\n\n\napp.add_middleware(\n    AuthstarMiddleware,\n    on_auth_bearer=on_auth_bearer,\n    on_auth_basic=on_auth_basic,\n    on_auth_header=HeaderAuth.x_api_key(on_auth_api_key),\n    on_auth_scope=on_auth_scope_session,\n)\n```\n\nThe `scope_key` parameter defines the dict key in the ASGI Scope where the\nclient information will be stored. The default is `authstar.client`. For\nexample, using `scope_key=\"users\"` would match what the **Starlette**\nAuthentication Middleware uses and allow for using `request.user` if using\nthat framework or a framework built on **Starlette**.\n\nThe `AuthstarClient` model can be subclassed to allow for additional\nattributes or methods to be added. If subclassing is not desired, any object\nthat implements the `authstar.Client` protocol can be used.\n\n## FastAPI Extension\n\nThe `authstar.fastapi` module provides functionality that helps to reduce\nboilerplate when securing routes.\n\nThe `authstar.fastapi.RouteSecurity` class can be configured to use the\nsame `scope_key` that the middleware uses in order to retrieve the stored\nclient information. The class provides several methods that can be used to\nsecure routes.\n\n### Route Authorization\n\nOnce an instance is configured with the `scope_key`, the methods can be used\nas dependencies in order to secure routes.\n\nHere are some examples. Note that the dependencies can be added to a route,\nrouter and/or the application:\n\n```python\nfrom typing import Annotated, Any\n\nimport authstar.fastapi\nfrom authstar import Client\nfrom fastapi import APIRouter, Security\n\nroute_security = authstar.fastapi.RouteSecurity()\n\ninsecure_router = APIRouter()\nrouter = APIRouter(dependencies=[Security(route_security.authenticated)])\n\n\n@insecure_router.get(\"/\")\nasync def homepage():\n    ...\n\n\n@insecure_router.get(\"/healthcheck\", dependencies=[Security(route_security.internal)])\nasync def healthcheck() -> dict[str, str]:\n    \"\"\"Returns HTTP 403 unless client is making request from an internal network.\n\n    This example shows how to secure a route that should be accessible by\n    unauthenticated clients where security is associated with some other\n    request attribute (client ip in this case).\n    \"\"\"\n    return {\"status\": \"ok\"}\n\n\n@insecure_router.get(\"/foo\", dependencies=[Security(route_security.authenticated)])\nasync def foo() -> dict[str, str]:\n    \"\"\"Returns HTTP 403 unless client is authenticated.\n\n    This example shows how to secure the route if the security is not applied\n    at the router level, and if the client information is not required. If\n    the client information is required, then see the example below that uses\n    the Annotated parameter.\n    \"\"\"\n    return {\"status\": \"bar\"}\n\n\n@router.get(\"/me\")\nasync def me(\n    auth_client: Annotated[Client, Security(route_security.authenticated)]\n) -> dict[str, Any]:\n    \"\"\"Returns HTTP 403 unless client is unauthenticated.\n\n    Also provides the client info as a parameter. The `router` is already\n    secured and requires an authenticated client. This example shows that\n    the client information can be retrieved as a parameter. Even if this\n    route used the `insecure_router`, it would still be secured because\n    of the Annotated parameter.\n    \"\"\"\n    return auth_client.model_dump()\n\n\n@router.get(\"/me2\")\nasync def me2(\n    auth_client: Annotated[Client, Security(route_security.scopes, scopes=[\"api-user\"])]\n) -> dict[str, Any]:\n    \"\"\"Returns HTTP 403 unless client is unauthenticated and has the given scope(s).\n\n    Similar to the `authenticated` method, but also checks that the client has at\n    least one of the specified scope values.\n    \"\"\"\n    return auth_client.model_dump()\n```\n\n### OAuth2 Token Endpoint\n\nThe `RouteSecurity` class provides a convenience method that handles the\nboilerplate required to serve an OAuth2 Token Endpoint. It supports the\n`client_credentials` grant type and can handle client auth using either HTTP\nBasic auth (handled by the **AuthstarMiddleware**) or by using the `client_id`\nand `client_secret` form fields (requires an authenticator function).\n\nIf an `on_auth_basic` authenticator function is not provided, only HTTP Basic\nAuth will be supported by the endpoint.\n\n```python\nfrom authstar import Client\nfrom authstar.fastapi import OAuth2TokenRequest, OAuth2TokenResponse, RouteSecurity\nfrom fastapi import APIRouter\n\nrouter = APIRouter()\nroute_security = RouteSecurity()\n\nasync def oauth2_token_builder(\n    oauth_req: OAuth2TokenRequest, client: Client\n) -> OAuth2TokenResponse:\n   # build a JWT and use it to return the response\n   pass\n\nasync def verify_auth_basic(username: str, password: str) -> Client | None:\n    pass\n\nrouter.post(\"/oauth2/token\")(\n    route_security.oauth2_token_endpoint(\n        token_builder=oauth2_token_builder,\n        on_auth_basic=verify_auth_basic,\n    )\n)\n```\n\n### OpenAPI Available Authorizations\n\nThe `RouteSecurity` class provides a set of methods that return dependencies\nthat can be used to control the list of available authorizations that will be\nlisted in the generated `openapi.json`.\n\n- `openapi_api_key`\n- `openapi_http_basic`\n- `openapi_oauth2_client_credentials`\n\nWhen used as dependencies on a route, router and/or application, they enable\nclients to authorize using the given methods at the OpenAPI endpoint client.\nThey are strictly no-op markers and do not perform any actual\nauthentication/authorization.\n\nFor example, adding the dependencies to the `router` below will enable the\nOpenAPI docs endpoint client to prompt for either an API Key or client\ncredentials (`client_id`/`client_secret`):\n\n```python\nfrom authstar.fastapi import RouteSecurity\nfrom fastapi import APIRouter\n\nroute_security = RouteSecurity()\n\nrouter = APIRouter(\n    dependencies=[\n        route_security.openapi_api_key(),\n        route_security.openapi_oauth2_client_credentials(),\n    ],\n)\n```\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright [yyyy] [name of copyright owner]  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
    "summary": "Authstar ASGI Middleware for client authentication",
    "version": "0.0.6",
    "project_urls": {
        "Home": "https://github.com/jowage58/authstar",
        "Source": "https://github.com/jowage58/authstar"
    },
    "split_keywords": [
        "authentication",
        " asgi"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1b008de523d8d19e274e1fc17e6dfb1e0d81128055fe1c243611173ac16704c3",
                "md5": "a41b9f91416b49076f0309d9cc2942b3",
                "sha256": "f9972a74518ca279c7f20c695551cb6823a4bce665caea5287ded2b0e5481937"
            },
            "downloads": -1,
            "filename": "authstar-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a41b9f91416b49076f0309d9cc2942b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.15.0,>=3.12",
            "size": 14968,
            "upload_time": "2025-10-24T21:13:54",
            "upload_time_iso_8601": "2025-10-24T21:13:54.527827Z",
            "url": "https://files.pythonhosted.org/packages/1b/00/8de523d8d19e274e1fc17e6dfb1e0d81128055fe1c243611173ac16704c3/authstar-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d31ffa1b8f35e7b0dc251f7bae3e7fe7d1cea451cd65a563f30f457527f6eb4c",
                "md5": "0d235e1db46558dc502947d3576426d5",
                "sha256": "dd94aaee308b24604e8132a4a9ecddea440d4ee161d2a6f829ced1a3da00cdee"
            },
            "downloads": -1,
            "filename": "authstar-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "0d235e1db46558dc502947d3576426d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.15.0,>=3.12",
            "size": 14014,
            "upload_time": "2025-10-24T21:13:55",
            "upload_time_iso_8601": "2025-10-24T21:13:55.795575Z",
            "url": "https://files.pythonhosted.org/packages/d3/1f/fa1b8f35e7b0dc251f7bae3e7fe7d1cea451cd65a563f30f457527f6eb4c/authstar-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-24 21:13:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jowage58",
    "github_project": "authstar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "authstar"
}
        
Elapsed time: 2.67792s