[pmg-devel] [RFC PATCH pmg-api 2/2] api: proxy user bl/wl calls to master
Stoiko Ivanov
s.ivanov at proxmox.com
Thu Feb 22 16:00:01 CET 2024
On Thu, 15 Feb 2024 12:58:59 +0100
Dominik Csapak <d.csapak at proxmox.com> wrote:
> if we don't do that, the non-master nodes would get updated (when logged
> in there), but that change would never be synced back to the master.
forgot to mention - this is not the case - the change from the nodes do
get synced back to master (had the opportunity to look through our
cluster-sync code again)
still - proxying to master for something relevant to the rulesystem (the
userprefs), and thus also not getting updated too oftern (it needs
user-input) seems like a sensible way forward!
>
> So to prevent diverging configs, proxy them all to master.
>
> The GET calls are also proxied, because if we don't do that, the user
> might wonder why his change is not visible on the GUI right away.
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> Sending only as RFC, because we now loose the ability to see what the
> non-master nodes actually have in their db...
>
> src/PMG/API2/Quarantine.pm | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/PMG/API2/Quarantine.pm b/src/PMG/API2/Quarantine.pm
> index a100e11..4eec64e 100644
> --- a/src/PMG/API2/Quarantine.pm
> +++ b/src/PMG/API2/Quarantine.pm
> @@ -229,6 +229,7 @@ __PACKAGE__->register_method ({
> name => 'whitelist',
> path => 'whitelist',
> method => 'GET',
> + proxyto => 'master',
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> description => "Show user whitelist.",
> parameters => {
> @@ -258,6 +259,7 @@ __PACKAGE__->register_method ({
> name => 'whitelist_add',
> path => 'whitelist',
> method => 'POST',
> + proxyto => 'master',
> description => "Add user whitelist entries.",
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> protected => 1,
> @@ -284,6 +286,7 @@ __PACKAGE__->register_method ({
> name => 'whitelist_delete_base',
> path => 'whitelist',
> method => 'DELETE',
> + proxyto => 'master',
> description => "Delete user whitelist entries.",
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> protected => 1,
> @@ -311,6 +314,7 @@ __PACKAGE__->register_method ({
> name => 'blacklist',
> path => 'blacklist',
> method => 'GET',
> + proxyto => 'master',
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> description => "Show user blacklist.",
> parameters => {
> @@ -340,6 +344,7 @@ __PACKAGE__->register_method ({
> name => 'blacklist_add',
> path => 'blacklist',
> method => 'POST',
> + proxyto => 'master',
> description => "Add user blacklist entries.",
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> protected => 1,
> @@ -366,6 +371,7 @@ __PACKAGE__->register_method ({
> name => 'blacklist_delete_base',
> path => 'blacklist',
> method => 'DELETE',
> + proxyto => 'master',
> description => "Delete user blacklist entries.",
> permissions => { check => [ 'admin', 'qmanager', 'audit', 'quser'] },
> protected => 1,
More information about the pmg-devel
mailing list