Files
openobserve/src/handler
Subhra264 89a2959869 fix: role and group names should be formatted using regex (#7224)
### **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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </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>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>fga.rs</strong><dd><code>Apply standardized formatting
in handlers</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</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>&nbsp;
</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>
2025-06-18 16:02:52 +05:30
..