From e5148694722cd344ae85941442ad0cad1e829ed6 Mon Sep 17 00:00:00 2001 From: Wesley Kincaid Date: Fri, 7 Jun 2019 22:38:52 -0500 Subject: [PATCH] Fix simple docstring typos --- falcon_auth/backends.py | 20 ++++++++++---------- falcon_auth/middleware.py | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/falcon_auth/backends.py b/falcon_auth/backends.py index 971b3c6..77230af 100644 --- a/falcon_auth/backends.py +++ b/falcon_auth/backends.py @@ -32,7 +32,7 @@ class AuthBackend(object): Base Class for all authentication backends. If successfully authenticated must return the authenticated `user` object. In case authorization header is not set properly or there is a credential mismatch, results in an - `falcon.HTTPUnauthoried exception` with proper description of the issue + `falcon.HTTPUnauthorized exception` with proper description of the issue Args: user_loader(function, required): A callback function that is called with the @@ -147,11 +147,11 @@ class JWTAuthBackend(AuthBackend): audience(string, optional): Specifies the string that will be specified as value of ``aud`` field in the jwt payload. It will also be checked - agains the ``aud`` field while decoding. + against the ``aud`` field while decoding. issuer(string, optional): Specifies the string that will be specified as value of ``iss`` field in the jwt payload. It will also be checked - agains the ``iss`` field while decoding. + against the ``iss`` field while decoding. """ @@ -214,7 +214,7 @@ def authenticate(self, req, resp, resource): """ Extract auth token from request `authorization` header, decode jwt token, verify configured claims and return either a ``user`` - object if successful else raise an `falcon.HTTPUnauthoried exception` + object if successful else raise an `falcon.HTTPUnauthorized exception` """ payload = self._decode_jwt_token(req) user = self.user_loader(payload) @@ -306,9 +306,9 @@ def _extract_credentials(self, req): def authenticate(self, req, resp, resource): """ - Extract basic auth token from request `authorization` header, deocode the + Extract basic auth token from request `authorization` header, decode the token, verifies the username/password and return either a ``user`` - object if successful else raise an `falcon.HTTPUnauthoried exception` + object if successful else raise an `falcon.HTTPUnauthorized exception` """ username, password = self._extract_credentials(req) user = self.user_loader(username, password) @@ -340,8 +340,8 @@ def get_auth_token(self, user_payload): class TokenAuthBackend(BasicAuthBackend): """ - Implements Simple Token Based Authentication. Clients should authenticate by passing the token key in the "Authorization" - HTTP header, prepended with the string "Token ". For example: + Implements Simple Token Based Authentication. Clients should authenticate by passing the token key in the + "Authorization" HTTP header, prepended with the string "Token ". For example: Authorization: Token 401f7ac837da42b97f613d789819ff93537bee6a @@ -442,7 +442,7 @@ def __init__(self, user_loader, receiver_kwargs): def parse_auth_token_from_request(self, auth_header): """ Parses and returns the Hawk Authorization header if it is present and well-formed. - Raises `falcon.HTTPUnauthoried exception` with proper error message + Raises `falcon.HTTPUnauthorized exception` with proper error message """ if not auth_header: raise falcon.HTTPUnauthorized( @@ -496,7 +496,7 @@ def authenticate(self, req, resp, resource): class MultiAuthBackend(AuthBackend): """ A backend which takes two or more ``AuthBackend`` as inputs and successfully - authenticates if either of them succeeds else raises `falcon.HTTPUnauthoried exception` + authenticates if either of them succeeds else raises `falcon.HTTPUnauthorized exception` Args: backends(AuthBackend, required): A list of `AuthBackend` to be used in diff --git a/falcon_auth/middleware.py b/falcon_auth/middleware.py index fdade50..3477709 100644 --- a/falcon_auth/middleware.py +++ b/falcon_auth/middleware.py @@ -12,13 +12,13 @@ class FalconAuthMiddleware(object): """ Creates a falcon auth middleware that uses given authentication backend, and some - optinal configuration to authenticate requests. After initializing the + optional configuration to authenticate requests. After initializing the authentication backend globally you can override the backend as well as - other configuration for a particular resource by setting the `auth` attribute + other configuration for a particular resource by setting the `auth` attribute on it to an instance of this class. The authentication backend must return an authenticated user which is then - set as `request.context.user` to be used further down by resources othewise + set as `request.context.user` to be used further down by resources otherwise an `falcon.HTTPUnauthorized` exception is raised. Args: