backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
141 stars 143 forks source link

🐛 codescene: Use authenticated request towards proxy backend #426

Closed Rugvip closed 4 months ago

Rugvip commented 4 months ago

Plugin Name

codescene

📜 Description

There's an incoming change to the @backstage/plugin-proxy-backend to require all requests to be authenticated by default. This means that plugins that rely on the proxy backend now need to start passing a Backstage user token in their requests.

👍 Expected behavior

The FetchApi should be used to make the request, for example like this: https://github.com/backstage/community-plugins/blob/a25418c4f52b759f78a1e4256b28f891e673f334/workspaces/puppetdb/plugins/puppetdb/src/api/PuppetDbClient.ts#L44-L56

👎 Actual Behavior with Screenshots

Plain fetch API is used without credentials: https://github.com/backstage/community-plugins/blob/a25418c4f52b759f78a1e4256b28f891e673f334/workspaces/codescene/plugins/codescene/src/api/api.ts#L65

👟 Reproduction steps

Inspect the request to the proxy plugin in the network tab, If working correctly there should be an Authorization header present.

📃 Provide the context for the Bug.

Incoming change through https://github.com/backstage/backstage/pull/24643

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, I don't have time to work on this right now

freben commented 4 months ago

Example implementation PR for inspiration: https://github.com/backstage/community-plugins/pull/427