systopia / CiviProxy

A security proxy for CiviCRM
GNU Affero General Public License v3.0
7 stars 18 forks source link

When whitelisting for specific IP addresses a long list might be needed #15

Open ErikHommel opened 7 years ago

artfulrobot commented 6 years ago

(Just starting to look at this project for first time, please excuse if I've misunderstood anything)

Would this be acceptable though?

$preset_1 = [ 'contact' => [ 'getsingle' => [ ... ] ], ... ];
$rest_allowed_actions => [
    '1.2.3.4' => $preset_1, 
    '2.3.4.5' => $preset_1,
    '3.4.5.6' => [ 'otherEntity' => [ 'someaction' => ... ] ] + $preset_1,
];

Although I think it would be better to reference the function that inspects this array in a variable so that it can be overridden easily if someone has particular requirements that might be more efficiently described without this array format. i.e. move to a container/service provider model for the thing that determines whether the (rest) request is allowed?