@red-hat-developer-hub/backstage-plugin-app-auth 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-app-auth
2
2
 
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b3f837f: Updated dependency `react-router-dom` to `^6.30.6`.
8
+
9
+ ## 1.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 277f374: **BREAKING**: Graduate NFS exports from `/alpha` to the main entry point.
14
+
15
+ - All public APIs previously available from `./alpha` are now exported from the
16
+ package root (`.`). Update imports:
17
+
18
+ ```diff
19
+ -import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth/alpha';
20
+ +import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth';
21
+
22
+ -import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations/alpha';
23
+ +import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations';
24
+
25
+ -import { appDrawerModule, AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
26
+ +import { appDrawerModule, AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react';
27
+
28
+ -import { appDefaultsModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults/alpha';
29
+ +import { appDefaultsModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
30
+ ```
31
+
32
+ - The `./alpha` subpath has been removed from `app-defaults` and `app-react`.
33
+ `app-auth` retains `./alpha` for translation exports (`signInTranslationRef`).
34
+ `app-integrations` retains `./alpha` with reduced exports (only
35
+ `mergeScmAuthFromDeps` and `ScmAuthFactoryDeps`; `appIntegrationsModule`
36
+ moved to the root entry).
37
+
38
+ - **`@red-hat-developer-hub/backstage-plugin-app-react`**: `ApplicationDrawer`
39
+ and `DrawerPanel` value exports have been removed from the main entry point.
40
+ They are now only available from the new `./legacy` subpath. If you import
41
+ these components directly, update your imports:
42
+
43
+ ```diff
44
+ -import { ApplicationDrawer, DrawerPanel } from '@red-hat-developer-hub/backstage-plugin-app-react';
45
+ +import { ApplicationDrawer, DrawerPanel } from '@red-hat-developer-hub/backstage-plugin-app-react/legacy';
46
+ ```
47
+
48
+ The `./legacy` subpath also re-exports `useAppDrawer` and associated types
49
+ for backward compatibility with OFS consumers.
50
+
51
+ - `@red-hat-developer-hub/backstage-plugin-app-react` adds a new
52
+ `./app-drawer-module` subpath that default-exports `appDrawerModule`
53
+ (`pluginId: 'app'`) for Scalprum / module-federation dynamic loading.
54
+
55
+ - All `pluginId: 'app'` modules are now re-exported as the default export from
56
+ their respective packages.
57
+
3
58
  ## 0.2.0
4
59
 
5
60
  ### Minor Changes
package/README.md CHANGED
@@ -5,7 +5,8 @@ RHDH sign-in page (multi-provider) and OIDC / Keycloak / PingFederate / Auth0 /
5
5
  ## Usage
6
6
 
7
7
  - **Dynamic loading**: default export is a `FrontendModule` suitable for `@backstage/frontend-dynamic-feature-loader`.
8
- - **Static / alpha**: import from `@red-hat-developer-hub/backstage-plugin-app-auth/alpha` for `appAuthModule`, `signInTranslationRef`, and auth API refs. The sign-in page UI is registered by the module via `SignInPageBlueprint` and lazy-loaded — it is not a public alpha export.
8
+ - **Static**: import from `@red-hat-developer-hub/backstage-plugin-app-auth` for `appAuthModule` and auth API refs. The sign-in page UI is registered by the module via `SignInPageBlueprint` and lazy-loaded — it is not a public export.
9
+ - **Translations (alpha)**: import from `@red-hat-developer-hub/backstage-plugin-app-auth/alpha` for `signInTranslationRef`.
9
10
 
10
11
  ## Config
