thefrontside / playhouse

Frontside's Backstage Portal
https://backstage.frontside.services/
25 stars 13 forks source link

fix(humanitec): failing connections with authenticated api requests #373

Closed johanneswuerbach closed 10 months ago

johanneswuerbach commented 10 months ago

Motivation

The Humanitec Plugin doesn't include the Authentication header when enabling authenticated API requests https://github.com/backstage/backstage/blob/master/contrib/docs/tutorials/authenticate-api-requests.md

Approach

Include the token as header for event requests. Sadly the default EventSource doesn't support headers, hence we need to switch to https://github.com/Yaffle/EventSource.

A similar approach was taken in backstage core https://github.com/backstage/backstage/blob/86baccb2d7d378baed74eaebf017c60b410986e5/plugins/scaffolder/src/api.ts#L248-L253

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: c161cc42177bdf50187e93a4f397a8f0ef91a570

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | --------------------------------------------- | ----- | | @frontside/backstage-plugin-humanitec-backend | Patch | | @frontside/backstage-plugin-humanitec-common | Patch | | @frontside/backstage-plugin-humanitec | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

taras commented 10 months ago

@johanneswuerbach do you want me to merge it and release a new version?

johanneswuerbach commented 10 months ago

@taras that would be great. 👍

taras commented 10 months ago

Should be released now

johanneswuerbach commented 10 months ago

I don't see a new release on npm yet https://www.npmjs.com/package/@frontside/backstage-plugin-humanitec, I saw there were some compile errors in main 🤔

npm
@frontside/backstage-plugin-humanitec
`@frontside/backstage-plugin-humanitec` is a plugin for the Backstage frontend app. It shows information about environments, workloads and resources on an entity page.. Latest version: 0.3.12, last published: a month ago. Start using @frontside/backstage-plugin-humanitec in your project by running `npm i @frontside/backstage-plugin-humanitec`. There are no other projects in the npm registry using @frontside/backstage-plugin-humanitec.