Skip to content

Conversation

IosebKoplatadze
Copy link

This pull request enhances the dynamic federation loader by adding support for setting a nonce attribute on remote entry scripts. This improves security for applications using Content Security Policy (CSP) with nonces and ensures that remote scripts can be loaded in environments with stricter CSP rules. Additionally, the type definitions have been updated for better type safety and clarity.

Security and CSP improvements:

  • Added support for a nonce attribute in the options for loading remote entry scripts and modules, allowing the loader to set a nonce on dynamically injected <script> tags. (libs/mf-runtime/src/lib/loader/dynamic-federation.ts) [1] [2]
  • Updated the loadRemoteEntry and loadRemoteModule functions to accept and propagate the nonce option, ensuring it is passed through all relevant code paths. (libs/mf-runtime/src/lib/loader/dynamic-federation.ts) [1] [2]
  • Modified the loadRemoteScriptEntry function to set the nonce attribute on the created script element if provided. (libs/mf-runtime/src/lib/loader/dynamic-federation.ts) [1] [2]

Type safety and code clarity:

  • Improved type definitions for remoteMap to explicitly specify its structure, enhancing code safety and maintainability. (libs/mf-runtime/src/lib/loader/dynamic-federation.ts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant