Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechszocs committed Feb 28, 2024
1 parent 5853bc4 commit bc0dd41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
23 changes: 6 additions & 17 deletions frontend/packages/console-dynamic-plugin-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,26 +273,15 @@ Plugins may also include other assets, such as JSON localization files that foll

## Serving plugin assets

Dynamic plugins are deployed on a cluster via OLM operators. Each plugin deployment should include a web
Dynamic plugins are deployed as workloads on the cluster. Each plugin deployment should include a web
server that hosts the [generated assets](#generated-assets) of the given plugin.

**Important!** Make sure to configure your plugin web server to use MIME type `text/javascript` for all
JS assets to avoid any issues with the `X-Content-Type-Options: nosniff` security header used by Console
when fetching plugin assets via Bridge URL `/api/plugins/<plugin-name>`.
Console Bridge server adds `X-Content-Type-Options: nosniff` HTTP response header to all plugin asset
requests for added security. Web browsers that comply with this security header will block `<script>`
initiated requests when the MIME type of requested asset is not valid.

Requests for JS assets not served with the correct MIME type can be blocked by the browser, breaking your
plugin's functionality.

### Caching

The following table lists important plugin assets that must NOT be cached by the plugin web server.

| Asset | Notes |
| ---------------------- | -------------------------------------------------------------- |
| `plugin-manifest.json` | |
| `plugin-entry.js` | Applies only to Console plugin SDK versions 0.0.x |

We generally recommend disabling caching of any JSON resources hosted by the plugin web server.
**Important!** Make sure to provide valid JavaScript MIME type via the `Content-Type` response header
for all assets served by your plugin web server.

## Plugin development

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { Button } from '@patternfly/react-core';

## Console 4.15

All plugins that target OpenShift Console 4.15 should upgrade to PatternFly 5.x to take advantage
of [PatternFly dynamic modules][console-pf-dynamic-modules].
Plugins that only target OpenShift Console 4.15 and newer should upgrade to PatternFly 5.x to take
advantage of [PatternFly dynamic modules][console-pf-dynamic-modules].

Any PatternFly related code should be imported via the corresponding package index:

Expand Down

0 comments on commit bc0dd41

Please sign in to comment.