Skip to content

Commit 93108ac

Browse files
feat(ir): add OAuthAuthorizationCode.redirectUriBackupPorts for loopback port fallback (#17281)
Co-authored-by: rishabh.dhadda <rishabh.dhadda@postman.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent b6dad3b commit 93108ac

8 files changed

Lines changed: 44 additions & 1 deletion

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# yaml-language-server: $schema=../../../../../fern-changes-yml.schema.json
2+
3+
- summary: |
4+
Add the additive `OAuthAuthorizationCode.redirectUriBackupPorts` IR field (fallback loopback
5+
callback ports for the authorization-code/PKCE flow). No behavior change for existing configs.
6+
type: internal

packages/cli/generation/ir-generator-tests/src/dynamic-snippets/__test__/oauthPublicClientDynamic.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ describe("dynamic snippets for public-client OAuth flows", () => {
4848
tokenUrl: "https://auth.example.com/token",
4949
refreshUrl: undefined,
5050
redirectUri: undefined,
51+
redirectUriBackupPorts: undefined,
5152
scopes: undefined,
5253
pkce: { method: FernIr.auth.OAuthPkceMethod.S256 },
5354
authorizationParameters: undefined,

packages/cli/register/src/ir-to-fdr-converter/__test__/convertAuth.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const AUTHORIZATION_CODE_CONFIG = Ir.auth.OAuthConfiguration.authorizationCode({
2525
tokenUrl: "https://auth.example.com/token",
2626
refreshUrl: undefined,
2727
redirectUri: undefined,
28+
redirectUriBackupPorts: undefined,
2829
scopes: undefined,
2930
pkce: { method: Ir.auth.OAuthPkceMethod.S256 },
3031
authorizationParameters: undefined,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
67.17.0
1+
67.18.0

packages/ir-sdk/fern/apis/ir-types-latest/changelog/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [v67.18.0] - 2026-07-29
9+
10+
- Add `OAuthAuthorizationCode.redirectUriBackupPorts` (`optional<list<integer>>`): additional
11+
loopback callback ports for the authorization-code (PKCE) flow, tried in order when the
12+
`redirectUri` port is unavailable. Each reuses `redirectUri`'s host and path (only the port
13+
differs) and must be pre-registered with the authorization server. Lets a generated CLI bind a
14+
fixed-port fallback set (e.g. 8484 → 8483 → 8482) for identity providers that bind each client to
15+
specific callback ports. Ignored when `redirectUri` is unset.
16+
817
## [v67.17.0] - 2026-07-28
918

1019
- Add `OAuthConfiguration.authorizationCode` (`OAuthAuthorizationCode`), an additive union variant

packages/ir-sdk/fern/apis/ir-types-latest/definition/auth.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ types:
135135
When omitted, the CLI uses a loopback redirect on an ephemeral (OS-assigned) port with
136136
the path `/callback` (i.e. http://127.0.0.1:<random-port>/callback), per RFC 8252 §7.3.
137137
This requires the authorization server to allow arbitrary loopback ports for the client.
138+
139+
Backup ports for when this port is busy can be listed in `redirectUriBackupPorts`.
140+
redirectUriBackupPorts:
141+
type: optional<list<integer>>
142+
docs: |
143+
Additional loopback ports for the authorization-code (PKCE) callback, tried in order when
144+
the port in `redirectUri` is already in use. Each backup reuses the same host and path as
145+
`redirectUri` (i.e. only the port differs), and every resulting callback URI must be
146+
pre-registered with the authorization server. Ignored when `redirectUri` is unset (an
147+
ephemeral port is used instead). Enables a fixed-port fallback set (e.g. redirectUri on
148+
8484 with backups [8483, 8482]) for identity providers that bind each client to specific
149+
callback ports.
138150
scopes:
139151
type: optional<list<string>>
140152
docs: The scopes requested during authorization.

packages/ir-sdk/src/sdk/api/resources/auth/types/OAuthAuthorizationCode.ts

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ir-sdk/src/sdk/serialization/resources/auth/types/OAuthAuthorizationCode.ts

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)