diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json index 94f1b39672..444a0a273b 100644 --- a/packages/backend-common/package.json +++ b/packages/backend-common/package.json @@ -34,7 +34,6 @@ "@backstage/config-loader": "^0.8.0", "@backstage/errors": "^0.1.4", "@backstage/integration": "^0.6.9", - "@backstage/plugin-auth-backend": "^0.4.5", "@backstage/types": "^0.1.1", "@google-cloud/storage": "^5.8.0", "@lerna/project": "^4.0.0", diff --git a/packages/backend-common/src/identity/index.ts b/packages/backend-common/src/identity/index.ts deleted file mode 100644 index 67692e0ed5..0000000000 --- a/packages/backend-common/src/identity/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export { IdentityClient } from './IdentityClient'; diff --git a/packages/backend-common/src/index.ts b/packages/backend-common/src/index.ts index a3c53e6f9f..e430ddc1a4 100644 --- a/packages/backend-common/src/index.ts +++ b/packages/backend-common/src/index.ts @@ -25,7 +25,6 @@ export { loadBackendConfig } from './config'; export * from './database'; export * from './discovery'; export * from './hot'; -export * from './identity'; export * from './logging'; export * from './middleware'; export * from './paths'; diff --git a/packages/backend-common/src/identity/IdentityClient.test.ts b/plugins/auth-backend/src/identity/IdentityClient.test.ts similarity index 97% rename from packages/backend-common/src/identity/IdentityClient.test.ts rename to plugins/auth-backend/src/identity/IdentityClient.test.ts index 36d737174d..5eca6bf8cd 100644 --- a/packages/backend-common/src/identity/IdentityClient.test.ts +++ b/plugins/auth-backend/src/identity/IdentityClient.test.ts @@ -17,14 +17,14 @@ import { JWT, JSONWebKey } from 'jose'; import { rest } from 'msw'; import { setupServer } from 'msw/node'; -import { getVoidLogger } from '../logging'; -import { PluginEndpointDiscovery } from '../discovery'; -import { IdentityClient } from './IdentityClient'; import { - KeyStore, - MemoryKeyStore, - TokenFactory, -} from '@backstage/plugin-auth-backend'; + getVoidLogger, + PluginEndpointDiscovery, +} from '@backstage/backend-common'; +import { IdentityClient } from './IdentityClient'; +import { MemoryKeyStore } from './MemoryKeyStore'; +import { TokenFactory } from './TokenFactory'; +import { KeyStore } from './types'; const logger = getVoidLogger(); diff --git a/packages/backend-common/src/identity/IdentityClient.ts b/plugins/auth-backend/src/identity/IdentityClient.ts similarity index 97% rename from packages/backend-common/src/identity/IdentityClient.ts rename to plugins/auth-backend/src/identity/IdentityClient.ts index 2921b5705c..2af30e4b6a 100644 --- a/packages/backend-common/src/identity/IdentityClient.ts +++ b/plugins/auth-backend/src/identity/IdentityClient.ts @@ -16,8 +16,8 @@ import fetch from 'cross-fetch'; import { JWK, JWT, JWKS, JSONWebKey } from 'jose'; -import { BackstageIdentity } from '@backstage/plugin-auth-backend'; -import { PluginEndpointDiscovery } from '../discovery'; +import { BackstageIdentity } from '../providers'; +import { PluginEndpointDiscovery } from '@backstage/backend-common'; const CLOCK_MARGIN_S = 10; @@ -27,7 +27,6 @@ const CLOCK_MARGIN_S = 10; * * @experimental This is not a stable API yet */ - export class IdentityClient { private readonly discovery: PluginEndpointDiscovery; private readonly issuer: string; diff --git a/plugins/auth-backend/src/identity/index.ts b/plugins/auth-backend/src/identity/index.ts index cb2f369668..73858d7e07 100644 --- a/plugins/auth-backend/src/identity/index.ts +++ b/plugins/auth-backend/src/identity/index.ts @@ -15,6 +15,7 @@ */ export { createOidcRouter } from './router'; +export { IdentityClient } from './IdentityClient'; export { TokenFactory } from './TokenFactory'; export { DatabaseKeyStore } from './DatabaseKeyStore'; export { MemoryKeyStore } from './MemoryKeyStore'; diff --git a/plugins/auth-backend/src/index.ts b/plugins/auth-backend/src/index.ts index e348da116d..432da00142 100644 --- a/plugins/auth-backend/src/index.ts +++ b/plugins/auth-backend/src/index.ts @@ -21,8 +21,8 @@ */ export * from './service/router'; -export { MemoryKeyStore, TokenFactory } from './identity'; -export type { KeyStore, TokenIssuer } from './identity'; +export { IdentityClient } from './identity'; +export type { TokenIssuer } from './identity'; export * from './providers'; // flow package provides 2 functions