Skip to content

Commit 4d44ff8

Browse files
authored
Cleanup markdown formatting of Readme
1 parent d3268d8 commit 4d44ff8

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ views with only fresh tokens.
278278
### Changing Default Behaviors
279279
We provide what we think are sensible behaviors when attempting to access a protected
280280
endpoint. If the endpoint could not be used for any reason (missing/expired/invalid
281-
access token, etc) we will return json in the format of {'msg': <why accesing endpoint failed>}
281+
access token, etc) we will return json in the format of **{'msg': 'why accesing endpoint failed'}**
282282
along with an appropriate http status code (generally 401 or 422). However, you may want
283283
to customize what is returned for a given case. We can do that with the jwt_manager
284284
**_loader** functions.
@@ -323,30 +323,30 @@ Now if an expired token tries to access the protected endpoint, we will get the
323323
json we specified back instead of the default implementation.
324324

325325
The available loader functions are:
326-
* expired_token_loader
327-
* invalid_token_loader (function takes one arg, which is an error string of why its invalid)
328-
* unauthorized_loader
329-
* needs_fresh_token_loader
330-
* revoked_token_loader (see Blacklist and Token Revoking bellow)
326+
327+
| Decorator | Description | Callback Function Arguments |
328+
| --------- | ----------- | --------------------------- |
329+
|expired_token_loader | Function to call when an expired token accesses a protected view | None |
330+
|invalid_token_loader | Function to call when an invalid token accesses a protected view | Takes one argument, which is an error string of why it is invalid|
331+
|unauthorized_loader | Functino to call when a request with no JWT accesses a protected view | None|
332+
|needs_fresh_token_loader | Function to call when a non-fresh token access a **fresh_jwt_required** view | None |
333+
|revoked_token_loader | Function to call when a revoked token accesses a protected view | None |
331334

332335
### Options
333336
You can change many options for how this extension works via
334337
```python
335338
app.config[OPTION_NAME] = new_options
336339
```
337340
The available options are:
338-
* JWT_ACCESS_TOKEN_EXPIRES: datetime.timedelta of how long an access token should
339-
live before it expires (Defaults to 15 minutes)
340-
* JWT_REFRESH_TOKEN_EXPIRES: datetime.timedelta of how long a refresh token should
341-
live before it expires (Defaults to 30 days)
342-
* JWT_ALGORITHM: Which algorithm to use with the JWT. See [here] (https://pyjwt.readthedocs.io/en/latest/algorithms.html)
343-
for options (Defaults to HS256)
344-
* JWT_BLACKLIST_ENABLED: If token blacklist/revoking should be enabled (Default False)
345-
* JWT_BLACKLIST_STORE: Where to save blacklisted tokens. See [here] (http://pythonhosted.org/simplekv/)
346-
for options (Default None)
347-
* JWT_BLACKLIST_CHECKS: What tokens to check against the blacklist. Options are 'refresh' which
348-
will only check refresh tokens, and 'all' which will check refresh and access tokens. Defaults
349-
to 'refresh'
341+
342+
| Name | Description | Options | Default|
343+
| ------ | ----------- | ------- | ------ |
344+
|JWT_ACCESS_TOKEN_EXPIRES | How long an access token should live | datetime.timedelta | 15 minutes|
345+
|JWT_REFRESH_TOKEN_EXPIRES | How long a refresh token should live | datetime.timedelta | 30 days |
346+
|JWT_ALGORITHM | Which algorithm to use with the JWT. [See here] (https://pyjwt.readthedocs.io/en/latest/algorithms.html) | HS256 |
347+
|JWT_BLACKLIST_ENABLED | If token blacklist/revoking should be enabled | Boolean | False |
348+
|JWT_BLACKLIST_STORE | Where to save blacklisted tokens. [See here] (http://pythonhosted.org/simplekv/) | None |
349+
|JWT_BLACKLIST_CHECKS | What token types to check against the blacklist. | 'refresh', 'all' | 'refresh' |
350350

351351
### Blacklist and Token Revoking
352352
This supports optional blacklisting and token revoking out of the box. This will allow you

0 commit comments

Comments
 (0)