HTTP endpoint for listing policies
Expose HTTP endpoint that will return a JSON list of all policies in the MongoDB collection.
GET /v1/policies
{
"policies":[...]
}
The endpoint may support filters like:
-
/v1/policies?locked=true
- return only locked or unlocked policies -
/v1/policies?source=true
- return the source code of the policies also (could be OFF by default)
Reference
[IDM.TSA.E1.00012] Policy Admin API
The policy service may provide an HTTP API to inspect the current policy service state. For
example, get a list of all unlocked/locked policies, return a specific policy source code or some
policy meta information like last update timestamp. This could be useful while debugging the
service or for building a UI dashboard for administrators. For example, the sync from Git to Policy
Database could fail unexpectedly or even complete without errors, but there could be a bug
where policy source code in the database is different from policy source code in the Gilt repo.
Debugging such issues would be extremely difficult without having the ability to look at the
current Policy service state/data, because just looking at the external Git policy repo will not be
helpful to discover some discrepancies.
The API could start with the following functionalities but could be further expanded as necessary.
* Retrieve all/some policies from the Policy DB. Optionally specify which fields should be
returned - e.g., source code, static data, meta fields, etc.
* Retrieve policy lock/unlock state
* Retrieve static data/configurations for a given policy