mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
### **User description** Currently role names and groups names are getting lowercased when creating them (as part of the org revamp changes). This PR uses standard format_role_name function to follow a standard role and group name format. ___ ### **PR Type** Enhancement ___ ### **Description** - Introduce reusable name-formatting function - Enforce regex formatting for roles and groups - Update HTTP handlers to apply formatting - Standardize success responses for role/group ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>jwt.rs</strong><dd><code>Extract and centralize name formatting</code> </dd></summary> <hr> src/handler/http/auth/jwt.rs <li>Extract regex-based formatting into helper<br> <li> Change <code>format_role_name</code> to accept <code>&str</code><br> <li> Add public <code>format_role_name_only</code> function<br> <li> Delegate formatting to new helper function </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7224/files#diff-232cab74f4cbf135af424744272e17732fbda8ac005d33c0acb4597e65479d02">+9/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>fga.rs</strong><dd><code>Apply standardized formatting in handlers</code> </dd></summary> <hr> src/handler/http/request/authz/fga.rs <li>Import <code>format_role_name_only</code> helper<br> <li> Replace lowercase trim with regex formatting<br> <li> Update handler logic to use new helper<br> <li> Standardize response messages and payloads </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7224/files#diff-e7c99f37f3abbb5e0507d2760bbf67df010d9218704b38dce84c5477acecd22e">+15/-17</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>