Skip to content

Commit

Permalink
docs: updates for readability and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 17, 2024
1 parent 7fe3454 commit b1b8b7d
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 37 deletions.
4 changes: 2 additions & 2 deletions docs/interfaces/ClientCredentialsGrantRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/DeviceAuthorizationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/DiscoveryRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/HttpRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/IntrospectionRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

Expand All @@ -76,7 +76,7 @@ ___

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/ProtectedResourceRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ___

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/PushedAuthorizationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/RevocationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/TokenEndpointRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/UserInfoRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

### signal

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/ValidateJWTAccessTokenOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ___

`Optional` **headers**: [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string`\> \| [`string`, `string`][] \| [`Headers`]( https://developer.mozilla.org/docs/Web/API/Headers )

Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
Headers to additionally send with the HTTP request(s) triggered by this function's invocation.

___

Expand All @@ -59,7 +59,7 @@ ___

`Optional` **signal**: [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal ) \| () => [`AbortSignal`]( https://developer.mozilla.org/docs/Web/API/AbortSignal )

An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
this function's invocation.

**`Example`**
Expand Down
4 changes: 2 additions & 2 deletions docs/variables/customFetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

`Const` **customFetch**: unique `symbol`

When configured on an interface that extends [HttpRequestOptions](../interfaces/HttpRequestOptions.md), that's every `options`
parameter for functions that trigger HTTP Requests, this replaces the use of global fetch. As a
When configured on an interface that extends [HttpRequestOptions](../interfaces/HttpRequestOptions.md), this applies to `options`
parameter for functions that trigger HTTP requests, this replaces the use of global fetch. As a
fetch replacement the arguments and expected return are the same as fetch.

In theory any module that claims to be compatible with the Fetch API can be used but your mileage
Expand Down
9 changes: 5 additions & 4 deletions docs/variables/skipStateCheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

`Const` **skipStateCheck**: unique `symbol`

DANGER ZONE
DANGER ZONE - This option has security implications that must be understood, assessed for
applicability, and accepted before use.

Use this as a value to [validateAuthResponse](../functions/validateAuthResponse.md) `expectedState` parameter to skip the `state`
value check. This should only ever be done if you use a `state` parameter value that is integrity
protected and bound to the browsing session. One such mechanism to do so is described in an I-D
value check when you'll be validating such `state` value yourself instead. This should only be
done if you use a `state` parameter value that is integrity protected and bound to the browsing
session. One such mechanism to do so is described in an I-D
[draft-bradley-oauth-jwt-encoded-state-09](https://datatracker.ietf.org/doc/html/draft-bradley-oauth-jwt-encoded-state-09).
It is expected you'll validate such `state` value yourself.
3 changes: 2 additions & 1 deletion docs/variables/skipSubjectCheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

`Const` **skipSubjectCheck**: unique `symbol`

DANGER ZONE
DANGER ZONE - This option has security implications that must be understood, assessed for
applicability, and accepted before use.

Use this as a value to [processUserInfoResponse](../functions/processUserInfoResponse.md) `expectedSubject` parameter to skip the
`sub` claim value check.
Expand Down
20 changes: 11 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ export const clockSkew: unique symbol = Symbol()
export const clockTolerance: unique symbol = Symbol()

/**
* When configured on an interface that extends {@link HttpRequestOptions}, that's every `options`
* parameter for functions that trigger HTTP Requests, this replaces the use of global fetch. As a
* When configured on an interface that extends {@link HttpRequestOptions}, this applies to `options`
* parameter for functions that trigger HTTP requests, this replaces the use of global fetch. As a
* fetch replacement the arguments and expected return are the same as fetch.
*
* In theory any module that claims to be compatible with the Fetch API can be used but your mileage
Expand Down Expand Up @@ -953,7 +953,7 @@ const SUPPORTED_JWS_ALGS: JWSAlgorithm[] = [

export interface HttpRequestOptions {
/**
* An AbortSignal instance, or a factory returning one, to abort the HTTP Request(s) triggered by
* An AbortSignal instance, or a factory returning one, to abort the HTTP request(s) triggered by
* this function's invocation.
*
* @example
Expand All @@ -967,7 +967,7 @@ export interface HttpRequestOptions {
signal?: (() => AbortSignal) | AbortSignal

/**
* Headers to additionally send with the HTTP Request(s) triggered by this function's invocation.
* Headers to additionally send with the HTTP request(s) triggered by this function's invocation.
*/
headers?: [string, string][] | Record<string, string> | Headers

Expand Down Expand Up @@ -2282,7 +2282,8 @@ async function getPublicSigKeyFromIssuerJwksUri(
}

/**
* DANGER ZONE
* DANGER ZONE - This option has security implications that must be understood, assessed for
* applicability, and accepted before use.
*
* Use this as a value to {@link processUserInfoResponse} `expectedSubject` parameter to skip the
* `sub` claim value check.
Expand Down Expand Up @@ -3897,13 +3898,14 @@ function getURLSearchParameter(parameters: URLSearchParams, name: string): strin
}

/**
* DANGER ZONE
* DANGER ZONE - This option has security implications that must be understood, assessed for
* applicability, and accepted before use.
*
* Use this as a value to {@link validateAuthResponse} `expectedState` parameter to skip the `state`
* value check. This should only ever be done if you use a `state` parameter value that is integrity
* protected and bound to the browsing session. One such mechanism to do so is described in an I-D
* value check when you'll be validating such `state` value yourself instead. This should only be
* done if you use a `state` parameter value that is integrity protected and bound to the browsing
* session. One such mechanism to do so is described in an I-D
* [draft-bradley-oauth-jwt-encoded-state-09](https://datatracker.ietf.org/doc/html/draft-bradley-oauth-jwt-encoded-state-09).
* It is expected you'll validate such `state` value yourself.
*/
export const skipStateCheck: unique symbol = Symbol()

Expand Down

0 comments on commit b1b8b7d

Please sign in to comment.