Skip to content

Commit 0a2fc78

Browse files
Mausetiangolo
andauthored
✏️ Update docs to remove gender-specific references (#1824)
Co-authored-by: Sebastián Ramírez <[email protected]>
1 parent b91acfb commit 0a2fc78

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

docs/en/docs/advanced/security/http-basic-auth.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ But by using the `secrets.compare_digest()` it will be secure against a type of
5454

5555
But what's a "timing attack"?
5656

57-
Let's imagine an attacker is trying to guess the username and password.
57+
Let's imagine some attackers are trying to guess the username and password.
5858

59-
And that attacker sends a request with a username `johndoe` and a password `love123`.
59+
And they send a request with a username `johndoe` and a password `love123`.
6060

6161
Then the Python code in your application would be equivalent to something like:
6262

@@ -67,7 +67,7 @@ if "johndoe" == "stanleyjobson" and "love123" == "swordfish":
6767

6868
But right at the moment Python compares the first `j` in `johndoe` to the first `s` in `stanleyjobson`, it will return `False`, because it already knows that those two strings are not the same, thinking that "there's no need to waste more computation comparing the rest of the letters". And your application will say "incorrect user or password".
6969

70-
But then the attacker tries with username `stanleyjobsox` and password `love123`.
70+
But then the attackers try with username `stanleyjobsox` and password `love123`.
7171

7272
And your application code does something like:
7373

@@ -78,17 +78,17 @@ if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
7878

7979
Python will have to compare the whole `stanleyjobso` in both `stanleyjobsox` and `stanleyjobson` before realizing that both strings are not the same. So it will take some extra microseconds to reply back "incorrect user or password".
8080

81-
#### The time to answer helps the attacker
81+
#### The time to answer helps the attackers
8282

83-
At that point, by noticing that the server took some microseconds longer to send the "incorrect user or password" response, the attacker will know that she/he got _something_ right, some of the initial letters were right.
83+
At that point, by noticing that the server took some microseconds longer to send the "incorrect user or password" response, the attackers will know that they got _something_ right, some of the initial letters were right.
8484

85-
And then she/he can try again knowing that it's probably something more similar to `stanleyjobsox` than to `johndoe`.
85+
And then they can try again knowing that it's probably something more similar to `stanleyjobsox` than to `johndoe`.
8686

8787
#### A "professional" attack
8888

89-
Of course, the attacker would not try all this by hand, she/he would write a program to do it, possibly with thousands or millions of tests per second. And would get just one extra correct letter at a time.
89+
Of course, the attackers would not try all this by hand, they would write a program to do it, possibly with thousands or millions of tests per second. And would get just one extra correct letter at a time.
9090

91-
But doing that, in some minutes or hours the attacker would have guessed the correct username and password, with the "help" of our application, just using the time taken to answer.
91+
But doing that, in some minutes or hours the attackers would have guessed the correct username and password, with the "help" of our application, just using the time taken to answer.
9292

9393
#### Fix it with `secrets.compare_digest()`
9494

docs/en/docs/tutorial/background-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
You can define background tasks to be run *after* returning a response.
44

5-
This is useful for operations that need to happen after a request, but that the client doesn't really have to be waiting for the operation to complete before receiving his response.
5+
This is useful for operations that need to happen after a request, but that the client doesn't really have to be waiting for the operation to complete before receiving the response.
66

77
This includes, for example:
88

docs/en/docs/tutorial/handling-errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ In this example, when the client request an item by an ID that doesn't exist, ra
4747

4848
### The resulting response
4949

50-
If the client requests `http://example.com/items/foo` (an `item_id` `"foo"`), he will receive an HTTP status code of 200, and a JSON response of:
50+
If the client requests `http://example.com/items/foo` (an `item_id` `"foo"`), that client will receive an HTTP status code of 200, and a JSON response of:
5151

5252
```JSON
5353
{
5454
"item": "The Foo Wrestlers"
5555
}
5656
```
5757

58-
But if the client requests `http://example.com/items/bar` (a non-existent `item_id` `"bar"`), he will receive an HTTP status code of 404 (the "not found" error), and a JSON response of:
58+
But if the client requests `http://example.com/items/bar` (a non-existent `item_id` `"bar"`), that client will receive an HTTP status code of 404 (the "not found" error), and a JSON response of:
5959

6060
```JSON
6161
{

docs/en/docs/tutorial/security/first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ But in this case, the same **FastAPI** application will handle the API and the a
8585

8686
So, let's review it from that simplified point of view:
8787

88-
* The user types his `username` and `password` in the frontend, and hits `Enter`.
88+
* The user types the `username` and `password` in the frontend, and hits `Enter`.
8989
* The frontend (running in the user's browser) sends that `username` and `password` to a specific URL in our API (declared with `tokenUrl="token"`).
9090
* The API checks that `username` and `password`, and responds with a "token" (we haven't implemented any of this yet).
9191
* A "token" is just a string with some content that we can use later to verify this user.

docs/en/docs/tutorial/security/oauth2-jwt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It is not encrypted, so, anyone could recover the information from the contents.
2020

2121
But it's signed. So, when you receive a token that you emitted, you can verify that you actually emitted it.
2222

23-
That way, you can create a token with an expiration of, let's say, 1 week. And then when the user comes back the next day with the token, you know she/he is still logged in to your system.
23+
That way, you can create a token with an expiration of, let's say, 1 week. And then when the user comes back the next day with the token, you know that user is still logged in to your system.
2424

2525
After a week, the token will be expired and the user will not be authorized and will have to sign in again to get a new token. And if the user (or a third party) tried to modify the token to change the expiration, you would be able to discover it, because the signatures would not match.
2626

0 commit comments

Comments
 (0)