Skip to content

Commit d4e06c4

Browse files
author
Landon Gilbert-Bland
committed
Minor documentation formatting improvements
1 parent e2433d3 commit d4e06c4

6 files changed

+16
-16
lines changed

docs/add_custom_data_claims.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Storing Data in Access Tokens
22
=============================
33
You may want to store additional information in the access token which you could
4-
later access in the protected views. This can be done using the `additional_claims`
4+
later access in the protected views. This can be done using the ``additional_claims``
55
argument with the :func:`~flask_jwt_extended.create_access_token` or
66
:func:`~flask_jwt_extended.create_refresh_token` functions. The claims
77
can be accessed in a protected route via the :func:`~flask_jwt_extended.get_jwt`
@@ -18,8 +18,8 @@ Alternately you can use the :meth:`~flask_jwt_extended.JWTManager.additional_cla
1818
decorator to register a callback function that will be called whenever a new JWT
1919
is created, and return a dictionary of claims to add to that token. In the case
2020
that both :meth:`~flask_jwt_extended.JWTManager.additional_claims_loader` and the
21-
`additional_claims` argument are used, both results are merged together, with ties
22-
going to the data suplied by the `additional_claims` argument.
21+
``additional_claims`` argument are used, both results are merged together, with ties
22+
going to the data suplied by the ``additional_claims`` argument.
2323

2424
.. code-block:: python
2525

docs/automatic_user_loading.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ accessing a protected route. We provide a couple callback functions that make
66
this seemless while working with JWTs.
77

88
The first is :meth:`~flask_jwt_extended.JWTManager.user_identity_loader`, which
9-
will convert any `User` object used to create a JWT into a JSON serializable format.
9+
will convert any ``User`` object used to create a JWT into a JSON serializable format.
1010

1111
On the flip side, you can use :meth:`~flask_jwt_extended.JWTManager.user_lookup_loader`
12-
to automaticallly load your `User` object when a JWT is present in the request.
12+
to automaticallly load your ``User`` object when a JWT is present in the request.
1313
The loaded user is available in your protected routes via :attr:`~flask_jwt_extended.current_user`.
1414

1515
Lets see an example of this while utilizing SQLAlchemy to store our users:

docs/blocklist_and_token_revoking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extension, you must defining a callback function via the
88
:meth:`~flask_jwt_extended.JWTManager.token_in_blocklist_loader` decorator.
99
This function is called whenever a valid JWT is used to access a protected route.
1010
The callback will receive the JWT header and JWT payload as arguments, and must
11-
return `True` if the JWT has been revoked.
11+
return ``True`` if the JWT has been revoked.
1212

1313
In production, you will want to use some form of persistent storage (database,
1414
redis, etc) to store your JWTs. It would be bad if your application forgot that

docs/optional_endpoints.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Partially protecting routes
33

44
There may be cases where you want to use the same route regardless of if a JWT
55
is present in the requst or not. In these situations, you can use
6-
:func:`~flask_jwt_extended.jwt_required` with the `optional=True` argument. This
6+
:func:`~flask_jwt_extended.jwt_required` with the ``optional=True`` argument. This
77
will allow the endpoint to be accessed regardless of if a JWT is sent in with
88
the request.
99

docs/refreshing_tokens.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ an access token. Here is an example using `HTTPie <https://httpie.io/>`_.
5858
Token Freshness Pattern
5959
~~~~~~~~~~~~~~~~~~~~~~~
6060
The token freshness pattern is a very simple idea. Every time a user authenticates
61-
by providing a username and password, they receive a `fresh` access token that
61+
by providing a username and password, they receive a ``fresh`` access token that
6262
can access any route. But after some time, that token should no longer be considered
63-
`fresh`, and some critical or dangerous routes will be blocked until the user
63+
``fresh``, and some critical or dangerous routes will be blocked until the user
6464
verifies their password again. All other routes will still work normally for
65-
the user even though their token is no longer `fresh`. As an example, we might
66-
not allow users to change their email address unless they have a `fresh` token,
65+
the user even though their token is no longer ``fresh``. As an example, we might
66+
not allow users to change their email address unless they have a ``fresh`` token,
6767
but we do allow them use the rest of our Flask application normally.
6868

6969
The token freshness pattern is built into this extension, and works seamlessly
@@ -74,7 +74,7 @@ refresh example).
7474
.. literalinclude:: ../examples/token_freshness.py
7575

7676
We also support marking a token as fresh for a given amount of time after it
77-
is created. You can do this by passing a `datetime.timedelta` to the `fresh`
77+
is created. You can do this by passing a ``datetime.timedelta`` to the ``fresh``
7878
option when creating JWTs:
7979

8080
.. code-block :: python

docs/token_locations.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
JWT Locations
22
=============
33
JWTs can be sent in with a request in many different ways. You can control which
4-
ways you want to accept JWTs in your Flask application via the `JWT_TOKEN_LOCATION`
4+
ways you want to accept JWTs in your Flask application via the ``JWT_TOKEN_LOCATION``
55
:ref:`configuration option<Configuration Options>`. You can also override that global
6-
configuration on a per route basis via the `locations` argument in
6+
configuration on a per route basis via the ``locations`` argument in
77
:func:`~flask_jwt_extended.jwt_required`.
88

99
.. literalinclude:: ../examples/jwt_locations.py
@@ -70,7 +70,7 @@ token. This cookie is set as http-only, so that it cannot be access via javascri
7070
(this is what prevents XSS attacks from being able to steal the JWT). The second
7171
cookie we set contains only the same double submit token, but this time in a
7272
cookie that is readable by javascript. Whenever a request is made, it needs to
73-
include an `X-CSRF-TOKEN` header, with the value of the double submit token.
73+
include an ``X-CSRF-TOKEN`` header, with the value of the double submit token.
7474
If the value in this header does not match the value stored in the JWT, the
7575
request is kicked out as invalid.
7676

@@ -80,7 +80,7 @@ different domain will not be able to read the cookie containing the double submi
8080
token on your website, we have successfully thwarted any CSRF attacks.
8181

8282
This does mean that whenever you are making a request, you need to manually
83-
include the `X-CSRF-TOKEN` header, otherwise your requests will be kicked
83+
include the ``X-CSRF-TOKEN`` header, otherwise your requests will be kicked
8484
out as invalid too. Lets look at how to do that:
8585

8686
.. code-block :: javascript

0 commit comments

Comments
 (0)