backstage / community-plugins

Community plugins for Backstage
Apache License 2.0
159 stars 197 forks source link

🐛 ilert: Use authenticated request towards proxy backend #424

Closed Rugvip closed 6 months ago

Rugvip commented 6 months ago

Plugin Name

ilert

📜 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/ilert/plugins/ilert/src/api/client.ts#L95

👟 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 6 months ago

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