-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Ticket: Refactor Legacy Registry Update Endpoints to Use Body Only
Description,
The endpoints in src/controller/org.controller that contain /registry in their path (specifically Updates/PUTs) currently rely on Query Parameters for input validation and data extraction.
This needs to be standardized to use the Request Body, consistent with the newer registry-org.controller implementation.
Affected Endpoints,
src/controller/org.controller/index.js
PUT /registry/org/:shortname(Line ~496)- Currently validates parameters like
id_quota,name,new_short_nameetc. viaquery().
- Currently validates parameters like
PUT /registry/org/:shortname/user/:username(Line ~673)- Currently validates parameters like
active,new_username,name.*,active_roles.*viaquery().
- Currently validates parameters like
PUT /registry/org/:shortname/user/:username/reset_secret(Line ~781)- (Verify if this consumes any params or just path; usually resets don't need body, but double check if strictness is applied).
Acceptance Criteria / TODOs,
1. Update Route Definitions (src/controller/org.controller/index.js)
- For
PUT /registry/org/:shortname:- Change
query(...)validators tobody(...)validators. - Update Swagger comments to show
in: 'body'(orrequestBodyschema) instead of query params.
- Change
- For
PUT /registry/org/:shortname/user/:username:- Change
query(...)validators tobody(...)validators. - Update Swagger comments to show
requestBodyschema.
- Change
2. Update Controller Logic (src/controller/org.controller/org.controller.js)
-
updateOrg(Line ~297):- Use updateFull repository function for the body parameters
- Use the current update repo function for the query parameters
-
updateUser(Line ~467):
- [ ] Use updateFull repository function for the body parameters- Use the current update repo function for the query parameters
3. Verification,
npm run test:integration
npm run test:unit-tests
Notes,
- Be careful with overlapping parameter names.
- Ensure array handling (e.g.,
active_roles) works correctly when parsed from JSON body vs Query string (Query string often requirestoArray(), Body does not).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Needs Triage
Status
In Review