[Proposal] API Subscription Support For API Platform #1315
CrowleyRajapakse
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
Who are we solving the problem for?
Why should it be solved?
Use Cases
Bijira Console use case
Developer portal use case
Proposed Solution
User Flow
If this API has no Authorization enabled
If this API has Authorization enabled with an OAuth2/API Key Policy.
Implementation
DB Changes
This policy will be available in the policy hub and API developers can attach it to the API to enable subscription validation.
Option 1
Attach this policy automatically when subscription plans are getting enabled for the API.
Option 2
API developers need to manually attach the subscription validation policy to the API.
This option is only available for Self Hosted GW APIs.
Subscription Token will be generated(Opaque String) and will be visible in the API Overview UI.
Implement UI/REST CRUD/DB for Subscription Token in Platform-API+Choreo APIM(Here, we can’t reuse existing choreo-apim /subscriptions POST as it is since applicationId is a required value).
Remove applicationId required field. Only apiId will be required.
If the subscription is for a Self Hosted GW API, /subscription POST response will have a subscriptionToken otherwise for a normal API existing behaviour is preserved.
Subscription Token will be preserved in the platform-api DB and will be propagated to gateway and will be stored in gateway DB as well.
Following REST APIs will be created in Both Platform-API and Gateway Controller to persist subscriptions.
DB changes
User need to send the Subscription Token in the API request header as follows,
“Subscription-Key”: "subscription-Token"
During the API request flow,
If the API has subscription validation enabled.**
Ratelimit Key : Subscription Token
Ratelimit Count: Available Count
If the API subscription validation disabled.
Beta Was this translation helpful? Give feedback.
All reactions