Commit 9cbffbf
fix(rbac): resolve SSO role assignment FK constraint violation on granted_by='sso_system' (#3502)
* fix(rbac): resolve SSO role assignment FK constraint violation on granted_by='sso_system' (#3484)
Add grant_source column to UserRole to track role assignment provenance
(e.g. 'sso', 'manual', 'bootstrap') separately from the granted_by FK.
SSO role sync now uses granted_by=user_email (satisfying the FK to
email_users) with grant_source='sso' to distinguish SSO-granted roles
for revocation logic.
Closes #3484
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
* fix(sso): rewrite Keycloak issuer URL to public_base_url for id_token verification
Keycloak discovery fetches OIDC metadata via the internal base_url
(e.g. http://keycloak:8080), but tokens issued through the browser flow
contain the public-facing issuer (e.g. http://localhost:8180). The
authorization_url was already rewritten to public_base_url but the
issuer was not, causing id_token verification to fail with
"Invalid issuer".
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
* docs: update CHANGELOG and Keycloak tutorial for SSO fixes
Add grant_source provenance tracking and both SSO fixes to RC2
CHANGELOG. Update Keycloak tutorial with split-URL issuer
troubleshooting and SSO_KEYCLOAK_PUBLIC_BASE_URL description.
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
* fix(rbac): expose grant_source in UserRoleResponse API schema
Add grant_source field to UserRoleResponse so /rbac/my/roles and
other role endpoints return the provenance of each assignment.
Update Entra ID tutorial example to match the full response shape.
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
---------
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: Yosief Eyob <yosiefogbazion@gmail.com>1 parent fd02ac2 commit 9cbffbf
File tree
15 files changed
+173
-27
lines changed- docs/docs
- architecture/adr
- manage
- mcpgateway
- alembic/versions
- services
- utils
- tests/unit/mcpgateway
- services
- utils
15 files changed
+173
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
183 | 188 | | |
184 | 189 | | |
185 | 190 | | |
| |||
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
| 218 | + | |
| 219 | + | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
263 | | - | |
| 262 | + | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
826 | 837 | | |
827 | 838 | | |
828 | 839 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
| 604 | + | |
605 | 605 | | |
606 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
607 | 610 | | |
608 | 611 | | |
609 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
610 | 618 | | |
611 | 619 | | |
612 | 620 | | |
| |||
643 | 651 | | |
644 | 652 | | |
645 | 653 | | |
646 | | - | |
| 654 | + | |
647 | 655 | | |
648 | 656 | | |
649 | 657 | | |
| |||
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| 981 | + | |
981 | 982 | | |
982 | 983 | | |
983 | 984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6701 | 6701 | | |
6702 | 6702 | | |
6703 | 6703 | | |
| 6704 | + | |
6704 | 6705 | | |
6705 | 6706 | | |
6706 | 6707 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
| |||
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| 541 | + | |
539 | 542 | | |
540 | 543 | | |
541 | 544 | | |
| |||
619 | 622 | | |
620 | 623 | | |
621 | 624 | | |
622 | | - | |
| 625 | + | |
623 | 626 | | |
624 | 627 | | |
625 | 628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | | - | |
| 1896 | + | |
1897 | 1897 | | |
1898 | | - | |
| 1898 | + | |
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
| |||
1921 | 1921 | | |
1922 | 1922 | | |
1923 | 1923 | | |
1924 | | - | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
1925 | 1927 | | |
1926 | 1928 | | |
1927 | 1929 | | |
| |||
0 commit comments