watcher api validation using json
Cureently watcher uses different methods to validate api, which causes many bugs and few operations are possible which should not be allowed like a cloud admin can delete "ongoing" actionplan and audit. To have more cleaner and same approach for all operations we should have a unified way of validating the api, which can be done using JSON.
Blueprint information
- Status:
- Complete
- Approver:
- Alexander Chadin
- Priority:
- High
- Drafter:
- aditi sharma
- Direction:
- Approved
- Assignee:
- Alexander Chadin
- Definition:
- Approved
- Series goal:
- Accepted for rocky
- Implementation:
- Implemented
- Milestone target:
- stein-1
- Started by
- Alexander Chadin
- Completed by
- Alexander Chadin
Related branches
Related bugs
Sprints
Whiteboard
I found that there is no api validation for some basic things at all things like sorting strategies, audits, etc. For example, every sort_key string could pass through all functions till db backend and no checks is applied.
It would be preferable to have some base class or utils' function for these checks in unified way for all filter and sort actions. For example, for AuditTemplatesC
I think it would be a good idea not to hardcode these fields in functions but add it to AuditTemplate class as an "additional fields" list. From this point we could add an unified validate method that do its checks with "allowed fields" made from combination of fields and "additional fields" in abstraction from specific _get_*_collection function as it done within validate_
The idea is that it's not needed from end user point of view to do customization of lists of acceptable sort keys and filters. User expects that he could sort and filter results of CLI list functions by all fields he could see in CLI. So, I assume these functionality could be made without JSON specs and in-code only.
Gerrit topic: https:/
Addressed by: https:/
Watcher api validation using json
Addressed by: https:/
[WIP] API-Validation: Base schema framework
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Add API microversions
Addressed by: https:/
[WiP] API Validation