Description
requestsConfigurationRules (and legacy authenticationRules) currently apply unconditionally whenever a rule's urlPattern matches. There is no way to activate/deactivate a rule depending on runtime conditions such as the current user's groups or role. This makes it hard to attach different auth headers/params to the same URL pattern depending on who is logged in (e.g. only send a Bearer token for users belonging to a specific group).
Add support for an enabled property on each rule: either a plain boolean, or a plugin expression string using the same syntax already supported for cfg.disablePluginIf (e.g. state('usergroups'), includes(...), hasAtLeastOne(...)). Rules without enabled keep applying unconditionally, so the change is backward compatible.
Acceptance criteria
Other useful information
Implemented in #12702.
Description
requestsConfigurationRules(and legacyauthenticationRules) currently apply unconditionally whenever a rule'surlPatternmatches. There is no way to activate/deactivate a rule depending on runtime conditions such as the current user's groups or role. This makes it hard to attach different auth headers/params to the same URL pattern depending on who is logged in (e.g. only send a Bearer token for users belonging to a specific group).Add support for an
enabledproperty on each rule: either a plain boolean, or a plugin expression string using the same syntax already supported forcfg.disablePluginIf(e.g.state('usergroups'),includes(...),hasAtLeastOne(...)). Rules withoutenabledkeep applying unconditionally, so the change is backward compatible.Acceptance criteria
requestsConfigurationRulescan declare anenabledproperty (boolean or expression string)enabled: falseare skippedcfg.disablePluginIf), e.g."{includes(state('usergroups'), 'editor')}"enabledkeep the current behaviour (always applied)authenticationRulesconverted viaconvertAuthenticationRulesToRequestConfigurationalso respectenabledlocal-config.mdenabledproperty,enabled: false, expression resolving to true, expression resolving to falseOther useful information
Implemented in #12702.