Skip to content

Access List show does not show Client IP address ranges #26

@Cloudineer

Description

@Cloudineer

Describe the bug
Running the command ./npm-api.sh --access-list-show 5 produces a valid output except the IP Whitelist shows No IPs whitelisted which is not correct.

To Reproduce
Steps to reproduce the behavior:

  1. Command ./npm-api.sh --access-list-show 5 - replacing 5 with the ID of any access list with Access List rules.
  2. Output should NOT be:
│ IP Whitelist
├================================================================================┤
│ No IPs whitelisted
└================================================================================┘

Expected behavior
A list of IP address ranges should be shown.

Screenshots
If applicable, add screenshots to help explain your problem.

Operating System:

  • OS: Ubuntu
  • Version Ubuntu 24.04.3 LTS

Additional context
After using chrome dev tools to check the query sent by the NPM client, the following code change fixed the issue.

$ git diff npm-api.sh
diff --git a/npm-api.sh b/npm-api.sh
index d9f714d..3e27d1d 100755
--- a/npm-api.sh
+++ b/npm-api.sh
@@ -3416,7 +3416,7 @@ access_list_show() {
     echo -e "\n📋 ${COLOR_CYAN}Access List Details${CoR}"
     
     # Get specific access list
-    local response=$(curl -s -X GET "$BASE_URL/nginx/access-lists/$id" \
+    local response=$(curl -s -X GET "$BASE_URL/nginx/access-lists/$id?expand=items%2Cclients" \
         -H "Authorization: Bearer $(cat "$TOKEN_FILE")")
 
     # Check if response is valid JSON

It seems there is a change in the API. I can submit a pull request if you prefer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions