Skip to content

Commit

Permalink
chore(release): 3.6.0 [skip ci]
Browse files Browse the repository at this point in the history
* **rbac:** add support for multiple policies CRUD (janus-idp#984)

* **janus-idp#1019:** implemented feedback plugin ([janus-idp#1045](janus-idp#1045)) ([34c312e](janus-idp@34c312e)), closes [janus-idp#1019](janus-idp#1019)
* **kiali:** add OWNERS file to kiali* plugin ([janus-idp#1082](janus-idp#1082)) ([e2dc23b](janus-idp@e2dc23b))
* **notifications:** make notifications NPM packages public ([janus-idp#1061](janus-idp#1061)) ([ecec1db](janus-idp@ecec1db))
* **Notifications:** new notifications FE plugin, API and backend ([janus-idp#933](janus-idp#933)) ([4d4cb78](janus-idp@4d4cb78))
* **ocm:** add sorting to the ocm ClusterStatusPage table ([janus-idp#1052](janus-idp#1052)) ([8203aaf](janus-idp@8203aaf))
* **orchestrator:** add orchestrator plugin ([janus-idp#783](janus-idp#783)) ([cf5fe74](janus-idp@cf5fe74)), closes [janus-idp#28](janus-idp#28) [janus-idp#38](janus-idp#38) [janus-idp#35](janus-idp#35) [janus-idp#21](janus-idp#21)
* **quay:** fix sorting in quay table and tag details ([janus-idp#1044](janus-idp#1044)) ([ceb16a9](janus-idp@ceb16a9))
* **rbac:** add doc about RBAC backend conditions API ([janus-idp#1027](janus-idp#1027)) ([fc9ad53](janus-idp@fc9ad53))
* **rbac:** add support for creation of role ([janus-idp#974](janus-idp#974)) ([7cb9cbd](janus-idp@7cb9cbd))
* **rbac:** add support for multiple policies CRUD ([janus-idp#984](janus-idp#984)) ([518c767](janus-idp@518c767))
* **rbac:** add vscode debug configuration for opened jest test files ([janus-idp#1047](janus-idp#1047)) ([7e7a9ae](janus-idp@7e7a9ae))
* **rbac:** allow editing permission policies ([janus-idp#1037](janus-idp#1037)) ([c10347d](janus-idp@c10347d))
* **rbac:** allow editing roles ([janus-idp#1001](janus-idp#1001)) ([2e81062](janus-idp@2e81062))
* **rbac:** cleanup policies when a role is deleted ([janus-idp#1018](janus-idp#1018)) ([fb0ee8c](janus-idp@fb0ee8c))
* **rbac:** show warning alert when user is not authorised to create roles ([janus-idp#1064](janus-idp#1064)) ([b5c46c8](janus-idp@b5c46c8))
* **rbac:** support for adding permission policies to roles ([janus-idp#1021](janus-idp#1021)) ([dd11c3a](janus-idp@dd11c3a))
* **tekton:** add CVE summary and signed badge ([janus-idp#1028](janus-idp#1028)) ([effdef0](janus-idp@effdef0))
* **tekton:** add support for downloading task and pipelinerun logs ([janus-idp#1014](janus-idp#1014)) ([f588292](janus-idp@f588292))
* **tekton:** add view logs and view sbom actions in the pipelineRun list ([janus-idp#1003](janus-idp#1003)) ([c7eff5f](janus-idp@c7eff5f))
* **web-terminal:** impr README, add isWebTerminalAvailable util and fix some other small bugs ([janus-idp#1036](janus-idp#1036)) ([a3d6d86](janus-idp@a3d6d86))

* **janus-idp#1012:** typo fix in `servicenow:now:table:retrieveRecords` action ([janus-idp#1013](janus-idp#1013)) ([9229a30](janus-idp@9229a30))
* add the NPM token for the `npm publish` of `dist-dynamic` packages ([janus-idp#1008](janus-idp#1008)) ([16b1305](janus-idp@16b1305))
* also publish the `dist-dynamic` packages ([janus-idp#1006](janus-idp#1006)) ([ac8d517](janus-idp@ac8d517))
* **app-config:** invalid app-config.yaml ([janus-idp#1075](janus-idp#1075)) ([295329e](janus-idp@295329e)), closes [/github.com/janus-idp/backstage-showcase/blob/main/app-config.yaml#L139](https://github.com/janus-idp//github.com/janus-idp/backstage-showcase/blob/main/app-config.yaml/issues/L139)
* attempt to force a bump of backend plugins ([janus-idp#1007](janus-idp#1007)) ([7a37225](janus-idp@7a37225))
* **ci:** auth for the `dist-dynamic` `npm publish` ([janus-idp#1010](janus-idp#1010)) ([37ddc47](janus-idp@37ddc47))
* **ci:** auth for the `dist-dynamic` npm publish ([janus-idp#1009](janus-idp#1009)) ([9a9237a](janus-idp@9a9237a))
* **ci:** remove scripts before `npm publish` in `dist-dynamic` ([janus-idp#1011](janus-idp#1011)) ([86aabe3](janus-idp@86aabe3))
* **keycloak:** fix [janus-idp#591](janus-idp#591): Cleanup some small code smells in Keycloak plugin ([janus-idp#1022](janus-idp#1022)) ([74cb7b1](janus-idp@74cb7b1))
* **kiali:** update login url ([janus-idp#1097](janus-idp#1097)) ([10c7128](janus-idp@10c7128))
* **notifications:** a few fixes when adding the pkgs to the show-case ([janus-idp#1077](janus-idp#1077)) ([75c4dc5](janus-idp@75c4dc5))
* **notifications:** create DB upon startup ([janus-idp#1096](janus-idp#1096)) ([10ff235](janus-idp@10ff235))
* **notifications:** include openapi spec at build-time ([janus-idp#1091](janus-idp#1091)) ([4e656aa](janus-idp@4e656aa))
* **notifications:** update readme ([janus-idp#1085](janus-idp#1085)) ([17dc336](janus-idp@17dc336))
* **notifications:** use @janus-idp/plugin-notifications prefix for NPM ([janus-idp#1072](janus-idp#1072)) ([ea5199b](janus-idp@ea5199b))
* **notifications:** use baseUrl from configuration ([janus-idp#1092](janus-idp#1092)) ([eed63a9](janus-idp@eed63a9))
* **openshift-image-registry:** fix [janus-idp#596](janus-idp#596): Add mock data for test page and cleanup some small code smells ([janus-idp#1024](janus-idp#1024)) ([39f7351](janus-idp@39f7351))
* **orchestrator:** regenerate `orchestrator-backend/dist-dynamic/package.json` ([janus-idp#1083](janus-idp#1083)) ([8a8051c](janus-idp@8a8051c))
* **orchestrator:** update the navigation bar icon according to UX ([janus-idp#1078](janus-idp#1078)) ([da3d8fc](janus-idp@da3d8fc))
* **quay:** fix infinite progress bar when scan is unsupported ([janus-idp#1031](janus-idp#1031)) ([2c050db](janus-idp@2c050db))
* **quay:** fix sorting and ordering of vulneribilities based on severity ([janus-idp#1033](janus-idp#1033)) ([d3fdcdf](janus-idp@d3fdcdf))
* **rbac:** disable edit when the user is unauthorized to read the catalog-entity ([janus-idp#1049](janus-idp#1049)) ([c4f2969](janus-idp@c4f2969))
* **rbac:** fix role validation ([janus-idp#1020](janus-idp#1020)) ([49c7975](janus-idp@49c7975))
* **rbac:** update the rbac ui readme ([janus-idp#1079](janus-idp#1079)) ([145e95b](janus-idp@145e95b))
* **regex-actions:** fix [janus-idp#594](janus-idp#594): Cleanup some small code smells ([janus-idp#1039](janus-idp#1039)) ([215e49c](janus-idp@215e49c))
* **servicenow:** make sure that the correct openapi generator is executed ([janus-idp#1066](janus-idp#1066)) ([6eda572](janus-idp@6eda572))
* **web-terminal:** fix [janus-idp#598](janus-idp#598): Cleanup some small code smells in the web-terminal plugin ([janus-idp#1023](janus-idp#1023)) ([3d2bafb](janus-idp@3d2bafb))

* **rbac:** add documentation for api and known permissions ([janus-idp#1000](janus-idp#1000)) ([8f8133f](janus-idp@8f8133f))

* **kiali:** add context, remove kiali-common and refactor backend ([janus-idp#855](janus-idp#855)) ([54c7001](janus-idp@54c7001))
* **web-terminal:** remove TerminalComponent test race condition issue ([janus-idp#1071](janus-idp#1071)) ([05ee8dc](janus-idp@05ee8dc)), closes [janus-idp#1070](janus-idp#1070)
  • Loading branch information
semantic-release-bot authored and aljesusg committed Jan 22, 2024
1 parent 5b882da commit fb79af2
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 2 deletions.
163 changes: 163 additions & 0 deletions plugins/kiali-backend/src/clients/fetch.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import { AxiosError } from 'axios';
import { createLogger, transports } from 'winston';

import { AuthStrategy } from './Auth';
import { KialiFetcher } from './fetch';

const logger = createLogger({
transports: [new transports.Console({ silent: true })],
});

describe('kiali Fetch', () => {
describe('Kiali configuration validation', () => {
describe(`${AuthStrategy.anonymous} strategy`, () => {
it('should get a true', async () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['validateConfiguration']({
strategy: AuthStrategy.anonymous,
sessionInfo: {},
});

expect(result.verify).toBeTruthy();
expect(result.message).toBeUndefined();
expect(result.missingAttributes).toBeUndefined();
expect(result.helper).toBeUndefined();
});
});
describe(`${AuthStrategy.token} strategy`, () => {
it('should get a false when `serviceAccountToken` is missed', async () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['validateConfiguration']({
strategy: AuthStrategy.token,
sessionInfo: {},
});

expect(result.verify).toBeFalsy();
expect(result.message).toBeDefined();
expect(result.message).toStrictEqual(
"Attribute 'serviceAccountToken' is not in the backstage configuration",
);
expect(result.missingAttributes).toBeDefined();
expect(result.missingAttributes[0]).toStrictEqual(
'serviceAccountToken',
);
});

it('should get a true when `serviceAccountToken` is set', async () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000', serviceAccountToken: '<token>' },
logger,
);
const result = kialiFetch['validateConfiguration']({
strategy: AuthStrategy.token,
sessionInfo: {},
});

expect(result.verify).toBeTruthy();
expect(result.message).toBeUndefined();
expect(result.missingAttributes).toBeUndefined();
expect(result.helper).toBeUndefined();
});
});

describe(`Not ${AuthStrategy.openid} strategy supported`, () => {
it('should get a true', async () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['validateConfiguration']({
strategy: AuthStrategy.openid,
sessionInfo: {},
});

expect(result.verify).toBeFalsy();
expect(result.message).toBeDefined();
expect(result.message).toStrictEqual(
`Strategy ${AuthStrategy.openid} is not supported in Kiali backstage plugin yet`,
);
});
});
});

describe('Read Ca files', () => {
describe('bufferFromFileOrString', () => {
it('No file or data passed', () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['bufferFromFileOrString']();

expect(result).toBeNull();
});

it('Read from file', () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['bufferFromFileOrString'](
'./__fixtures__/ca_example.pem',
);

expect(result).toBeDefined();
expect(result).toBeInstanceOf(Buffer);
});

it('Read from data', () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const result = kialiFetch['bufferFromFileOrString'](
undefined,
'./__fixtures__/ca_example.pem',
);

expect(result).toBeDefined();
expect(result).toBeInstanceOf(Buffer);
});
});
});

describe('Handle Unsuccessful Response', () => {
it('Respond with a readable message with endpoint', () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const message = 'Error server message';
const code = '404';
const endpoint = '/api/status';
const axiosError = new AxiosError(message, code);
const result = kialiFetch['handleUnsuccessfulResponse'](
axiosError,
endpoint,
);

expect(result).toStrictEqual(
`[${code}] Fetching when fetching "${endpoint}" in "Kiali"; body=[${message}]`,
);
});

it('Respond with a readable message without endpoint', () => {
const kialiFetch = new KialiFetcher(
{ url: 'https://localhost:4000' },
logger,
);
const message = 'Error server message';
const code = '404';
const axiosError = new AxiosError(message, code);
const result = kialiFetch['handleUnsuccessfulResponse'](axiosError);

expect(result).toStrictEqual(`[${code}] Fetching body=[${message}]`);
});
});
});
198 changes: 198 additions & 0 deletions plugins/kiali-backend/src/service/router.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
import { ConfigReader } from '@backstage/config';

import express from 'express';
import { setupServer } from 'msw/node';
import request from 'supertest';
import { createLogger, transports } from 'winston';

import { handlers } from '../../__fixtures__/handlers';
import { createRouter } from './router';

const server = setupServer(...handlers);

beforeAll(() =>
server.listen({
/*
* This is required so that msw doesn't throw
* warnings when the express app is requesting an endpoint
*/
onUnhandledRequest: 'bypass',
}),
);
afterEach(() => server.restoreHandlers());
afterAll(() => server.close());

const logger = createLogger({
transports: [new transports.Console({ silent: true })],
});

describe('createRouter', () => {
let app: express.Express;

beforeAll(async () => {
jest.resetAllMocks();
const router = await createRouter({
logger: logger,
config: new ConfigReader({
catalog: {
providers: {
kiali: {
url: 'https://localhost:4000',
serviceAccountToken: '<token>',
},
},
},
}),
});
app = express().use(router);
});

describe('POST /status', () => {
it('should get the kiali status', async () => {
const result = await request(app).post('/status');
expect(result.status).toBe(200);
expect(result.body).toEqual({
status: {
'Kiali commit hash': '72a2496cb4ed1545457a68e34fe3e81409b1611d',
'Kiali container version': 'v1.71.0-SNAPSHOT',
'Kiali state': 'running',
'Kiali version': 'v1.71.0-SNAPSHOT',
'Mesh name': 'Istio',
'Mesh version': '1.17.1',
},
externalServices: [
{
name: 'Istio',
version: '1.17.1',
},
{
name: 'Prometheus',
version: '2.34.0',
},
{
name: 'Kubernetes',
version: 'v1.26.3+b404935',
},
{
name: 'Grafana',
},
{
name: 'Jaeger',
},
],
warningMessages: [],
istioEnvironment: {
isMaistra: false,
istioAPIEnabled: true,
},
});
});
});

describe('POST /proxy', () => {
it('should get namespaces', async () => {
const result = await request(app)
.post('/proxy')
.send('{"endpoint":"api/namespaces"}')
.set('Content-Type', 'application/json')
.set('Accept', 'application/json');
expect(result.status).toBe(200);
expect(result.body).toEqual([
{
name: 'bookinfo',
cluster: 'Kubernetes',
isAmbient: false,
labels: {
'istio-injection': 'enabled',
'kubernetes.io/metadata.name': 'bookinfo',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/audit-version': 'v1.24',
'pod-security.kubernetes.io/warn': 'privileged',
'pod-security.kubernetes.io/warn-version': 'v1.24',
},
annotations: {
'openshift.io/description': '',
'openshift.io/display-name': '',
'openshift.io/requester': 'kubeadmin',
'openshift.io/sa.scc.mcs': 's0:c26,c15',
'openshift.io/sa.scc.supplemental-groups': '1000680000/10000',
'openshift.io/sa.scc.uid-range': '1000680000/10000',
},
},
{
name: 'default',
cluster: 'Kubernetes',
isAmbient: false,
labels: {
'kubernetes.io/metadata.name': 'default',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/enforce': 'privileged',
'pod-security.kubernetes.io/warn': 'privileged',
},
annotations: {
'openshift.io/sa.scc.mcs': 's0:c1,c0',
'openshift.io/sa.scc.supplemental-groups': '1000000000/10000',
'openshift.io/sa.scc.uid-range': '1000000000/10000',
},
},
{
name: 'hostpath-provisioner',
cluster: 'Kubernetes',
isAmbient: false,
labels: {
'kubernetes.io/metadata.name': 'hostpath-provisioner',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/audit-version': 'v1.24',
'pod-security.kubernetes.io/warn': 'privileged',
'pod-security.kubernetes.io/warn-version': 'v1.24',
},
annotations: {
'kubectl.kubernetes.io/last-applied-configuration':
'{"apiVersion":"v1","kind":"Namespace","metadata":{"annotations":{},"name":"hostpath-provisioner"}}\n',
'openshift.io/sa.scc.mcs': 's0:c26,c0',
'openshift.io/sa.scc.supplemental-groups': '1000650000/10000',
'openshift.io/sa.scc.uid-range': '1000650000/10000',
},
},
{
name: 'istio-system',
cluster: 'Kubernetes',
isAmbient: false,
labels: {
'kubernetes.io/metadata.name': 'istio-system',
'pod-security.kubernetes.io/audit': 'privileged',
'pod-security.kubernetes.io/audit-version': 'v1.24',
'pod-security.kubernetes.io/warn': 'privileged',
'pod-security.kubernetes.io/warn-version': 'v1.24',
'topology.istio.io/network': '',
},
annotations: {
'openshift.io/description': '',
'openshift.io/display-name': '',
'openshift.io/requester': 'kubeadmin',
'openshift.io/sa.scc.mcs': 's0:c26,c5',
'openshift.io/sa.scc.supplemental-groups': '1000660000/10000',
'openshift.io/sa.scc.uid-range': '1000660000/10000',
},
},
{
name: 'kiali',
cluster: 'Kubernetes',
isAmbient: false,
labels: {
'kubernetes.io/metadata.name': 'kiali',
'pod-security.kubernetes.io/audit': 'restricted',
'pod-security.kubernetes.io/audit-version': 'v1.24',
'pod-security.kubernetes.io/warn': 'restricted',
'pod-security.kubernetes.io/warn-version': 'v1.24',
},
annotations: {
'openshift.io/sa.scc.mcs': 's0:c26,c20',
'openshift.io/sa.scc.supplemental-groups': '1000690000/10000',
'openshift.io/sa.scc.uid-range': '1000690000/10000',
},
},
]);
});
});
});
7 changes: 7 additions & 0 deletions plugins/ocm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## @janus-idp/backstage-plugin-ocm [3.6.0](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/[email protected]...@janus-idp/[email protected]) (2024-01-22)


### Features

* **ocm:** add sorting to the ocm ClusterStatusPage table ([#1052](https://github.com/janus-idp/backstage-plugins/issues/1052)) ([8203aaf](https://github.com/janus-idp/backstage-plugins/commit/8203aafb4d83c667e87b736e6e2df09e6a60d6ee))

## @janus-idp/backstage-plugin-ocm [3.5.9](https://github.com/janus-idp/backstage-plugins/compare/@janus-idp/[email protected]...@janus-idp/[email protected]) (2023-12-07)


Expand Down
4 changes: 2 additions & 2 deletions plugins/ocm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@janus-idp/backstage-plugin-ocm",
"version": "3.5.9",
"version": "3.6.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down Expand Up @@ -51,7 +51,7 @@
"@backstage/dev-utils": "1.0.22",
"@backstage/plugin-catalog": "1.14.0",
"@backstage/test-utils": "1.4.4",
"@janus-idp/cli": "1.4.7",
"@janus-idp/cli": "1.5.0",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "12.1.5",
"@testing-library/user-event": "14.5.1",
Expand Down

0 comments on commit fb79af2

Please sign in to comment.