changed timeout type
Signed-off-by: Ruslan Nasyrov <ruslan.nasyrov.f@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { HumanDuration } from '@backstage/types';
|
||||
|
||||
import { HumanDuration } from '@backstage/types';
|
||||
|
||||
@@ -33,6 +34,7 @@ export interface Config {
|
||||
tokenSignedResponseAlg?: string;
|
||||
additionalScopes?: string | string[];
|
||||
prompt?: string;
|
||||
timeout?: HumanDuration;
|
||||
signIn?: {
|
||||
resolvers: Array<
|
||||
| {
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"@backstage/backend-plugin-api": "workspace:^",
|
||||
"@backstage/plugin-auth-backend": "workspace:^",
|
||||
"@backstage/plugin-auth-node": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"express": "^4.18.2",
|
||||
"openid-client": "^5.5.0",
|
||||
"passport": "^0.7.0"
|
||||
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
PassportOAuthAuthenticatorHelper,
|
||||
PassportOAuthPrivateInfo,
|
||||
} from '@backstage/plugin-auth-node';
|
||||
import { durationToMilliseconds, HumanDuration } from '@backstage/types';
|
||||
|
||||
const HTTP_OPTION_TIMEOUT = 10000;
|
||||
const createHttpOptionsProvider =
|
||||
@@ -86,8 +87,15 @@ export const oidcAuthenticator = createOAuthAuthenticator({
|
||||
'The oidc provider no longer supports the "scope" configuration option. Please use the "additionalScopes" option instead.',
|
||||
);
|
||||
}
|
||||
|
||||
const timeoutHumanDuration = config.getOptional<HumanDuration>('timeout');
|
||||
const timeoutMilliseconds =
|
||||
typeof timeoutHumanDuration === 'object'
|
||||
? durationToMilliseconds(timeoutHumanDuration)
|
||||
: undefined;
|
||||
|
||||
const httpOptionsProvider = createHttpOptionsProvider({
|
||||
timeout: config.getOptionalNumber('timeout'),
|
||||
timeout: timeoutMilliseconds,
|
||||
});
|
||||
|
||||
Issuer[custom.http_options] = httpOptionsProvider;
|
||||
|
||||
Reference in New Issue
Block a user