Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/ns-api/files/ns.threatshield
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ def list_dns_feeds(enterprise=False):

return ret

def get_confidence(f):
def get_confidence(f, enterprise=False):
confidence = -1
if not enterprise:
return confidence
if f.endswith('lvl1') or f.endswith('level1'):
confidence = 10
elif f.endswith('lvl2') or f.endswith('level2'):
Expand Down Expand Up @@ -169,7 +171,7 @@ def list_blocklist(e_uci):
if type == 'enterprise' and not has_bl:
continue

ret.append({ 'name': f, 'type': type, 'enabled': enabled, 'confidence': get_confidence(f), 'description': feed.get('descr')})
ret.append({ 'name': f, 'type': type, 'enabled': enabled, 'confidence': get_confidence(f, type == 'enterprise'), 'description': feed.get('descr')})
return { "data": ret }

def list_settings(e_uci):
Expand Down Expand Up @@ -406,7 +408,7 @@ def dns_list_blocklist(e_uci):
if type == 'enterprise' and not has_bl:
continue

ret.append({ 'name': f, 'type': type, 'enabled': enabled, 'confidence': get_confidence(f), 'description': feed.get('focus')})
ret.append({ 'name': f, 'type': type, 'enabled': enabled, 'confidence': get_confidence(f, type == 'enterprise'), 'description': feed.get('focus')})
return { "data": ret }

def dns_edit_blocklist(e_uci, payload):
Expand Down
Loading