keycloak-angular icon indicating copy to clipboard operation
keycloak-angular copied to clipboard

Allow Regex for `bearerExcludedUrls`

Open c00 opened this issue 4 years ago • 4 comments

I would like to be able to input a regex in the bearer excluded urls property. I can see that in the code it's turned into a regex with new Regexp(excludedUrl, 'i') anyway, so the only stopping me is the typescript definition.

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search for issues before submitting
- [x] feature request

Versions.

Angular12, Keycloak angular 8.3.0

Repro steps.

Try this setup:

return this.keycloak.init({
      config: {
        ...
      },
      initOptions: {
        ...
      },
      bearerExcludedUrls: [
        'some-domain.com', //Currently allowed
        /https:\/\/([\w\d-]+)\.some-other-domain\.com/, //Currently not allowed
      ],

The log given by the failure.

Typescript complains that regex is not assignable to string.

Desired functionality.

For the typescript definition to be adjusted to allow regexes here.

c00 avatar Sep 30 '21 06:09 c00

This sounds like a nice feature that I would like to see as well. I am currently swamped with other work so I cannot justify picking this up, but if someone felt like implementing it I would be more than willing to review the work.

jonkoops avatar Sep 30 '21 09:09 jonkoops

Please note that there's also a ticket that should change the behavior to an allowList: #121

Waterstraal avatar Jan 18 '22 07:01 Waterstraal