@mashroom/mashroom-http-proxy-add-user-headers

2.7.1 • Public • Published

Mashroom Add User Header Http Proxy Interceptor

Plugin for Mashroom Server, a Microfrontend Integration Platform.

If you add this plugin it will add HTTP headers with user information to all proxy backend calls. By default, it adds:

  • X-USER-NAME
  • X-USER-DISPLAY-NAME
  • X-USER-EMAIL

Usage

If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-csrf-protection as dependency.

You can override the default config in your Mashroom config file like this:

{
  "plugins": {
        "Mashroom Http Proxy Add User Headers Interceptor": {
            "userNameHeader": "X-USER-NAME",
            "displayNameHeader": "X-USER-DISPLAY-NAME",
            "emailHeader": "X-USER-EMAIL",
            "extraDataHeaders": {},
            "targetUris": [".*"]
        }
    }
}
  • userNameHeader: The HTTP header for the username (Default: X-USER-NAME)
  • displayNameHeader: The HTTP header for the display name (Default: X-USER-DISPLAY-NAME)
  • emailHeader: The HTTP header for the email address (Default: X-USER-EMAIL)
  • extraDataHeaders: A mapping of user.extraData properties to headers (Default: {})
  • targetUris: A list of regular expressions that match URIs that should receive the headers (Default: [.*])

Readme

Keywords

none

Package Sidebar

Install

npm i @mashroom/mashroom-http-proxy-add-user-headers

Weekly Downloads

9

Version

2.7.1

License

MIT

Unpacked Size

7.83 kB

Total Files

5

Last publish

Collaborators

  • jkofler