Admin UI integration

Initial Version for Admin UI team to review

As Admin user I should be enabled to manage the dynamic policies via Admin UI. "Manage" means main CRUD actions in addition to Policy Evaluation. The UI does not need to be complicated and should be based on spec defined here. There is a Postman Collection here which can be used for testing purposes.

Summary of Actions required:

Create/Update a/an New/Existing Policy

Expected UI:

image

API endpoint PUT: {{osdu_environment_url}}/api/policy/v1/policies/{id} where id can be for example equal to esanctions

Sample payload:

package esanctions

sanctions:= {
    "US":{"IR", "KP", "SY", "SD", "CU", "VE", "RU"},
    "EU":{"IR", "KP", "SY", "SD", "CU", "VE", "RU"}
    }

default allow = false

allow = true {
	relevantCountries := {x | x := input.record.legal.otherRelevantDataCountries[_]}
	count(relevantCountries - sanctions.US) == count(relevantCountries)
    count(relevantCountries - sanctions.EU) == count(relevantCountries) 
}

Body type: Text

List Existing Policies

Expected UI:

image

API endpoint GET: {{osdu_environment_url}}/api/policy/v1/policies

Edit Button: Will redirect user to Create/Update a/an New/Existing Policy section and will prepopulate the input controls with selected Policy Id and Value through calling the {{osdu_environment_url}}/api/policy/v1/policies/{id} endpoint which is a GET method.

Delete Button: Should prompt for confirmation and after that by calling {{osdu_environment_url}}/api/policy/v1/policies/{id} which is a DELETE method.

Evaluate Button: Will take user to the next window Evaluate a Policy with Policy Id prepopulated.

Evaluate a Policy

Expected UI:

image

API endpoint POST: {{osdu_environment_url}}/api/policy/v1/evaluations/query/{id}

Evaluate Button: Policy Id is prepopulated from previous screen. User can input value in JSON format(see example here) in the text area and by clicking this button the results of evaluation should be displayed to user in a standard format.

NOTES:

  • data-partition-id and Authorization are always in the header.
  • Images are not prescriptive and standard UI and UX pattern of platform should be enforced.
Edited by Mohammad Malekmakan