From 1889adff93d66beb0fb543915c92bad5e8903bbf Mon Sep 17 00:00:00 2001 From: Andreas Weber Date: Sat, 11 Jan 2025 20:59:24 +0100 Subject: [PATCH] fix: allow proxy for oauth2 using `oauth2_proxy` (#841) --- CHANGELOG.md | 5 +++++ package-lock.json | 4 ++-- package.json | 2 +- src/models/openIdInformation.ts | 1 + src/plugins/oauth2/flow/requestOpenIdInformation.ts | 1 + src/plugins/oauth2/openIdConfiguration.ts | 1 + 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 991bb54c..b9a479b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## [6.16.6] (2025-01-11) + +### Fix +- allow proxy for oauth2 using `oauth2_proxy` (#841) + ## [6.16.5] (2025-01-06) ### Features diff --git a/package-lock.json b/package-lock.json index cecac0f6..acfff59a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "httpyac", - "version": "6.16.5", + "version": "6.16.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "httpyac", - "version": "6.16.5", + "version": "6.16.6", "license": "MIT", "dependencies": { "@cloudamqp/amqp-client": "^2.1.1", diff --git a/package.json b/package.json index 2d7cd68f..c9e42f4a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "MIT", "publisher": "AnWeber", "description": "HTTP/REST CLI Client for *.http files", - "version": "6.16.5", + "version": "6.16.6", "homepage": "https://github.com/AnWeber/httpyac", "repository": { "type": "git", diff --git a/src/models/openIdInformation.ts b/src/models/openIdInformation.ts index 5c784fdd..77fefe25 100644 --- a/src/models/openIdInformation.ts +++ b/src/models/openIdInformation.ts @@ -19,6 +19,7 @@ export interface OpenIdConfiguration { keepAlive?: boolean; username?: string | null; password?: string | null; + proxy?: string | null; subjectIssuer?: string | null; useAuthorizationHeader?: boolean; useDeviceCodeClientSecret?: boolean; diff --git a/src/plugins/oauth2/flow/requestOpenIdInformation.ts b/src/plugins/oauth2/flow/requestOpenIdInformation.ts index d691c617..e34ed8e7 100644 --- a/src/plugins/oauth2/flow/requestOpenIdInformation.ts +++ b/src/plugins/oauth2/flow/requestOpenIdInformation.ts @@ -63,6 +63,7 @@ export async function addConfigRequestOptions( context: models.OpenIdContext ) { if (utils.isProcessorContext(context)) { + request.proxy = config.proxy || undefined; if (context.config?.request?.rejectUnauthorized !== undefined) { request.noRejectUnauthorized = !utils.toBoolean(context.config?.request?.rejectUnauthorized); } diff --git a/src/plugins/oauth2/openIdConfiguration.ts b/src/plugins/oauth2/openIdConfiguration.ts index 01afb6e3..176f09f2 100644 --- a/src/plugins/oauth2/openIdConfiguration.ts +++ b/src/plugins/oauth2/openIdConfiguration.ts @@ -95,6 +95,7 @@ export function getOpenIdConfiguration( resource: getArrayOrString('resource'), username: getString('username'), password: getString('password'), + proxy: getString('proxy'), subjectIssuer: getString('subjectIssuer') || undefined, redirectUri: getUrl('redirectUri', DEFAULT_CALLBACK_URI), keepAlive: getBoolean('keepAlive', true),