Added Authentication to Tenant create, update and delete based on Super-Admin Role#77
Merged
auslin-aot merged 5 commits intoAOT-Technologies:mainfrom Mar 19, 2026
Conversation
f9e4b59 to
8dcc459
Compare
extensions/m8flow-backend/src/m8flow_backend/routes/keycloak_controller.py
Outdated
Show resolved
Hide resolved
extensions/m8flow-backend/src/m8flow_backend/routes/keycloak_controller.py
Outdated
Show resolved
Hide resolved
extensions/m8flow-backend/src/m8flow_backend/routes/keycloak_controller.py
Outdated
Show resolved
Hide resolved
8dcc459 to
c37cf00
Compare
andrepestana-aot
approved these changes
Mar 18, 2026
Collaborator
andrepestana-aot
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the changes.
abilpraju-aot
approved these changes
Mar 19, 2026
…splay names in both Keycloak and the local database.
… and deletion, introducing a new `manage-tenant-realms` permission.
1c713fa to
0118da0
Compare
|
auslin-aot
approved these changes
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


JIRA Ticket
M8F-85
M8F-99
Description
Refactor: Multi-Tenant Management and Security Hardening
This refactor centralizes tenant lifecycle management and ensures that creation, updates, and deletions are synchronized between the local PostgreSQL database and Keycloak, while enforcing strict Super Admin oversight.
🚀 Key Changes
Enhanced Security & Authorization
super-adminrole.manage-tenant-realmspermission covering/m8flow/tenant-realms*and enforced via AuthorizationService.g.userfor manual role verification.🛠️ How to Test
Postman Collection: [m8flow_tenant_management.postman_collection.json](
m8flow_tenant_management.postman_collection.json
POST /v1.0/m8flow/tenant-realms. Verify the new realm in Keycloak and the new row inm8f_tenant.PUT /v1.0/m8flow/tenants/{uuid}/namewith body{"name": "New Name"}. Verify synchronization between the DB and Keycloak.DELETE /v1.0/m8flow/tenant-realms/{slug}. Verify the realm is removed and the database record is purged.403 Forbiddenwith the custom error message.Type
Changes
Testing
Manual API testing and security verification were performed to confirm that all tenant management operations are secure, correctly synchronized, and restricted to the
super-adminrole as per organizational requirements.