Skip to content

Commit

Permalink
Merge pull request #32 from wwwesleyyy/master
Browse files Browse the repository at this point in the history
Fix simple docstring typos
  • Loading branch information
kgritesh committed Jul 13, 2019
2 parents 923a2fe + e514869 commit 718fb0a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions falcon_auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
"""

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions falcon_auth/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 718fb0a

Please sign in to comment.