Skip to content

Commit

Permalink
refactor: deprecate the useMtlsAlias symbol and options
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Sep 22, 2024
1 parent 60c9df4 commit d2b7cb0
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 224 deletions.
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ Support from the community to continue maintaining and improving this module is
- [RevocationRequestOptions](interfaces/RevocationRequestOptions.md)
- [TokenEndpointRequestOptions](interfaces/TokenEndpointRequestOptions.md)
- [TokenEndpointResponse](interfaces/TokenEndpointResponse.md)
- [UseMTLSAliasOptions](interfaces/UseMTLSAliasOptions.md)
- [UserInfoAddress](interfaces/UserInfoAddress.md)
- [UserInfoRequestOptions](interfaces/UserInfoRequestOptions.md)
- [UserInfoResponse](interfaces/UserInfoResponse.md)
Expand Down Expand Up @@ -222,4 +221,3 @@ Support from the community to continue maintaining and improving this module is
- [skipAuthTimeCheck](variables/skipAuthTimeCheck.md)
- [skipStateCheck](variables/skipStateCheck.md)
- [skipSubjectCheck](variables/skipSubjectCheck.md)
- [useMtlsAlias](variables/useMtlsAlias.md)
8 changes: 0 additions & 8 deletions docs/interfaces/AuthenticatedRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ Support from the community to continue maintaining and improving this module is

## Properties

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### clientPrivateKey?

`optional` **clientPrivateKey**: [`CryptoKey`](https://developer.mozilla.org/docs/Web/API/CryptoKey) \| [`PrivateKey`](PrivateKey.md)
Expand Down
53 changes: 53 additions & 0 deletions docs/interfaces/Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,59 @@ requests. Default is `client_secret_basic`.
Indicates the requirement for a client to use mutual TLS endpoint aliases defined by the AS
where present. Default is `false`.

When combined with [customFetch](../variables/customFetch.md) (to use a Fetch API implementation that supports client
certificates) this can be used to target FAPI 2.0 profiles that utilize Mutual-TLS for either
client authentication or sender constraining. FAPI 1.0 Advanced profiles that use PAR and JARM
can also be targetted.

#### Examples

(Node.js) Using [nodejs/undici](https://github.com/nodejs/undici) for Mutual-TLS Client
Authentication and Certificate-Bound Access Tokens support.

```ts
import * as undici from 'undici'
import * as oauth from 'oauth4webapi'

// Prerequisites
let as!: oauth.AuthorizationServer
let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
let params!: URLSearchParams
let key!: string // PEM-encoded key
let cert!: string // PEM-encoded certificate

const agent = new undici.Agent({ connect: { key, cert } })

const response = await oauth.pushedAuthorizationRequest(as, client, params, {
[oauth.customFetch]: (...args) =>
undici.fetch(args[0], { ...args[1], dispatcher: agent }),
})
```

(Deno) Using Deno.createHttpClient API for Mutual-TLS Client Authentication and
Certificate-Bound Access Tokens support.

```ts
import * as oauth from 'oauth4webapi'

// Prerequisites
let as!: oauth.AuthorizationServer
let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
let params!: URLSearchParams
let key!: string // PEM-encoded key
let cert!: string // PEM-encoded certificate

const agent = Deno.createHttpClient({ key, cert })

const response = await oauth.pushedAuthorizationRequest(as, client, params, {
[oauth.customFetch]: (...args) => fetch(args[0], { ...args[1], client: agent }),
})
```

#### See

[RFC 8705 - OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)

***

### userinfo\_signed\_response\_alg?
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/ClientCredentialsGrantRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### clientPrivateKey?

`optional` **clientPrivateKey**: [`CryptoKey`](https://developer.mozilla.org/docs/Web/API/CryptoKey) \| [`PrivateKey`](PrivateKey.md)
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/DeviceAuthorizationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### clientPrivateKey?

`optional` **clientPrivateKey**: [`CryptoKey`](https://developer.mozilla.org/docs/Web/API/CryptoKey) \| [`PrivateKey`](PrivateKey.md)
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/IntrospectionRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### additionalParameters?

`optional` **additionalParameters**: [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\> \| [`URLSearchParams`](https://developer.mozilla.org/docs/Web/API/URLSearchParams) \| `string`[][]
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/PushedAuthorizationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### clientPrivateKey?

`optional` **clientPrivateKey**: [`CryptoKey`](https://developer.mozilla.org/docs/Web/API/CryptoKey) \| [`PrivateKey`](PrivateKey.md)
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/RevocationRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### additionalParameters?

`optional` **additionalParameters**: [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\> \| [`URLSearchParams`](https://developer.mozilla.org/docs/Web/API/URLSearchParams) \| `string`[][]
Expand Down
8 changes: 0 additions & 8 deletions docs/interfaces/TokenEndpointRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### additionalParameters?

`optional` **additionalParameters**: [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type)\<`string`, `string`\> \| [`URLSearchParams`](https://developer.mozilla.org/docs/Web/API/URLSearchParams) \| `string`[][]
Expand Down
15 changes: 0 additions & 15 deletions docs/interfaces/UseMTLSAliasOptions.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/interfaces/UserInfoRequestOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ See [customFetch](../variables/customFetch.md).

***

### \[useMtlsAlias\]?

`optional` **\[useMtlsAlias\]**: `boolean`

See [useMtlsAlias](../variables/useMtlsAlias.md).

***

### DPoP?

`optional` **DPoP**: [`DPoPOptions`](DPoPOptions.md)
Expand Down
70 changes: 0 additions & 70 deletions docs/variables/useMtlsAlias.md

This file was deleted.

Loading

0 comments on commit d2b7cb0

Please sign in to comment.