Policy Resolution Response Structure

Prev Next

Following is an example of the Policy Resolution response structure:

class PolicyResolutionResponse {
    /**
     * http status code as received from policy resolution runtime
     */
    int statusCode;

    /**
     * Response body as received from policy resolution runtime
     */
    String body;

    /**
     * Response headers as received from policy resolution runtime
     */
    Map<String, String> headers = new HashMap<>();

    /**
     * Map of restrictions by table full name
     */
    Map<String, Restrictions> restrictions = new ConcurrentHashMap<>();
}

class Restrictions {
    Set<ConditionField> conditionFields;
    Set<String> allowedColumns;
    Set<String> deniedColumns;
    Map<String, Column> columns;

    /**
     * Condition in SQL-like format
     * i.e. (([[roleId]] > 0) AND ([[balance]] < 1000))
     */
    private String condition = "";
}

public class Column {
    String fullTableName;
    String name;
    String maskAs;
}

class ConditionField {
    /**
     * Name of field
     */
    String name;

    /**
     * type of field, like 'NUMERIC', 'STRING'
     */
    String type;
}