‘policies’

/api/v1/{obj_type:(users|endpoints)}/{object_id}/effective_policy

/api/v1/{obj_type:(users|endpoints)}/{object_id}/effective_policy*component_id_policy_name

Read object policies. Requires logged_session_id.

No writes. Setting policies is the task of admin UI.

Policies are defined for component. “Component policies” is dictionary of values. Value is any json-serializable object, maybe nested dict:

{ "component_id": { "policy1": value, "policy2": value } }

Service returns effective policies. Effective is default component policies overridden by object-specific policies.

GET

Read effective policies of all components defined for endpoint 456:

GET /api/v1/endpoints/456/effective_policy

Read effective policies of user 123 (same for endpoint):

GET /api/v1/users/123/effective_policy                       # All Policies of all components
GET /api/v1/users/123/effective_policy/component1            # All policies of component1
GET /api/v1/users/123/effective_policy/component1/max_count  # Policy "max_count" of component1

Returns:

{ 'policy':
    {
        'component1':
        {
            'policy1': False,
            'policy2': {'sub': 'dict', 'is': 'possible'},
            'retry': [1, 20, 600]
        },
        'component2':
        {
            'policy1': 'the answer',
            'max_count': 42
        }
    }
}

If you ask for specific policy, you get, for example:

{ 'policy': { 'component2': { 'max_count': 42 } } }