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
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: [.*])