jans
jans copied to clipboard
feat(config-api) - Create endpoints that will retrun list of agama github lab community projects and upload agama project.
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:
-
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.
-
External Endpoint:
-
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.
- ** External Endpoint**:
Points to Follow:
-
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.
- Fetch all repository data from the
-
Step 2:
- After the user selects a repository, you will receive the
repository_name
from the frontend.
- After the user selects a repository, you will receive the
-
Step 3:
- Use the
repository_name
to make an API call to thehttps://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.
- One object holds the
- Each object will have a
browser_download_url
key containing the download link for the respective files.
- Use the
-
Step 4:
- Retrieve the
.gama
file from thebrowser_download_url
. - Use the addAgama API (which should already exist in our system) to store this data into the database.
- Retrieve the
-
Step 5:
- After successfully adding the
.gama
file to the database, send a success or error response back to the frontend.
- After successfully adding the