Commit 218c64d
Normalize dashes in JWT permissions/scopes (#184)
### Changes
When converting permissions/scopes to Symfony roles, apply replacement
not only for colon (`:`) character, but also for dash (`-`) character,
as some resources/permissions consist of multiple words and dash is a
recommended separator in such cases.
### Testing
- Have a permission/scope in Auth0 token that contains a dash (e.g.
`read:licence-plates`)
- Convert it to Symfony roles (by getting the roles of the JWT
authenticated user/m2m):
- before: it would return `ROLE_READ_LICENCE-PLATES`
- after: it returns `ROLE_READ_LICENCE_PLATES`
[ ] This change adds test coverage
[ ] This change has been tested on the latest version of Symfony
### Checklist
[x] I have read the [Auth0 general contribution
guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
[x] I have read the [Auth0 Code of
Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
[x] All existing and new tests complete without errors
Co-authored-by: Evan Sims <hello@evansims.com>1 parent d4c3aac commit 218c64d
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
0 commit comments