Extract APIs from source code using our Docker based CLI
You can extract APIs from your code repositories using our Docker based CLI.
How to use
Prepare the following variables:
AKTO_SYNC
- Set this toTRUE
if you want the CLI to import the extracted APIs into the Akto dashboardAKTO_API_KEY
- Go to My accounts > Settings > Integrations > Akto API > Generate token. Copy the token generated.AKTO_DASHBOARD_URL
- URL of your Akto dashboard. Please ensure the docker container can access the Akto dashboard,API_COLLECTION_NAME
- The API collection name into which you want to import the extracted APIs. Ensure that this collection exists.GITHUB_REPOSITORY
- The name of the Github repository to be used for source location links.GITHUB_BRANCH
- The branch of the Github repository to be used for source location links.
To extract APIs from a local code repository, run the following docker run command in a terminal:
Explanation:
-it
- enables interactive terminal input, allowing command line interaction.--rm
- automatically removes container after it exits.-v "$(pwd)":/usr/source_code
- mounts current directory to /usr/source_code in the container.
To import the extracted APIs into an API collection in Akto dashboard, run the following docker run command in a terminal:
To add source code links to the extracted APIs, run the following docker run command in a terminal:
Results
The API collection as specified by the
API_COLLECTION_NAME
variable can be viewed in the Akto dashboard to review the APIs extracted from source code.
Last updated