@red-hat-developer-hub/backstage-plugin-app-auth 0.1.1 → 1.0.0

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,62 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-app-auth
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 277f374: **BREAKING**: Graduate NFS exports from `/alpha` to the main entry point.
8
+
9
+ - All public APIs previously available from `./alpha` are now exported from the
10
+ package root (`.`). Update imports:
11
+
12
+ ```diff
13
+ -import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth/alpha';
14
+ +import { appAuthModule } from '@red-hat-developer-hub/backstage-plugin-app-auth';
15
+
16
+ -import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations/alpha';
17
+ +import { appIntegrationsModule } from '@red-hat-developer-hub/backstage-plugin-app-integrations';
18
+
19
+ -import { appDrawerModule, AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react/alpha';
20
+ +import { appDrawerModule, AppDrawerContentBlueprint } from '@red-hat-developer-hub/backstage-plugin-app-react';
21
+
22
+ -import { appDefaultsModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults/alpha';
23
+ +import { appDefaultsModule } from '@red-hat-developer-hub/backstage-plugin-app-defaults';
24
+ ```
25
+
26
+ - The `./alpha` subpath has been removed from `app-defaults` and `app-react`.
27
+ `app-auth` retains `./alpha` for translation exports (`signInTranslationRef`).
28
+ `app-integrations` retains `./alpha` with reduced exports (only
29
+ `mergeScmAuthFromDeps` and `ScmAuthFactoryDeps`; `appIntegrationsModule`
30
+ moved to the root entry).
31
+
32
+ - **`@red-hat-developer-hub/backstage-plugin-app-react`**: `ApplicationDrawer`
33
+ and `DrawerPanel` value exports have been removed from the main entry point.
34
+ They are now only available from the new `./legacy` subpath. If you import
35
+ these components directly, update your imports:
36
+
37
+ ```diff
38
+ -import { ApplicationDrawer, DrawerPanel } from '@red-hat-developer-hub/backstage-plugin-app-react';
39
+ +import { ApplicationDrawer, DrawerPanel } from '@red-hat-developer-hub/backstage-plugin-app-react/legacy';
40
+ ```
41
+
42
+ The `./legacy` subpath also re-exports `useAppDrawer` and associated types
43
+ for backward compatibility with OFS consumers.
44
+
45
+ - `@red-hat-developer-hub/backstage-plugin-app-react` adds a new
46
+ `./app-drawer-module` subpath that default-exports `appDrawerModule`
47
+ (`pluginId: 'app'`) for Scalprum / module-federation dynamic loading.
48
+
49
+ - All `pluginId: 'app'` modules are now re-exported as the default export from
50
+ their respective packages.
51
+
52
+ ## 0.2.0
53
+
54
+ ### Minor Changes
55
+
56
+ - 04e09fb: **BREAKING**: `SignInPage` is no longer exported from `@red-hat-developer-hub/backstage-plugin-app-auth/alpha`. Use `appAuthModule` (or the package default export); the page loads through `SignInPageBlueprint` with a dynamic `import()`.
57
+
58
+ Replaces `import appPlugin from '@backstage/plugin-app'` + extension override with `SignInPageBlueprint` from `@backstage/plugin-app-react` so the NFS alpha Module Federation sync chunk no longer pulls the full `@backstage/plugin-app` tree (AppRoot, `@backstage/ui`, framer-motion, markdown, MUI v4).
59
+
3
60
  ## 0.1.1
4
61
 
