make safe the api calls with potential for demo site damage
This commit is contained in:
@@ -324,7 +324,7 @@ sub jq_insert {
|
|||||||
$jobs = [$jobs] if ref [] ne ref $jobs;
|
$jobs = [$jobs] if ref [] ne ref $jobs;
|
||||||
|
|
||||||
# bit of a hack for heroku hosting to avoid DB overload
|
# bit of a hack for heroku hosting to avoid DB overload
|
||||||
return true if setting('defanged_admin') eq 'false_admin';
|
return true if setting('defanged_admin') ne 'admin';
|
||||||
|
|
||||||
my $happy = false;
|
my $happy = false;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ swagger_path {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
responses => { default => {} },
|
responses => { default => {} },
|
||||||
}, put '/api/v1/object/device/:ip/nodes' => require_role api_admin => sub {
|
}, put '/api/v1/object/device/:ip/nodes' => require_role setting('defanged_api_admin') => sub {
|
||||||
|
|
||||||
jq_insert([{
|
jq_insert([{
|
||||||
action => 'macsuck',
|
action => 'macsuck',
|
||||||
@@ -317,7 +317,7 @@ swagger_path {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
responses => { default => {} },
|
responses => { default => {} },
|
||||||
}, put '/api/v1/object/device/:ip/arps' => require_role api_admin => sub {
|
}, put '/api/v1/object/device/:ip/arps' => require_role setting('defanged_api_admin') => sub {
|
||||||
|
|
||||||
jq_insert([{
|
jq_insert([{
|
||||||
action => 'arpnip',
|
action => 'arpnip',
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ check_userlog: false
|
|||||||
devport_vlan_limit: 150
|
devport_vlan_limit: 150
|
||||||
login_logo: ""
|
login_logo: ""
|
||||||
defanged_admin: 'admin'
|
defanged_admin: 'admin'
|
||||||
|
defanged_api_admin: 'api_admin'
|
||||||
hide_deviceports: []
|
hide_deviceports: []
|
||||||
|
|
||||||
# -------------
|
# -------------
|
||||||
|
|||||||
Reference in New Issue
Block a user