11
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"AuthApiRefs.esm.js","sources":["../src/AuthApiRefs.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiRef,\n type ApiRef,\n type BackstageIdentityApi,\n type OAuthApi,\n type OpenIdConnectApi,\n type ProfileInfoApi,\n type SessionApi,\n} from '@backstage/core-plugin-api';\n\n/**\n * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.\n *\n * @alpha\n */\nexport type CustomAuthApiRefType = OAuthApi &\n OpenIdConnectApi &\n ProfileInfoApi &\n BackstageIdentityApi &\n SessionApi;\n\n/**\n * OIDC auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const oidcAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.oidc',\n});\n\n/**\n * Keycloak auth API for the RHDH multi-provider sign-in page (OIDC-backed).\n *\n * @alpha\n */\nexport const keycloakAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.keycloak',\n});\n\n/**\n * PingFederate auth API for the RHDH multi-provider sign-in page (OIDC-backed).\n *\n * @alpha\n */\nexport const pingfederateAuthApiRef: ApiRef<CustomAuthApiRefType> =\n createApiRef({\n id: 'internal.auth.pingfederate',\n });\n\n/**\n * Auth0 auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const auth0AuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.auth0',\n});\n\n/**\n * SAML auth API for the RHDH multi-provider sign-in page.\n *\n * @alpha\n */\nexport const samlAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.saml',\n});\n"],"names":[],"mappings":";;AA0CO,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,qBAAmD,YAAA,CAAa;AAAA,EAC3E,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,yBACX,YAAA,CAAa;AAAA,EACX,EAAA,EAAI;AACN,CAAC;AAOI,MAAM,kBAAgD,YAAA,CAAa;AAAA,EACxE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"AuthApiRefs.esm.js","sources":["../src/AuthApiRefs.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createApiRef,\n type ApiRef,\n type BackstageIdentityApi,\n type OAuthApi,\n type OpenIdConnectApi,\n type ProfileInfoApi,\n type SessionApi,\n} from '@backstage/core-plugin-api';\n\n/**\n * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.\n *\n * @public\n */\nexport type CustomAuthApiRefType = OAuthApi &\n OpenIdConnectApi &\n ProfileInfoApi &\n BackstageIdentityApi &\n SessionApi;\n\n/**\n * OIDC auth API for the RHDH multi-provider sign-in page.\n *\n * @public\n */\nexport const oidcAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.oidc',\n});\n\n/**\n * Keycloak auth API for the RHDH multi-provider sign-in page (OIDC-backed).\n *\n * @public\n */\nexport const keycloakAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.keycloak',\n});\n\n/**\n * PingFederate auth API for the RHDH multi-provider sign-in page (OIDC-backed).\n *\n * @public\n */\nexport const pingfederateAuthApiRef: ApiRef<CustomAuthApiRefType> =\n createApiRef({\n id: 'internal.auth.pingfederate',\n });\n\n/**\n * Auth0 auth API for the RHDH multi-provider sign-in page.\n *\n * @public\n */\nexport const auth0AuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.auth0',\n});\n\n/**\n * SAML auth API for the RHDH multi-provider sign-in page.\n *\n * @public\n */\nexport const samlAuthApiRef: ApiRef<CustomAuthApiRefType> = createApiRef({\n id: 'internal.auth.saml',\n});\n"],"names":[],"mappings":";;AA0CO,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,qBAAmD,YAAA,CAAa;AAAA,EAC3E,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,yBACX,YAAA,CAAa;AAAA,EACX,EAAA,EAAI;AACN,CAAC;AAOI,MAAM,kBAAgD,YAAA,CAAa;AAAA,EACxE,EAAA,EAAI;AACN,CAAC;AAOM,MAAM,iBAA+C,YAAA,CAAa;AAAA,EACvE,EAAA,EAAI;AACN,CAAC;;;;"}
package/dist/alpha.d.ts CHANGED
@@ -1,50 +1,4 @@
1
1
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
- import { OAuthApi, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, SessionApi, ApiRef } from '@backstage/core-plugin-api';
3
-
4
- /**
5
- * RHDH app sign-in page plus OIDC, Keycloak, PingFederate, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).
6
- * Default-export this module for dynamic frontend loading.
7
- *
8
- * @alpha
9
- */
10
- declare const appAuthModule: _backstage_frontend_plugin_api.FrontendModule;
11
-
12
- /**
13
- * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.
14
- *
15
- * @alpha
16
- */
17
- type CustomAuthApiRefType = OAuthApi & OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
18
- /**
19
- * OIDC auth API for the RHDH multi-provider sign-in page.
20
- *
21
- * @alpha
22
- */
23
- declare const oidcAuthApiRef: ApiRef<CustomAuthApiRefType>;
24
- /**
25
- * Keycloak auth API for the RHDH multi-provider sign-in page (OIDC-backed).
26
- *
27
- * @alpha
28
- */
29
- declare const keycloakAuthApiRef: ApiRef<CustomAuthApiRefType>;
30
- /**
31
- * PingFederate auth API for the RHDH multi-provider sign-in page (OIDC-backed).
32
- *
33
- * @alpha
34
- */
35
- declare const pingfederateAuthApiRef: ApiRef<CustomAuthApiRefType>;
36
- /**
37
- * Auth0 auth API for the RHDH multi-provider sign-in page.
38
- *
39
- * @alpha
40
- */
41
- declare const auth0AuthApiRef: ApiRef<CustomAuthApiRefType>;
42
- /**
43
- * SAML auth API for the RHDH multi-provider sign-in page.
44
- *
45
- * @alpha
46
- */
47
- declare const samlAuthApiRef: ApiRef<CustomAuthApiRefType>;
48
2
 
