Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to list down the subscription policies from the publisher portal when the subscription policy count is high #2830

Closed
AshenShalitha opened this issue Apr 15, 2024 · 1 comment

Comments

@AshenShalitha
Copy link

Description

When more than 25 subscription policies exist in the admin portal, the publisher fails to list those subscription policies through the UI.

If we check the response from the network trace we can see the endpoint is designed to fetch subscription policies in a pagination manner. However, the UI is not designed accordingly.

Steps to Reproduce

  1. Create multiple (More than 25) subscription policies using the following script. Make sure to replace the bearer token and the cookie values retrieved from the network trace.
#!/bin/bash

# Base URL and headers
url="https://localhost:9443/api/am/admin/v3/throttling/policies/subscription"
accept="application/json"
content_type="application/json"
cookie="AM_ACC_TOKEN_DEFAULT_P2=-84d6-bcc0ddf9bcd4; commonAuthId=77683048-f341-4f41-b34b-30888f1547fd; opbs=b724f6fc-b9a7-4cd5-ad08-12a25844284f"
authorization="Bearer 6a2f2986-75e9-3a75"

# Loop starts at 1 and continues indefinitely, increment the subscription count each iteration
count=1
while true; do
  # JSON data with dynamic policyName
  json_data="{\"policyName\":\"Subscription$count\",\"description\":\"\",\"defaultLimit\":{\"type\":\"REQUESTCOUNTLIMIT\",\"requestCount\":{\"requestCount\":\"1\",\"timeUnit\":\"min\",\"unitTime\":\"1\"}},\"subscriberCount\":0,\"rateLimitCount\":0,\"rateLimitTimeUnit\":\"sec\",\"billingPlan\":\"FREE\",\"stopOnQuotaReach\":true,\"customAttributes\":[],\"graphQLMaxComplexity\":0,\"graphQLMaxDepth\":0,\"monetization\":{\"monetizationPlan\":\"FIXEDRATE\",\"properties\":{\"fixedPrice\":\"\",\"pricePerRequest\":\"\",\"currencyType\":\"\",\"billingCycle\":\"week\"}},\"permissions\":null}"

  # Execute curl command
  curl -k -X POST "$url" \
    -H "Accept: $accept" \
    -H "Accept-Encoding: gzip, deflate, br, zst" \
    -H "Content-Type: $content_type" \
    -H "Cookie: $cookie" \
    -H "Authorization: $authorization" \
    -d "$json_data"

  # Increment the subscription count for next request
  ((count++))

  # Optional: delay between requests
  sleep 1  # Sleep for 1 second; adjust as needed
done
  1. Then log in to the publisher portal and open any API.
  2. Click on Portal Configurations -> Subscriptions
  3. Only 25 subscription policies will be listed in the UI (Except for the Unlimited policy).

Affected Component

APIM

Version

4.1.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

apim

@AnuGayan
Copy link

AnuGayan commented Jul 9, 2024

Fixed by wso2/apim-apps#524

@AnuGayan AnuGayan closed this as completed Jul 9, 2024
@RakhithaRR RakhithaRR added this to the APIM 4.4.0-M1 milestone Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants