jans icon indicating copy to clipboard operation
jans copied to clipboard

feat(config-api) - Create endpoints that will retrun list of agama github lab community projects and upload agama project.

Open mjatin-dev opened this issue 4 months ago • 0 comments

Parent issue# https://github.com/JanssenProject/jans/issues/8785

Describe the bug Create two API endpoints to handle repository data from the Agama lab community projects.

Expected behavior

I. API Endpoints:

  1. Retrieve Repositories List:

    • External Endpoint: GET https://github.com/orgs/GluuFederation/repositories?q=agama-
    • Fetch and send all repository data related to the keyword agama- from the project list.
  2. Fetch Latest Release for a Specific Repository:

    • ** External Endpoint**: GET https://api.github.com/repos/GluuFederation/${repository_name}/releases/latest
    • Upon user selection of a repository (sent from the frontend), make an API call to retrieve the latest release data for the selected repository.

Points to Follow:

  1. Step 1:

    • Fetch all repository data from the https://github.com/orgs/GluuFederation/repositories?q=agama- endpoint.
    • Send this data to the frontend so the user can select a repository.
  2. Step 2:

    • After the user selects a repository, you will receive the repository_name from the frontend.
  3. Step 3:

    • Use the repository_name to make an API call to the https://api.github.com/repos/GluuFederation/${repository_name}/releases/latest endpoint (/releases/latest).
    • In the response, locate the assets key, which contains two objects:
      • One object holds the .gama file.
      • The other holds the .gama.sha256sum file.
    • Each object will have a browser_download_url key containing the download link for the respective files.
  4. Step 4:

    • Retrieve the .gama file from the browser_download_url.
    • Use the addAgama API (which should already exist in our system) to store this data into the database.
  5. Step 5:

    • After successfully adding the .gama file to the database, send a success or error response back to the frontend.

mjatin-dev avatar Oct 24 '24 06:10 mjatin-dev