0.0.3 • Published 1 year ago

@marcinguy/backstage-plugin-betterscan v0.0.3

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

backstage-plugin-betterscan

Betterscan Backstage Plugin

Install betterscan.io

More here:

https://github.com/marcinguy/betterscan-ce

git clone https://github.com/marcinguy/betterscan-ce.git
cd betterscan-ce/dockerhub
./start.sh

Get Bearer token with:

curl -s 'http://localhost:5000/api/v1/login' --data-raw 'email=test@ok.com&password=testtest' | jq .access_token

Update:

app-config.yaml

 '/betterscan':
    target: http://localhost:5000
    headers:
      Authorization: Bearer bbf8e8794af64a51b304caf836c542c0

Bearer should be otput from curl

You can use env var also:

app-config.yaml

 '/betterscan':
    target: http://localhost:5000
    headers:
      Authorization: Bearer ${BETTERSCAN_TOKEN}

And in shell:

export BETTERSCAN_TOKEN="bbf8e8794af64a51b304caf836c542c0"

Install plugin as a Page

http://localhost:3000/betterscan

image

or Component

http://localhost:3000/catalog/default/component/documented-component

Install the plugin into Backstage.

yarn add @marcinguy/backstage-plugin-betterscan

Import it into your Backstage application.

// packages/app/src/components/catalog/EntityPage.tsx
import { BetterscanFetchPostureComponent } from '@marcinguy/backstage-plugin-betterscan';

Add Widget API to your Backstage instance.

// packages/app/src/components/catalog/EntityPage.tsx
import { BetterscanFetchPostureComponent } from '@marcinguy/backstage-plugin-betterscan';

const OverviewContent = ({ entity }: { entity: Entity }) => (
  <Grid container spacing={3} alignItems="stretch">
    ...
    <Grid item md={8}>
      <BetterscanFetchPostureComponent />
    </Grid>
    ...
  </Grid>
);

That's it.

image