wso2 / api-manager

All issues, tasks, improvements and new features of WSO2 API Manager
Apache License 2.0
34 stars 8 forks source link

WSO2 AI Subscription Portal #3027

Open piyumaldk opened 1 month ago

piyumaldk commented 1 month ago

Description

In earlier versions of the API Manager and Identity Server releases, the product managed the AI feature's authorization through the onprem keys of Choreo.

For future versions, to correct the design flaws, a new portal has been proposed where administrative users can log in and generate keys. The plan is to deploy the portal for public access. This solution introduces a more user-friendly approach for key generation.

Affected Component

APIM

Version

4.4.0

Related Issues

No response

Suggested Labels

No response

piyumaldk commented 1 month ago

Update on the current state (2024/07/23)

Had a discussion on 2024/07/23 with APIM, IS, and AI team on how to proceed with the task.

Meeting notes:

piyumaldk commented 1 month ago

Update on the current state (2024/07/25)

Started working on the task from 24th July.

Below are the finalised APIM side requirements (After team discussion)

  1. General users can log into the subscription portal.

  2. After logging into the portal, users will be able to generate a token by providing a unique name. The name should be unique among other tokens created by the same user (e.g., "dev"). Users have a limit of 10 tokens. If a user wants to generate an 11th token, they must remove an existing token.

  3. Logged-in users can view previously generated tokens information, which include:

    • Unique name
    • Product
    • Services
    • Created date and expiry time
    • Regenerate button
    • Revoke button
    • Delete button
  4. Generated tokens will expire after 2 months (from the date of user creation) for general users, at which point users will not be able to regenerate tokens or create new ones. Paid users do not have such restrictions if we introduce paid users to the portal in the future. In that case, we have to discuss the token expiration method for those users.

  5. Once a user generates a token, the token will be visible only at that time, and the UI will inform the user to save the token somewhere safe.

  6. Users can log out and will be redirected to the login page.

  7. Generated tokens (underneath applications) should have below metadata.

    • User (For possible future use cases for paid users)
    • Unique name or client ID
    • Product
    • Services
    • Created date
    • Expiry date
  8. Portal should know if the user logged in is a free user or paid user possibly through a flag, where initial development is only for free users but we have a possibility of improving the product to handle paid users as well to give them access to regenerate tokens.

Below are the requirements cam from IS side

  1. User Login

  2. Feature Display:

    • User should be able to see all AI features of Product-IS.
    • Descriptions and usage guides for each AI feature.
  3. Subscription Management:

    • Users should be able to subscribe to each AI feature individually.
    • Option to manage or cancel subscriptions.
    • Subscription status and history tracking.
  4. Key Management:

    • User should get different keys for each AI feature.
    • User should be able to generate, regenerate, and revoke keys.
    • Keys should be securely stored and displayed.
  5. UI Display:

    • UI should show the user the following for each AI feature:
    • Key.
    • Other configuration details required for integration with Product-IS.
    • Visual indicators for active/inactive subscriptions.
    • Notifications and alerts for key expiry and subscription updates.
  6. User Profile Management:

    • User should be able to update personal information and preferences.
    • Option to view usage reports and analytics.
piyumaldk commented 1 month ago

Update on the current state (2024/07/26)

Discussed the requirements with the person from IS team and agreed on below requirements.

  1. Below are the users who will get the access for the portal.

    • General Users
    • Anybody with access to the internet can sign in to the AI Subscription portal.
    • Paid users (In the future)
  2. General users can log into the AI Subscription portal.

  3. After logging into the portal, users will be able to generate a token by providing a unique name. The name should be unique among other tokens created by the same user (e.g., "dev"). Users have a limit of 10 tokens. If a user wants to generate an 11th token, they must remove an existing token.

  4. Logged-in users can view previously generated tokens information, which include:

    • Unique name
    • Description
    • Product
    • Services
    • Created date and expiry time
    • Regenerate button
    • Revoke button
    • Delete button
  5. Generated tokens will expire after 2 months (from the date of user creation) for general users, at which point users will not be able to regenerate tokens or create new ones. Paid users do not have such restrictions if we introduce paid users to the portal in the future. In that case, we have to discuss the token expiration method for those users.

  6. Once a user generates a token, the token will be visible only at that time, and the UI will inform the user to save the token somewhere safe.

  7. Users can log out and will be redirected to the login page.

  8. Generated tokens (underneath applications) should have below metadata.

    • User (For possible future use cases for paid users)
    • Unique name or client ID
    • Product
    • Services
    • Created date
    • Expiry date
  9. Portal should know if the user logged in is a free user or paid user possibly through a flag, where initial development is only for free users but we have a possibility of improving the product to handle paid users as well to give them access to regenerate tokens.

However, we decided that we will need further discussions on below matters.

  1. How to show the generated key? (Only key or whole config)

  2. Do we give the access to generate one key for multiple products?

  3. How should we handle expired dates?

piyumaldk commented 1 month ago

I did some initial UI sketches like below.

  1. image

  2. image

  3. image

With above UI sketches, I had a discussion with another UI expert and AI expert from APIM team. After some discussions, we agreed on the final UI/UX sketch. It was later introduced to the person who is working from IS team side on this task and he also agreed on the UI/UX design.

Below is the finalised design. (Please note that we yet to have a proper design review on this)

image

piyumaldk commented 1 month ago

Update on the current state (2024/07/29)

piyumaldk commented 1 month ago

Update on the current state (2024/08/01)

piyumaldk commented 1 month ago

Update on the current state (2024/08/05)

  1. Login Page ( Asgardeo Branding )

  2. Landing Page as below image

After the review meeting, had another meeting with an APIM UI/UX expert and discussed all the above things and decided to go with decided technologies and designs.

Since the design is finalized, I have shared it in the architecture email thread [1]. (Since we did not receive any feedback via email, we are proceeding with the implementation)

[1] [Architecture][IS] Deployment Architecture for AI Features in Product-IS

piyumaldk commented 1 month ago

Update on the current state (2024/08/09)

Implemented the project with decided technologies for the last four days. For now, project is done in a personal private repo.

piyumaldk commented 1 week ago

Update on the current state (2024/09/02)

image image image image image image

Whole UI flow

image

Implemented those changes with hardcoded responses (Some data structures has been changed due to some blockers form backend side)

[1] https://drive.google.com/file/d/1tt0tQMyVC9ZHBK4NtGiv0_-F4tFQR8AN/view

piyumaldk commented 1 week ago

Update on the current state (2024/09/04)

[1] https://docs.google.com/document/d/1KOu0Y3V4LtctPKwaQieSo8muqqWxpyY8oZCm_kstaQ4/edit?usp=sharing [2] https://docs.google.com/document/d/1YbKspf2kVMSzJqZvx53SxxFtt0CyNqMqnMiOj4KsNI8/edit?usp=sharing

piyumaldk commented 1 week ago

Update on the current state (2024/09/06)

[1] https://github.com/wso2-enterprise/ai-subscription-portal/pull/1