Skip to content

Commit f02bb5d

Browse files
authored
Update README.md
1 parent be3fe27 commit f02bb5d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ There are two ways in config JWTModule
7777
```
7878
- **register**:
7979

80-
`JWTModule.register` allow you to provide JWT configuration in Ellar application config object using `JWT_CONFIG` key.
80+
`JWTModule.register` lets you provide JWT configuration in the Ellar application config object using the `JWT_CONFIG` key.
8181
The register function will create a `ModuleSetup` object that will inject application `config` to a JWT config factory
8282

8383
for example:
@@ -101,7 +101,7 @@ There are two ways in config JWTModule
101101
'jti': "jti",
102102
'lifetime': timedelta(minutes=5), # token lifetime, this will example in 5 mins
103103

104-
'json_encoder':json.JSONEncoder # token lifetime, this will example
104+
'json_encoder':json.JSONEncoder # token lifetime, this will be an example
105105
}
106106
```
107107
In `auth/module.py`
@@ -138,7 +138,7 @@ JWT_CONFIG = {
138138
'jti': "jti",
139139
'lifetime': timedelta(minutes=5), # token lifetime, this will example in 5 mins
140140

141-
'json_encoder':json.JSONEncoder # token lifetime, this will example
141+
'json_encoder':json.JSONEncoder # token lifetime, this will be an example
142142
}
143143
```
144144

@@ -156,9 +156,9 @@ In this scenario, selecting an RSA algorithm mandates configuring the `signing_s
156156
- ### `signing_secret_key`
157157
The signing key utilized for signing the content of generated tokens has distinct requirements based on the signing protocol.
158158
For HMAC signing, it should be a randomly generated string containing at least as many bits as dictated by the signing protocol.
159-
Conversely, for RSA signing, it should be a string encompassing an RSA private key with a length of 2048 bits or more.
160-
As Simple JWT defaults to 256-bit HMAC signing, the `signing_secret_key` setting automatically takes on the value of your django project's `SECRET_KEY`.
161-
While this default is practical, it's advisable for developers to modify this setting to a value separate from the django project's secret key.
159+
Conversely, an RSA signing should be a string encompassing an RSA private key with a length of 2048 bits or more.
160+
As Simple JWT defaults to 256-bit HMAC signing, the `signing_secret_key` setting automatically takes on the value of your Django project's `SECRET_KEY`.
161+
While this default is practical, developers should modify this setting to a value separate from the Django project's secret key.
162162
This adjustment facilitates easier token signing key changes if the key is ever compromised.
163163

164164
- ### `verifying_secret_key`
@@ -184,7 +184,7 @@ Leeway provides a buffer for the expiration time, which can be defined as an int
184184
For further details, please consult the following link: https://pyjwt.readthedocs.io/en/latest/usage.html#expiration-time-claim-exp
185185

186186
- ### `jti`
187-
The claim designated for storing a token's unique identifier, which is utilized to distinguish revoked tokens within the blacklist application.
187+
The claim is designated for storing a token's unique identifier, which is utilized to distinguish revoked tokens within the blacklist application.
188188
There might be instances where an alternative claim other than the default "jti" claim needs to be employed for storing this value
189189

190190
- ### `json_encoder`
@@ -197,13 +197,13 @@ JSON Encoder class that will be used by the `PYJWT` to encode the `jwt_payload`.
197197
The `JwtService` uses [PYJWT](https://pypi.org/project/PyJWT/) underneath.
198198

199199
### _jwt_service.sign(payload: dict, headers: Dict[str, t.Any] = None, **jwt_config: t.Any) -> str_
200-
Creates a jwt token for the provided payload. Also, you can override default jwt config by using passing some keyword argument as a `jwt_config`
200+
Creates a jwt token for the provided payload. Also, you can override the default jwt config by using passing some keyword argument as a `jwt_config`
201201

202202
### _jwt_service.sign_async(payload: dict, headers: Dict[str, t.Any] = None, **jwt_config: t.Any) -> str_
203203
Async action for `jwt_service.sign`
204204

205205
### _jwt_service.decode(token: str, verify: bool = True, **jwt_config: t.Any) -> t.Dict[str, t.Any]:_
206-
Verifies and decodes provided token. And raises JWTException exception if token is invalid or expired
206+
Verifies and decodes provided token. And raises a JWTException exception if the token is invalid or expired
207207

208208
### _jwt_service.decode_async(token: str, verify: bool = True, **jwt_config: t.Any) -> t.Dict[str, t.Any]:_
209209
Async action for `jwt_service.decode`

0 commit comments

Comments
 (0)