49
3
  /**
50
4
  * Sign-in page messages (English). Same key shape as legacy RHDH app signIn for compatibility.
@@ -86,5 +40,4 @@ declare const signInTranslationRef: _backstage_frontend_plugin_api.TranslationRe
86
40
  readonly "signIn.providers.saml.message": "Sign in using SAML";
87
41
  }>;
88
42
 
89
- export { appAuthModule, auth0AuthApiRef, appAuthModule as default, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef, signInTranslationRef };
90
- export type { CustomAuthApiRefType };
43
+ export { signInTranslationRef };
package/dist/alpha.esm.js CHANGED
@@ -1,4 +1,2 @@
1
- export { appAuthModule, appAuthModule as default } from './appAuthModule.esm.js';
2
- export { auth0AuthApiRef, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
3
1
  export { signInTranslationRef } from './translations/signIn.esm.js';
4
2
  //# sourceMappingURL=alpha.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"appAuthModule.esm.js","sources":["../src/appAuthModule.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OAuth2 } from '@backstage/core-app-api';\nimport {\n configApiRef,\n discoveryApiRef,\n oauthRequestApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n ApiBlueprint,\n createFrontendModule,\n} from '@backstage/frontend-plugin-api';\nimport { SignInPageBlueprint } from '@backstage/plugin-app-react';\n\nimport {\n auth0AuthApiRef,\n keycloakAuthApiRef,\n oidcAuthApiRef,\n pingfederateAuthApiRef,\n samlAuthApiRef,\n} from './AuthApiRefs';\n\nconst oidcAuthApi = ApiBlueprint.make({\n name: 'oidc-auth',\n params: defineParams =>\n defineParams({\n api: oidcAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'oidc',\n title: 'OIDC',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst keycloakAuthApi = ApiBlueprint.make({\n name: 'keycloak-auth',\n params: defineParams =>\n defineParams({\n api: keycloakAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'keycloak',\n title: 'Keycloak',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst pingfederateAuthApi = ApiBlueprint.make({\n name: 'pingfederate-auth',\n params: defineParams =>\n defineParams({\n api: pingfederateAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'pingfederate',\n title: 'PingFederate',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst auth0AuthApi = ApiBlueprint.make({\n name: 'auth0-auth',\n params: defineParams =>\n defineParams({\n api: auth0AuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'auth0',\n title: 'Auth0',\n icon: () => null,\n },\n defaultScopes: ['openid', 'email', 'profile'],\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst samlAuthApi = ApiBlueprint.make({\n name: 'saml-auth',\n params: defineParams =>\n defineParams({\n api: samlAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'saml',\n title: 'SAML',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\n/**\n * Replaces the default app sign-in page. The page component is loaded via\n * dynamic import so core-components / MUI stay off the NFS alpha sync chunk.\n */\nconst signInPage = SignInPageBlueprint.make({\n params: {\n loader: () => import('./components/SignInPage').then(m => m.SignInPage),\n },\n});\n\n/**\n * RHDH app sign-in page plus OIDC, Keycloak, PingFederate, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).\n * Default-export this module for dynamic frontend loading.\n *\n * @alpha\n */\nexport const appAuthModule = createFrontendModule({\n pluginId: 'app',\n extensions: [\n signInPage,\n oidcAuthApi,\n keycloakAuthApi,\n pingfederateAuthApi,\n auth0AuthApi,\n samlAuthApi,\n ],\n});\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,WAAA,GAAc,aAAa,IAAA,CAAK;AAAA,EACpC,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,cAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,eAAA,EAAiB,kBAAA;AAAA,MACjB,SAAA,EAAW;AAAA,KACb;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,iBAAiB,SAAA,EAAU,KACnD,OAAO,MAAA,CAAO;AAAA,MACZ,SAAA;AAAA,MACA,YAAA;AAAA,MACA,eAAA;AAAA,MACA,QAAA,EAAU;AAAA,QACR,EAAA,EAAI,MAAA;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,MAAM,MAAM;AAAA,OACd;AAAA,MACA,WAAA,EAAa,SAAA,CAAU,iBAAA,CAAkB,kBAAkB;AAAA,KAC5D;AAAA,GACJ;AACL,CAAC,CAAA;AAED,MAAM,eAAA,GAAkB,aAAa,IAAA,CAAK;AAAA,EACxC,IAAA,EAAM,eAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,kBAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,eAAA,EAAiB,kBAAA;AAAA,MACjB,SAAA,EAAW;AAAA,KACb;AAAA,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AA,CAAqB;AAAA,EAChD,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY;AAAA,IACV,UAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,mBAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"appAuthModule.esm.js","sources":["../src/appAuthModule.tsx"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OAuth2 } from '@backstage/core-app-api';\nimport {\n configApiRef,\n discoveryApiRef,\n oauthRequestApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n ApiBlueprint,\n createFrontendModule,\n} from '@backstage/frontend-plugin-api';\nimport { SignInPageBlueprint } from '@backstage/plugin-app-react';\n\nimport {\n auth0AuthApiRef,\n keycloakAuthApiRef,\n oidcAuthApiRef,\n pingfederateAuthApiRef,\n samlAuthApiRef,\n} from './AuthApiRefs';\n\nconst oidcAuthApi = ApiBlueprint.make({\n name: 'oidc-auth',\n params: defineParams =>\n defineParams({\n api: oidcAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'oidc',\n title: 'OIDC',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst keycloakAuthApi = ApiBlueprint.make({\n name: 'keycloak-auth',\n params: defineParams =>\n defineParams({\n api: keycloakAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'keycloak',\n title: 'Keycloak',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst pingfederateAuthApi = ApiBlueprint.make({\n name: 'pingfederate-auth',\n params: defineParams =>\n defineParams({\n api: pingfederateAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n configApi,\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'pingfederate',\n title: 'PingFederate',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst auth0AuthApi = ApiBlueprint.make({\n name: 'auth0-auth',\n params: defineParams =>\n defineParams({\n api: auth0AuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'auth0',\n title: 'Auth0',\n icon: () => null,\n },\n defaultScopes: ['openid', 'email', 'profile'],\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\nconst samlAuthApi = ApiBlueprint.make({\n name: 'saml-auth',\n params: defineParams =>\n defineParams({\n api: samlAuthApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n oauthRequestApi: oauthRequestApiRef,\n configApi: configApiRef,\n },\n factory: ({ discoveryApi, oauthRequestApi, configApi }) =>\n OAuth2.create({\n discoveryApi,\n oauthRequestApi: oauthRequestApi,\n provider: {\n id: 'saml',\n title: 'SAML',\n icon: () => null,\n },\n environment: configApi.getOptionalString('auth.environment'),\n }),\n }),\n});\n\n/**\n * Replaces the default app sign-in page. The page component is loaded via\n * dynamic import so core-components / MUI stay off the NFS alpha sync chunk.\n */\nconst signInPage = SignInPageBlueprint.make({\n params: {\n loader: () => import('./components/SignInPage').then(m => m.SignInPage),\n },\n});\n\n/**\n * RHDH app sign-in page plus OIDC, Keycloak, PingFederate, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).\n * Default-export this module for dynamic frontend loading.\n *\n * @public\n */\nexport const appAuthModule = createFrontendModule({\n pluginId: 'app',\n extensions: [\n signInPage,\n oidcAuthApi,\n keycloakAuthApi,\n pingfederateAuthApi,\n auth0AuthApi,\n samlAuthApi,\n ],\n});\n"],"names":[],"mappings":";;;;;;AAoCA,MAAM,WAAA,GAAc,aAAa,IAAA,CAAK;AAAA,EACpC,IAAA,EAAM,WAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,cAAA;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,YAAA,EAAc,eAAA;AAAA,MACd,eAAA,EAAiB,kBAAA;AAAA,MACjB,SAAA,EAAW;AAAA,KACb;AAAA,IACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,iBAAiB,SAAA,EAAU,KACnD,OAAO,MAAA,CAAO;AAAA,MACZ,SAAA;AAAA,MACA,YAAA;AAAA,MACA,eAAA;AAAA,MACA,QAAA,EAAU;AAAA,QACR,EAAA,EAAI,MAAA;AAAA,QACJ,KAAA,EAAO,MAAA;AAAA,QACP,MAAM,MAAM;AAAA,OACd;AAAA,MACA,WAAA,EAAa,SAAA,CAAU,iBAAA,CAAkB,kBAAkB;AAAA,KAC5D;AAAA,GACJ;AACL,CAAC,CAAA;AAED,MAAM,eAAA,GAAkB,aAAa,IAAA,CAAK;AAAA,EACxC,IAAA,EAAM,eAAA;AAAA,EACN,MAAA,EAAQ,kB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K;AAAA,EAC1C,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,MAAM,OAAO,gCAAyB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,UAAU;AAAA;AAE1E,CAAC,CAAA;AAQM,MAAM,gBAAgB,oBAAA,CAAqB;AAAA,EAChD,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY;AAAA,IACV,UAAA;AAAA,IACA,WAAA;AAAA,IACA,eAAA;AAAA,IACA,mBAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA;AAEJ,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,9 +1,50 @@
1
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
+ import { OAuthApi, OpenIdConnectApi, ProfileInfoApi, BackstageIdentityApi, SessionApi, ApiRef } from '@backstage/core-plugin-api';
3
+
4
+ /**
5
+ * RHDH app sign-in page plus OIDC, Keycloak, PingFederate, Auth0, and SAML OAuth2 frontend APIs (`pluginId: app`).
6
+ * Default-export this module for dynamic frontend loading.
7
+ *
8
+ * @public
9
+ */
10
+ declare const appAuthModule: _backstage_frontend_plugin_api.FrontendModule;
11
+
12
+ /**
13
+ * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.
14
+ *
15
+ * @public
16
+ */
17
+ type CustomAuthApiRefType = OAuthApi & OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
18
+ /**
19
+ * OIDC auth API for the RHDH multi-provider sign-in page.
20
+ *
21
+ * @public
22
+ */
23
+ declare const oidcAuthApiRef: ApiRef<CustomAuthApiRefType>;
24
+ /**
25
+ * Keycloak auth API for the RHDH multi-provider sign-in page (OIDC-backed).
26
+ *
27
+ * @public
28
+ */
29
+ declare const keycloakAuthApiRef: ApiRef<CustomAuthApiRefType>;
30
+ /**
31
+ * PingFederate auth API for the RHDH multi-provider sign-in page (OIDC-backed).
32
+ *
33
+ * @public
34
+ */
35
+ declare const pingfederateAuthApiRef: ApiRef<CustomAuthApiRefType>;
36
+ /**
37
+ * Auth0 auth API for the RHDH multi-provider sign-in page.
38
+ *
39
+ * @public
40
+ */
41
+ declare const auth0AuthApiRef: ApiRef<CustomAuthApiRefType>;
1
42
  /**
2
- * Stub package root export for API reporting and bundlers. This plugin targets
3
- * the new frontend system only; use `./alpha` for public APIs.
43
+ * SAML auth API for the RHDH multi-provider sign-in page.
4
44
  *
5
- * @packageDocumentation
45
+ * @public
6
46
  */
7
- declare const _default: {};
47
+ declare const samlAuthApiRef: ApiRef<CustomAuthApiRefType>;
8
48
 
9
- export { _default as default };
49
+ export { appAuthModule, auth0AuthApiRef, appAuthModule as default, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef };
50
+ export type { CustomAuthApiRefType };
package/dist/index.esm.js CHANGED
@@ -1,4 +1,3 @@
1
- var index = {};
2
-
3
- export { index as default };
1
+ export { appAuthModule, appAuthModule as default } from './appAuthModule.esm.js';
2
+ export { auth0AuthApiRef, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
4
3
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Stub package root export for API reporting and bundlers. This plugin targets\n * the new frontend system only; use `./alpha` for public APIs.\n *\n * @packageDocumentation\n */\nexport default {};\n"],"names":[],"mappings":"AAsBA,YAAe,EAAC;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-app-auth",
3
- "version": "0.2.0",
3
+ "version": "1.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "RHDH sign-in page and OIDC/Auth0/SAML frontend auth APIs for the new frontend system",
6
6
  "main": "./dist/index.esm.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "backstage": "@backstage/FrontendModule",
10
11
  "import": "./dist/index.esm.js",
11
12
  "types": "./dist/index.d.ts",
12
13
  "default": "./dist/index.esm.js"
13
14
  },
14
15
  "./alpha": {
15
- "backstage": "@backstage/FrontendModule",
16
16
  "import": "./dist/alpha.esm.js",
17
17
  "types": "./dist/alpha.d.ts",
18
18
  "default": "./dist/alpha.esm.js"
@@ -44,7 +44,7 @@
44
44
  "@red-hat-developer-hub/backstage-plugin-app-auth"
45
45
  ],
46
46
  "features": {
47
- "./alpha": "@backstage/FrontendModule"
47
+ ".": "@backstage/FrontendModule"
48
48
  }
49
49
  },
50
50
  "sideEffects": false,
@@ -79,7 +79,7 @@
79
79
  "cross-fetch": "^4.0.0",
80
80
  "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
81
81
  "react-dom": "^18.0.2",
82
- "react-router-dom": "^6.30.2"
82
+ "react-router-dom": "^6.30.6"
83
83
  },
84
84
  "files": [
85
85
  "dist",