Skip to content

Commit

Permalink
docs: enhancing description leeway as time.Duration parse JWT (#5)
Browse files Browse the repository at this point in the history
* docs: enhancing description leeway as time.Duration parse JWT

* Update parse.md

---------

Co-authored-by: Christian Banse <[email protected]>
  • Loading branch information
guspan-tanadi and oxisto authored Jan 20, 2024
1 parent 5994abc commit be27e14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/usage/parse.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| `WithIssuer` | issuer as `string` | Configures the validator to require the specified issuer in the `"iss"`[^iss] claim. Validation will fail if a different issuer is specified in the token or the `"iss"` claim is missing. |
| `WithSubject` | subject as `string` | Configures the validator to require the specified subject in the `"sub"`[^sub] claim. Validation will fail if a different subject is specified in the token or the `"sub"` claim is missing. |
| `WithAudience` | audience as `string` | Configures the validator to require the specified audience in the `"aud"`[^aud] claim. Validation will fail if the audience is not listed in the token or the `"aud"` claim is missing. The contents of the audience string is application specific, but often contains the URI of the service that consumes the token. |
| `WithLeeway` | leeway as [`time.Duration`](https://pkg.go.dev/time#Duration) | According to the RFC, a certain time window (leeway) is allowed when verifying time based claims, such as expiration time. This is due to the fact that a there is not perfect clock synchronization on the a distributed system such as the internet. While we do not enforce any restriction on the amount of leeway, it should generally not exceed more than a few minutes.[^exp] |
| `WithLeeway` | leeway as [`time.Duration`](https://pkg.go.dev/time#Duration) | According to the RFC, a certain time window (leeway) is allowed when verifying time based claims, such as expiration time. This is due to the fact that there is no perfect clock synchronization on distributed systems such as the internet. While we do not enforce any restriction on the amount of leeway, it should generally not exceed more than a few minutes.[^exp] |
| `WithIssuedAt` | - | Enables a sanity check of the `"iat"`[^iat] claim. More specifically, when turning this option on, the validator will check if the issued-at time is not in the future. |
| Danger Zone |

Expand Down

0 comments on commit be27e14

Please sign in to comment.