5
62
  ### Patch 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`, `SignInPage`, `signInTranslationRef`, and auth API refs.
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,57 +1,4 @@
1
1
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
- import { SignInPageProps, 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
- * RHDH multi-provider sign-in page (mirrors classic app `SignInPage` behavior for NFS).
14
- *
15
- * @alpha
16
- */
17
- declare function SignInPage(props: SignInPageProps): React.JSX.Element;
18
-
19
- /**
20
- * Combined surface for custom RHDH auth APIs backed by `OAuth2` in the app module.
21
- *
22
- * @alpha
23
- */
24
- type CustomAuthApiRefType = OAuthApi & OpenIdConnectApi & ProfileInfoApi & BackstageIdentityApi & SessionApi;
25
- /**
26
- * OIDC auth API for the RHDH multi-provider sign-in page.
27
- *
28
- * @alpha
29
- */
30
- declare const oidcAuthApiRef: ApiRef<CustomAuthApiRefType>;
31
- /**
32
- * Keycloak auth API for the RHDH multi-provider sign-in page (OIDC-backed).
33
- *
34
- * @alpha
35
- */
36
- declare const keycloakAuthApiRef: ApiRef<CustomAuthApiRefType>;
37
- /**
38
- * PingFederate auth API for the RHDH multi-provider sign-in page (OIDC-backed).
39
- *
40
- * @alpha
41
- */
42
- declare const pingfederateAuthApiRef: ApiRef<CustomAuthApiRefType>;
43
- /**
44
- * Auth0 auth API for the RHDH multi-provider sign-in page.
45
- *
46
- * @alpha
47
- */
48
- declare const auth0AuthApiRef: ApiRef<CustomAuthApiRefType>;
49
- /**
50
- * SAML auth API for the RHDH multi-provider sign-in page.
51
- *
52
- * @alpha
53
- */
54
- declare const samlAuthApiRef: ApiRef<CustomAuthApiRefType>;
55
2
 
56
3
  /**
57
4
  * Sign-in page messages (English). Same key shape as legacy RHDH app signIn for compatibility.
@@ -93,5 +40,4 @@ declare const signInTranslationRef: _backstage_frontend_plugin_api.TranslationRe
93
40
  readonly "signIn.providers.saml.message": "Sign in using SAML";
94
41
  }>;
95
42
 
96
- export { SignInPage, appAuthModule, auth0AuthApiRef, appAuthModule as default, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef, signInTranslationRef };
97
- export type { CustomAuthApiRefType };
43
+ export { signInTranslationRef };
package/dist/alpha.esm.js CHANGED
@@ -1,5 +1,2 @@
1
- export { appAuthModule, appAuthModule as default } from './appAuthModule.esm.js';
2
- export { SignInPage } from './components/SignInPage.esm.js';
3
- export { auth0AuthApiRef, keycloakAuthApiRef, oidcAuthApiRef, pingfederateAuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
4
1
  export { signInTranslationRef } from './translations/signIn.esm.js';
5
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,10 +1,8 @@
1
- import { jsx } from 'react/jsx-runtime';
2
1
  import { OAuth2 } from '@backstage/core-app-api';
3
2
  import { configApiRef, oauthRequestApiRef, discoveryApiRef } from '@backstage/core-plugin-api';
4
3
  import { ApiBlueprint, createFrontendModule } from '@backstage/frontend-plugin-api';
5
- import appPlugin from '@backstage/plugin-app';
4
+ import { SignInPageBlueprint } from '@backstage/plugin-app-react';
6
5
  import { oidcAuthApiRef, keycloakAuthApiRef, pingfederateAuthApiRef, auth0AuthApiRef, samlAuthApiRef } from './AuthApiRefs.esm.js';
7
- import { SignInPage } from './components/SignInPage.esm.js';
8
6
 
9
7
  const oidcAuthApi = ApiBlueprint.make({
10
8
  name: "oidc-auth",
@@ -115,15 +113,15 @@ const samlAuthApi = ApiBlueprint.make({
115
113
  })
116
114
  })
117
115
  });
118
- const signInPageOverride = appPlugin.getExtension("sign-in-page:app").override({
116
+ const signInPage = SignInPageBlueprint.make({
119
117
  params: {
120
- loader: async () => (props) => /* @__PURE__ */ jsx(SignInPage, { ...props })
118
+ loader: () => import('./components/SignInPage.esm.js').then((m) => m.SignInPage)
121
119
  }
122
120
  });
123
121
  const appAuthModule = createFrontendModule({
124
122
  pluginId: "app",
125
123
  extensions: [
126
- signInPageOverride,
124
+ signInPage,
127
125
  oidcAuthApi,
128
126
  keycloakAuthApi,
129
127
  pingfederateAuthApi,
@@ -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 appPlugin from '@backstage/plugin-app';\n\nimport {\n auth0AuthApiRef,\n keycloakAuthApiRef,\n oidcAuthApiRef,\n pingfederateAuthApiRef,\n samlAuthApiRef,\n} from './AuthApiRefs';\nimport { SignInPage } from './components/SignInPage';\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\nconst signInPageOverride = appPlugin.getExtension('sign-in-page:app').override({\n params: {\n loader: async () => (props: Parameters<typeof SignInPage>[0]) =>\n <SignInPage {...props} />,\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 signInPageOverride,\n oidcAuthApi,\n keycloakAuthApi,\n pingfederateAuthApi,\n auth0AuthApi,\n samlAuthApi,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;AAqCA,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,IACA,OAAA,EAAS,C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B,oBAAA,CAAqB;AAAA,EAChD,QAAA,EAAU,KAAA;AAAA,EACV,UAAA,EAAY;AAAA,IACV,kBAAA;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,EA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AA,CAAK;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.1.1",
3
+ "version": "1.0.0",
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,
@@ -63,7 +63,7 @@
63
63
  "@backstage/core-components": "^0.18.11",
64
64
  "@backstage/core-plugin-api": "^1.12.7",
65
65
  "@backstage/frontend-plugin-api": "^0.17.2",
66
- "@backstage/plugin-app": "^0.5.0",
66
+ "@backstage/plugin-app-react": "^0.2.4",
67
67
  "@mui/material": "5.18.0"
68
68
  },
69
69
  "peerDependencies": {