Move configuration of redirect authentication flow to a global parameter named "enableExperimentalRedirectFlow". Pass the configApi instance into authentication providers to read new configuration parameter.

Signed-off-by: headphonejames <generalfuzz@gmail.com>
This commit is contained in:
headphonejames
2023-02-27 16:34:30 -08:00
parent 3ae55c4a8d
commit 5acc047748
33 changed files with 143 additions and 87 deletions
@@ -18,6 +18,8 @@ import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils';
import React from 'react';
import { gitOpsApiRef, GitOpsRestApi } from '../../api';
import ProfileCatalog from './ProfileCatalog';
import { ConfigReader } from '@backstage/config';
import { ConfigApi } from '@backstage/core-plugin-api';
import {
ApiProvider,
@@ -31,6 +33,9 @@ import { githubAuthApiRef } from '@backstage/core-plugin-api';
describe('ProfileCatalog', () => {
it('should render', async () => {
const oauthRequestApi = new OAuthRequestManager();
const configApi: ConfigApi = new ConfigReader({
enableExperimentalRedirectFlow: false,
});
const apis = TestApiRegistry.from(
[gitOpsApiRef, new GitOpsRestApi('http://localhost:3008')],
[
@@ -40,6 +45,7 @@ describe('ProfileCatalog', () => {
'http://example.com/{{pluginId}}',
),
oauthRequestApi,
configApi: configApi,
}),
],
);