@backstage-community/plugin-multi-source-security-viewer 0.3.0 → 0.4.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,23 @@
1
1
  # @backstage-community/plugin-multi-source-security-viewer
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 682570b: URL encode the repository slug
8
+
9
+ ## 0.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - d346a7e: Include Azure Pipelines pre-requisite link
14
+
15
+ ## 0.3.1
16
+
17
+ ### Patch Changes
18
+
19
+ - d4061d7: Fix issue where patternfly overrides plugin css
20
+
3
21
  ## 0.3.0
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -63,6 +63,7 @@ To enable the PipelineRun list in the Security tab on the entity view page, add
63
63
  - [Jenkins](../../../jenkins/plugins/jenkins/README.md)
64
64
  - [Github Actions]([../../../github-actions/plugins/github-actions/README.md)
65
65
  - [Gitlab CI](https://github.com/immobiliare/backstage-plugin-gitlab?tab=readme-ov-file#annotations)
66
+ - [Azure Pipelines](../../../azure-devops/plugins/azure-devops/README.md)
66
67
 
67
68
  ### Procedure
68
69
 
@@ -47,7 +47,9 @@ class MssvGitlabCIClient {
47
47
  const { entity, page, pageSize } = options;
48
48
  this.gitlabCiApi.gitlabInstance = entity.metadata.annotations?.[GITLAB_ANNOTATION_INSTANCE] ?? "gitlab.com";
49
49
  const projectId = entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_ID];
50
- const projectSlug = entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_SLUG];
50
+ const projectSlug = encodeURIComponent(
51
+ entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_SLUG] ?? ""
52
+ );
51
53
  const [sliceStart, sliceEnd] = [
52
54
  page * pageSize,
53
55
  page * pageSize + pageSize
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab.esm.js","sources":["../../src/api/gitlab.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 */\nimport { GitlabCIClient } from '@immobiliarelabs/backstage-plugin-gitlab';\nimport { MssvApi, MssvApiResponse } from './mssv';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n DiscoveryApi,\n IdentityApi,\n OAuthApi,\n createApiRef,\n} from '@backstage/core-plugin-api';\nimport { PipelineRunResult } from '../models/pipelineRunResult';\nimport { GitlabPipelineStatus, RunStatus } from '../types/pipelinerun';\n\n// Apiref to map with client\nexport const mssvGitlabCIApiRef = createApiRef<MssvApi>({\n id: 'plugin.mssv-api-gitlabci.service',\n});\n\nconst mapStatus = (status: string): RunStatus => {\n const runStatus =\n GitlabPipelineStatus[status as keyof typeof GitlabPipelineStatus];\n switch (runStatus) {\n case GitlabPipelineStatus.success:\n return RunStatus.Succeeded;\n case GitlabPipelineStatus.failed:\n return RunStatus.Failed;\n case GitlabPipelineStatus.pending:\n return RunStatus.Pending;\n case GitlabPipelineStatus.running:\n return RunStatus.Running;\n default:\n return RunStatus.Unknown;\n }\n};\n\nconst GITLAB_ANNOTATION_PROJECT_ID = 'gitlab.com/project-id';\nconst GITLAB_ANNOTATION_PROJECT_SLUG = 'gitlab.com/project-slug';\nconst GITLAB_ANNOTATION_INSTANCE = 'gitlab.com/instance';\n\ntype APIOptions = {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n codeOwnersPath?: string;\n readmePath?: string;\n gitlabAuthApi: OAuthApi;\n useOAuth?: boolean;\n};\n\nexport class CustomGitlabCiClient extends GitlabCIClient {\n constructor(options: APIOptions) {\n // gitlabInstance is omitted as it is set through the entity\n super(options as any);\n }\n\n getPipelineJobs(\n projectId: number | string,\n pipelineId: number,\n ): Promise<any[] | undefined> {\n return this.callApi(\n `projects/${projectId}/pipelines/${pipelineId}/jobs`,\n {},\n );\n }\n\n getJobLogs(\n projectId: number | string,\n jobId: number,\n ): Promise<string | undefined> {\n return this.callApi(`projects/${projectId}/jobs/${jobId}/trace`, {});\n }\n}\n\nexport class MssvGitlabCIClient implements Partial<MssvApi> {\n private readonly gitlabCiApi: CustomGitlabCiClient;\n\n constructor(options: { gitlabCiApi: CustomGitlabCiClient }) {\n this.gitlabCiApi = options.gitlabCiApi;\n }\n\n async getPipelineSummary(options: {\n entity: Entity;\n page: number;\n pageSize: number;\n }): Promise<MssvApiResponse> {\n const { entity, page, pageSize } = options;\n\n this.gitlabCiApi.gitlabInstance =\n entity.metadata.annotations?.[GITLAB_ANNOTATION_INSTANCE] ?? 'gitlab.com';\n\n const projectId =\n entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_ID];\n\n const projectSlug =\n entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_SLUG];\n\n const [sliceStart, sliceEnd] = [\n page * pageSize,\n page * pageSize + pageSize,\n ];\n\n const summary =\n (await this.gitlabCiApi.getPipelineSummary(projectId ?? projectSlug)) ??\n [];\n\n const summarySlice = summary.slice(sliceStart, sliceEnd);\n const summaryWithLogs = await Promise.all(\n summarySlice.map(async run => {\n const pipelineJobs =\n (await this.gitlabCiApi.getPipelineJobs(run.project_id, run.id)) ??\n [];\n\n const logs = await Promise.all(\n pipelineJobs.map(async job => {\n return await this.gitlabCiApi\n .getJobLogs(run.project_id, job.id)\n .catch(() => ''); // fallback on empty string. It disables logs button and updates tooltip\n }) ?? [],\n ).then(res => res.join(' ')); // return as one\n return { run, logs };\n }),\n );\n\n const results =\n summaryWithLogs.map(\n pr =>\n new PipelineRunResult({\n id: pr?.run?.id.toString(),\n displayName: pr?.run?.id.toString(),\n status: mapStatus(pr?.run?.status ?? 'UNKOWN'),\n logs: pr?.logs,\n }),\n ) || [];\n\n return { results, totalCount: summary?.length ?? 0 };\n }\n\n async getPipelineDetail(): Promise<MssvApiResponse> {\n return { results: [], totalCount: 0 };\n }\n}\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,qBAAqB,YAAsB,CAAA;AAAA,EACtD,EAAI,EAAA;AACN,CAAC;AAED,MAAM,SAAA,GAAY,CAAC,MAA8B,KAAA;AAC/C,EAAM,MAAA,SAAA,GACJ,qBAAqB,MAA2C,CAAA;AAClE,EAAA,QAAQ,SAAW;AAAA,IACjB,KAAK,oBAAqB,CAAA,OAAA;AACxB,MAAA,OAAO,SAAU,CAAA,SAAA;AAAA,IACnB,KAAK,oBAAqB,CAAA,MAAA;AACxB,MAAA,OAAO,SAAU,CAAA,MAAA;AAAA,IACnB,KAAK,oBAAqB,CAAA,OAAA;AACxB,MAAA,OAAO,SAAU,CAAA,OAAA;AAAA,IACnB,KAAK,oBAAqB,CAAA,OAAA;AACxB,MAAA,OAAO,SAAU,CAAA,OAAA;AAAA,IACnB;AACE,MAAA,OAAO,SAAU,CAAA,OAAA;AAAA;AAEvB,CAAA;AAEA,MAAM,4BAA+B,GAAA,uBAAA;AACrC,MAAM,8BAAiC,GAAA,yBAAA;AACvC,MAAM,0BAA6B,GAAA,qBAAA;AAW5B,MAAM,6BAA6B,cAAe,CAAA;AAAA,EACvD,YAAY,OAAqB,EAAA;AAE/B,IAAA,KAAA,CAAM,OAAc,CAAA;AAAA;AACtB,EAEA,eAAA,CACE,WACA,UAC4B,EAAA;AAC5B,IAAA,OAAO,IAAK,CAAA,OAAA;AAAA,MACV,CAAA,SAAA,EAAY,SAAS,CAAA,WAAA,EAAc,UAAU,CAAA,KAAA,CAAA;AAAA,MAC7C;AAAC,KACH;AAAA;AACF,EAEA,UAAA,CACE,WACA,KAC6B,EAAA;AAC7B,IAAO,OAAA,IAAA,CAAK,QAAQ,CAAY,SAAA,EAAA,S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AAA;AAC5B,YAAO,OAAA,MAAM,IAAK,CAAA,WAAA,CACf,UAAW,CAAA,GAAA,CAAI,UAAY,EAAA,GAAA,CAAI,EAAE,CAAA,CACjC,KAAM,CAAA,MAAM,EAAE,CAAA;AAAA,WAClB,KAAK;AAAC,UACP,IAAK,CAAA,CAAA,GAAA,KAAO,GAAI,CAAA,IAAA,CAAK,GAAG,CAAC,CAAA;AAC3B,QAAO,OAAA,EAAE,KAAK,IAAK,EAAA;AAAA,OACpB;AAAA,KACH;AAEA,IAAA,MAAM,UACJ,eAAgB,CAAA,GAAA;AAAA,MACd,CAAA,EAAA,KACE,IAAI,iBAAkB,CAAA;AAAA,QACpB,EAAI,EAAA,EAAA,EAAI,GAAK,EAAA,EAAA,CAAG,QAAS,EAAA;AAAA,QACzB,WAAa,EAAA,EAAA,EAAI,GAAK,EAAA,EAAA,CAAG,QAAS,EAAA;AAAA,QAClC,MAAQ,EAAA,SAAA,CAAU,EAAI,EAAA,GAAA,EAAK,UAAU,QAAQ,CAAA;AAAA,QAC7C,MAAM,EAAI,EAAA;AAAA,OACX;AAAA,SACA,EAAC;AAER,IAAA,OAAO,EAAE,OAAA,EAAS,UAAY,EAAA,OAAA,EAAS,UAAU,CAAE,EAAA;AAAA;AACrD,EAEA,MAAM,iBAA8C,GAAA;AAClD,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAG,YAAY,CAAE,EAAA;AAAA;AAExC;;;;"}
1
+ {"version":3,"file":"gitlab.esm.js","sources":["../../src/api/gitlab.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 */\nimport { GitlabCIClient } from '@immobiliarelabs/backstage-plugin-gitlab';\nimport { MssvApi, MssvApiResponse } from './mssv';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n DiscoveryApi,\n IdentityApi,\n OAuthApi,\n createApiRef,\n} from '@backstage/core-plugin-api';\nimport { PipelineRunResult } from '../models/pipelineRunResult';\nimport { GitlabPipelineStatus, RunStatus } from '../types/pipelinerun';\n\n// Apiref to map with client\nexport const mssvGitlabCIApiRef = createApiRef<MssvApi>({\n id: 'plugin.mssv-api-gitlabci.service',\n});\n\nconst mapStatus = (status: string): RunStatus => {\n const runStatus =\n GitlabPipelineStatus[status as keyof typeof GitlabPipelineStatus];\n switch (runStatus) {\n case GitlabPipelineStatus.success:\n return RunStatus.Succeeded;\n case GitlabPipelineStatus.failed:\n return RunStatus.Failed;\n case GitlabPipelineStatus.pending:\n return RunStatus.Pending;\n case GitlabPipelineStatus.running:\n return RunStatus.Running;\n default:\n return RunStatus.Unknown;\n }\n};\n\nconst GITLAB_ANNOTATION_PROJECT_ID = 'gitlab.com/project-id';\nconst GITLAB_ANNOTATION_PROJECT_SLUG = 'gitlab.com/project-slug';\nconst GITLAB_ANNOTATION_INSTANCE = 'gitlab.com/instance';\n\ntype APIOptions = {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n codeOwnersPath?: string;\n readmePath?: string;\n gitlabAuthApi: OAuthApi;\n useOAuth?: boolean;\n};\n\nexport class CustomGitlabCiClient extends GitlabCIClient {\n constructor(options: APIOptions) {\n // gitlabInstance is omitted as it is set through the entity\n super(options as any);\n }\n\n getPipelineJobs(\n projectId: number | string,\n pipelineId: number,\n ): Promise<any[] | undefined> {\n return this.callApi(\n `projects/${projectId}/pipelines/${pipelineId}/jobs`,\n {},\n );\n }\n\n getJobLogs(\n projectId: number | string,\n jobId: number,\n ): Promise<string | undefined> {\n return this.callApi(`projects/${projectId}/jobs/${jobId}/trace`, {});\n }\n}\n\nexport class MssvGitlabCIClient implements Partial<MssvApi> {\n private readonly gitlabCiApi: CustomGitlabCiClient;\n\n constructor(options: { gitlabCiApi: CustomGitlabCiClient }) {\n this.gitlabCiApi = options.gitlabCiApi;\n }\n\n async getPipelineSummary(options: {\n entity: Entity;\n page: number;\n pageSize: number;\n }): Promise<MssvApiResponse> {\n const { entity, page, pageSize } = options;\n\n this.gitlabCiApi.gitlabInstance =\n entity.metadata.annotations?.[GITLAB_ANNOTATION_INSTANCE] ?? 'gitlab.com';\n\n const projectId =\n entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_ID];\n\n const projectSlug = encodeURIComponent(\n entity.metadata.annotations?.[GITLAB_ANNOTATION_PROJECT_SLUG] ?? '',\n );\n\n const [sliceStart, sliceEnd] = [\n page * pageSize,\n page * pageSize + pageSize,\n ];\n\n const summary =\n (await this.gitlabCiApi.getPipelineSummary(projectId ?? projectSlug)) ??\n [];\n\n const summarySlice = summary.slice(sliceStart, sliceEnd);\n const summaryWithLogs = await Promise.all(\n summarySlice.map(async run => {\n const pipelineJobs =\n (await this.gitlabCiApi.getPipelineJobs(run.project_id, run.id)) ??\n [];\n\n const logs = await Promise.all(\n pipelineJobs.map(async job => {\n return await this.gitlabCiApi\n .getJobLogs(run.project_id, job.id)\n .catch(() => ''); // fallback on empty string. It disables logs button and updates tooltip\n }) ?? [],\n ).then(res => res.join(' ')); // return as one\n return { run, logs };\n }),\n );\n\n const results =\n summaryWithLogs.map(\n pr =>\n new PipelineRunResult({\n id: pr?.run?.id.toString(),\n displayName: pr?.run?.id.toString(),\n status: mapStatus(pr?.run?.status ?? 'UNKOWN'),\n logs: pr?.logs,\n }),\n ) || [];\n\n return { results, totalCount: summary?.length ?? 0 };\n }\n\n async getPipelineDetail(): Promise<MssvApiResponse> {\n return { results: [], totalCount: 0 };\n }\n}\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,qBAAqB,YAAsB,CAAA;AAAA,EACtD,EAAI,EAAA;AACN,CAAC;AAED,MAAM,SAAA,GAAY,CAAC,MA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AAC3B,QAAO,OAAA,EAAE,KAAK,IAAK,EAAA;AAAA,OACpB;AAAA,KACH;AAEA,IAAA,MAAM,UACJ,eAAgB,CAAA,GAAA;AAAA,MACd,CAAA,EAAA,KACE,IAAI,iBAAkB,CAAA;AAAA,QACpB,EAAI,EAAA,EAAA,EAAI,GAAK,EAAA,EAAA,CAAG,QAAS,EAAA;AAAA,QACzB,WAAa,EAAA,EAAA,EAAI,GAAK,EAAA,EAAA,CAAG,QAAS,EAAA;AAAA,QAClC,MAAQ,EAAA,SAAA,CAAU,EAAI,EAAA,GAAA,EAAK,UAAU,QAAQ,CAAA;AAAA,QAC7C,MAAM,EAAI,EAAA;AAAA,OACX;AAAA,SACA,EAAC;AAER,IAAA,OAAO,EAAE,OAAA,EAAS,UAAY,EAAA,OAAA,EAAS,UAAU,CAAE,EAAA;AAAA;AACrD,EAEA,MAAM,iBAA8C,GAAA;AAClD,IAAA,OAAO,EAAE,OAAA,EAAS,EAAC,EAAG,YAAY,CAAE,EAAA;AAAA;AAExC;;;;"}
@@ -1,5 +1,5 @@
1
+ import '@patternfly/patternfly/utilities/Accessibility/accessibility.css';
1
2
  import '@patternfly/react-core/dist/styles/base-no-reset.css';
2
- import '@patternfly/patternfly/patternfly.css';
3
3
  import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, configApiRef, gitlabAuthApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
4
4
  import { rootRouteRef } from './routes.esm.js';
5
5
  import { mssvJenkinsApiRef, MssvJenkinsClient } from './api/jenkins.esm.js';
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 */\nimport '@patternfly/react-core/dist/styles/base-no-reset.css';\nimport '@patternfly/patternfly/patternfly.css';\n\nimport {\n configApiRef,\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n gitlabAuthApiRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport { MssvJenkinsClient, mssvJenkinsApiRef } from './api/jenkins';\nimport {\n JenkinsClient,\n isJenkinsAvailable,\n} from '@backstage-community/plugin-jenkins';\nimport { MssvGithubActionsClient, mssvGithubActionsApiRef } from './api/github';\nimport {\n GithubActionsClient,\n isGithubActionsAvailable,\n} from '@backstage-community/plugin-github-actions';\nimport { scmAuthApiRef } from '@backstage/integration-react';\nimport {\n CustomGitlabCiClient,\n MssvGitlabCIClient,\n mssvGitlabCIApiRef,\n} from './api/gitlab';\nimport { isGitlabAvailable } from '@immobiliarelabs/backstage-plugin-gitlab';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n AzureDevOpsClient,\n isAzurePipelinesAvailable,\n} from '@backstage-community/plugin-azure-devops';\nimport { MssvAzureDevopsClient, mssvAzureDevopsApiRef } from './api/azure';\n\n/** @public */\nexport const multiSourceSecurityViewerPlugin = createPlugin({\n id: 'multi-source-security-viewer',\n apis: [\n createApiFactory({\n api: mssvJenkinsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) => {\n return new MssvJenkinsClient({\n jenkinsApi: new JenkinsClient({\n discoveryApi,\n fetchApi,\n }),\n });\n },\n }),\n createApiFactory({\n api: mssvGithubActionsApiRef,\n deps: {\n configApi: configApiRef,\n scmAuthApi: scmAuthApiRef,\n },\n factory: ({ configApi, scmAuthApi }) => {\n return new MssvGithubActionsClient({\n githubActionsApi: new GithubActionsClient({ configApi, scmAuthApi }),\n });\n },\n }),\n createApiFactory({\n api: mssvGitlabCIApiRef,\n deps: {\n configApi: configApiRef,\n discoveryApi: discoveryApiRef,\n gitlabAuthApi: gitlabAuthApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ configApi, identityApi, discoveryApi, gitlabAuthApi }) => {\n return new MssvGitlabCIClient({\n gitlabCiApi: new CustomGitlabCiClient({\n discoveryApi,\n gitlabAuthApi,\n identityApi,\n codeOwnersPath: configApi.getOptionalString(\n 'gitlab.defaultCodeOwnersPath',\n ),\n readmePath: configApi.getOptionalString('gitlab.defaultReadmePath'),\n useOAuth: configApi.getOptionalBoolean('gitlab.useOAuth'),\n }),\n });\n },\n }),\n createApiFactory({\n api: mssvAzureDevopsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) => {\n return new MssvAzureDevopsClient({\n azureDevopsApi: new AzureDevOpsClient({\n discoveryApi,\n fetchApi,\n }),\n });\n },\n }),\n ],\n routes: {\n entityContent: rootRouteRef,\n },\n});\n\n/** @public */\nexport const isMultiCIAvailable = (entity: Entity): boolean =>\n isJenkinsAvailable(entity) ||\n isGitlabAvailable(entity) ||\n isGithubActionsAvailable(entity) ||\n isAzurePipelinesAvailable(entity);\n\n/** @public */\nexport const EntityMultiCIPipelinesContent =\n multiSourceSecurityViewerPlugin.provide(\n createRoutableExtension({\n name: 'EntityMultiCIPipelinesContent',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuDO,MAAM,kCAAkC,YAAa,CAAA;AAAA,EAC1D,EAAI,EAAA,8BAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,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f,GAAK,EAAA,qBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAS,EAAA,CAAC,EAAE,YAAA,EAAc,UAAe,KAAA;AACvC,QAAA,OAAO,IAAI,qBAAsB,CAAA;AAAA,UAC/B,cAAA,EAAgB,IAAI,iBAAkB,CAAA;AAAA,YACpC,YAAA;AAAA,YACA;AAAA,WACD;AAAA,SACF,CAAA;AAAA;AACH,KACD;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,aAAe,EAAA;AAAA;AAEnB,CAAC;AAGM,MAAM,kBAAqB,GAAA,CAAC,MACjC,KAAA,kBAAA,CAAmB,MAAM,CAAA,IACzB,iBAAkB,CAAA,MAAM,CACxB,IAAA,wBAAA,CAAyB,MAAM,CAAA,IAC/B,0BAA0B,MAAM;AAG3B,MAAM,gCACX,+BAAgC,CAAA,OAAA;AAAA,EAC9B,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,+BAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,4BAAqB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACjE,UAAY,EAAA;AAAA,GACb;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 */\nimport '@patternfly/patternfly/utilities/Accessibility/accessibility.css';\nimport '@patternfly/react-core/dist/styles/base-no-reset.css';\n\nimport {\n configApiRef,\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n gitlabAuthApiRef,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport { MssvJenkinsClient, mssvJenkinsApiRef } from './api/jenkins';\nimport {\n JenkinsClient,\n isJenkinsAvailable,\n} from '@backstage-community/plugin-jenkins';\nimport { MssvGithubActionsClient, mssvGithubActionsApiRef } from './api/github';\nimport {\n GithubActionsClient,\n isGithubActionsAvailable,\n} from '@backstage-community/plugin-github-actions';\nimport { scmAuthApiRef } from '@backstage/integration-react';\nimport {\n CustomGitlabCiClient,\n MssvGitlabCIClient,\n mssvGitlabCIApiRef,\n} from './api/gitlab';\nimport { isGitlabAvailable } from '@immobiliarelabs/backstage-plugin-gitlab';\nimport { Entity } from '@backstage/catalog-model';\nimport {\n AzureDevOpsClient,\n isAzurePipelinesAvailable,\n} from '@backstage-community/plugin-azure-devops';\nimport { MssvAzureDevopsClient, mssvAzureDevopsApiRef } from './api/azure';\n\n/** @public */\nexport const multiSourceSecurityViewerPlugin = createPlugin({\n id: 'multi-source-security-viewer',\n apis: [\n createApiFactory({\n api: mssvJenkinsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) => {\n return new MssvJenkinsClient({\n jenkinsApi: new JenkinsClient({\n discoveryApi,\n fetchApi,\n }),\n });\n },\n }),\n createApiFactory({\n api: mssvGithubActionsApiRef,\n deps: {\n configApi: configApiRef,\n scmAuthApi: scmAuthApiRef,\n },\n factory: ({ configApi, scmAuthApi }) => {\n return new MssvGithubActionsClient({\n githubActionsApi: new GithubActionsClient({ configApi, scmAuthApi }),\n });\n },\n }),\n createApiFactory({\n api: mssvGitlabCIApiRef,\n deps: {\n configApi: configApiRef,\n discoveryApi: discoveryApiRef,\n gitlabAuthApi: gitlabAuthApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ configApi, identityApi, discoveryApi, gitlabAuthApi }) => {\n return new MssvGitlabCIClient({\n gitlabCiApi: new CustomGitlabCiClient({\n discoveryApi,\n gitlabAuthApi,\n identityApi,\n codeOwnersPath: configApi.getOptionalString(\n 'gitlab.defaultCodeOwnersPath',\n ),\n readmePath: configApi.getOptionalString('gitlab.defaultReadmePath'),\n useOAuth: configApi.getOptionalBoolean('gitlab.useOAuth'),\n }),\n });\n },\n }),\n createApiFactory({\n api: mssvAzureDevopsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) => {\n return new MssvAzureDevopsClient({\n azureDevopsApi: new AzureDevOpsClient({\n discoveryApi,\n fetchApi,\n }),\n });\n },\n }),\n ],\n routes: {\n entityContent: rootRouteRef,\n },\n});\n\n/** @public */\nexport const isMultiCIAvailable = (entity: Entity): boolean =>\n isJenkinsAvailable(entity) ||\n isGitlabAvailable(entity) ||\n isGithubActionsAvailable(entity) ||\n isAzurePipelinesAvailable(entity);\n\n/** @public */\nexport const EntityMultiCIPipelinesContent =\n multiSourceSecurityViewerPlugin.provide(\n createRoutableExtension({\n name: 'EntityMultiCIPipelinesContent',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n );\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuDO,MAAM,kCAAkC,YAAa,CAAA;AAAA,EAC1D,EAAI,EAAA,8BAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAS,EAAA,CAAC,EAAE,YAAA,EAAc,UAAe,KAAA;AACvC,QAAA,OAAO,IAAI,iBAAkB,CAAA;AAAA,UAC3B,UAAA,EAAY,IAAI,aAAc,CAAA;AAAA,YAC5B,YAAA;AAAA,YACA;A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,KAAA;AACvC,QAAA,OAAO,IAAI,qBAAsB,CAAA;AAAA,UAC/B,cAAA,EAAgB,IAAI,iBAAkB,CAAA;AAAA,YACpC,YAAA;AAAA,YACA;AAAA,WACD;AAAA,SACF,CAAA;AAAA;AACH,KACD;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,aAAe,EAAA;AAAA;AAEnB,CAAC;AAGM,MAAM,kBAAqB,GAAA,CAAC,MACjC,KAAA,kBAAA,CAAmB,MAAM,CAAA,IACzB,iBAAkB,CAAA,MAAM,CACxB,IAAA,wBAAA,CAAyB,MAAM,CAAA,IAC/B,0BAA0B,MAAM;AAG3B,MAAM,gCACX,+BAAgC,CAAA,OAAA;AAAA,EAC9B,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,+BAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,4BAAqB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACjE,UAAY,EAAA;AAAA,GACb;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-multi-source-security-viewer",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "main": "dist/index.esm.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",