rebase and fix bitbucket server
Signed-off-by: headphonejames <generalfuzz@gmail.com>
This commit is contained in:
@@ -233,9 +233,11 @@ export const apis = [
|
||||
deps: {
|
||||
discoveryApi: discoveryApiRef,
|
||||
oauthRequestApi: oauthRequestApiRef,
|
||||
configApi: configApiRef,
|
||||
},
|
||||
factory: ({ discoveryApi, oauthRequestApi }) =>
|
||||
factory: ({ discoveryApi, oauthRequestApi, configApi }) =>
|
||||
BitbucketServerAuth.create({
|
||||
configApi,
|
||||
discoveryApi,
|
||||
oauthRequestApi,
|
||||
defaultScopes: ['REPO_READ'],
|
||||
|
||||
+7
@@ -17,6 +17,8 @@
|
||||
import MockOAuthApi from '../../OAuthRequestApi/MockOAuthApi';
|
||||
import { UrlPatternDiscovery } from '../../DiscoveryApi';
|
||||
import BitbucketServerAuth from './BitbucketServerAuth';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { ConfigApi } from '@backstage/core-plugin-api';
|
||||
|
||||
const getSession = jest.fn();
|
||||
|
||||
@@ -40,7 +42,12 @@ describe('BitbucketServerAuth', () => {
|
||||
['PROJECT_ADMIN', 'REPO_READ', 'ACCOUNT_WRITE'],
|
||||
],
|
||||
])(`should normalize scopes correctly - %p`, (scope, scopes) => {
|
||||
const configApi: ConfigApi = new ConfigReader({
|
||||
enableExperimentalRedirectFlow: false,
|
||||
});
|
||||
|
||||
const bitbucketServerAuth = BitbucketServerAuth.create({
|
||||
configApi: configApi,
|
||||
oauthRequestApi: new MockOAuthApi(),
|
||||
discoveryApi: UrlPatternDiscovery.compile('http://example.com'),
|
||||
});
|
||||
|
||||
+2
@@ -48,6 +48,7 @@ export default class BitbucketServerAuth {
|
||||
options: OAuthApiCreateOptions,
|
||||
): typeof bitbucketServerAuthApiRef.T {
|
||||
const {
|
||||
configApi,
|
||||
discoveryApi,
|
||||
environment = 'development',
|
||||
provider = DEFAULT_PROVIDER,
|
||||
@@ -56,6 +57,7 @@ export default class BitbucketServerAuth {
|
||||
} = options;
|
||||
|
||||
return OAuth2.create({
|
||||
configApi,
|
||||
discoveryApi,
|
||||
oauthRequestApi,
|
||||
provider,
|
||||
|
||||
Reference in New Issue
Block a user