Skip to content

Commit 81d7099

Browse files
mortenpinkottarytanmaykm
authored
Apply suggestions from code review
Co-authored-by: Nishanth H. Kottary <[email protected]> Co-authored-by: Tanmay Mohapatra <[email protected]>
1 parent 8ba647c commit 81d7099

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/auth-flows.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Pkg uses the following top-level key values pairs:
2121
- `access_token` (REQUIRED): the bearer token used to authorize normal requests (string)
2222
- `expires_at` (OPTIONAL): an absolute expiration time (seconds from UNIX epoch; integer)
2323
- `expires_in` (OPTIONAL): a relative expiration time (seconds; integer)
24-
- `refresh_url` (OPTIONAL): URL to fetch new a new token from (string)
24+
- `refresh_url` (OPTIONAL): URL to fetch a new token from (string)
2525
- `refresh_token` (OPTIONAL): bearer token used to authorize refresh requests (string)
2626

2727
The `auth.toml` file may contain other fields (e.g. a username, or user email), but they are ignored by Pkg.
@@ -50,7 +50,7 @@ When the Pkg client downloads a new `auth.toml` file, if there is a relative `ex
5050
This combination of policies allows expiration to work gracefully even in the presence of clock skew between the server and the client.
5151

5252
If the access token is expired and there are `refresh_token` and `refresh_url` fields in `auth.toml`, a new auth file is requested by making a request to `refresh_url` with an `Authorization: Bearer $refresh_token` header.
53-
Pkg will refuse to make unless `refresh_url` is an HTTPS URL.
53+
Pkg will refuse to make the refresh request unless `refresh_url` is an HTTPS URL.
5454

5555
Note that `refresh_url` need not be a URL on the Pkg server: token refresh can be handled by separate server.
5656
If the request is successful and the returned `auth.toml` file is a well-formed TOML file with _at least_ an `access_token` field, it is saved to server directory, replacing the existing `auth.toml` file.
@@ -91,11 +91,11 @@ The flow goes through the following steps:
9191

9292
The body of the request should be the challenge string (just plain bytes, not encoded as JSON or anything).
9393

94-
The server MUST responds with the status code `200` and a body containing the response URL fragment `response` (again, plain bytes, no encoding of any form).
94+
The server MUST respond with the status code `200` and a body containing the response URL fragment `response` (again, plain bytes, no encoding of any form).
9595

9696
3. Opening the response URL fragment in the user's browser.
9797

98-
At this point, the user should open the following URL browser (that is logged into the package server) and approve the authentication request:
98+
At this point, the user should open the following URL in a web browser (that is logged into the package server) and approve the authentication request:
9999

100100
```
101101
$(pkg_server)/$(auth_suffix)/response?$(response)
@@ -107,7 +107,7 @@ The flow goes through the following steps:
107107

108108
4. Polling the package server's token claiming endpoint.
109109

110-
While waiting for the user the approve the authentication request in step (3), PkgAuthentication will poll the package server's token claiming endpoint.
110+
While waiting for the user to approve the authentication request in step (3), PkgAuthentication will poll the package server's token claiming endpoint.
111111
The polling is done by sending a POST request
112112

113113
```
@@ -139,4 +139,4 @@ The flow goes through the following steps:
139139
5. Constructing the `auth.toml` file.
140140

141141
If PkgAuthentication successfully acquires a token from polling the `/claimtoken` endpoint, it will write the token to the `auth.toml` file.
142-
If will write out all the keys and values of the `token` in the `auth.toml` file as TOML.
142+
It will write out all the keys and values of the `token` in the `auth.toml` file as TOML.

0 commit comments

Comments
 (0)