Admin CLI
Admin CLI is a tool used to:
- Migrate database
- Register clients
- Register API keys for clients.
Admin CLI in the API container
The API container image already contains the Admin CLI in the /app dir.
Attaching to container to run Admin CLI
You can access admin-cli easily by attaching to running API container:
docker exec -it xma-api /bin/bash
It will already run bash in the /app dir, so admin-cli will be directly available.
Running Admin CLI commands against running API container
docker exec xma-api ./admin-cli ...
Updating database
To update database, run the migrate command:
./admin-cli migrate
Registering clients
To register a client, run:
./admin-cli client add --name <clientName>
Replace <clientName> with actual client name. It must be unique.
Generate and Register API keys
To generate and register API key for a client, run:
./admin-cli key issue --client <clientName> --name <keyName>
Replace <clientName> with actual client name. It must be registered.
Replace <keyName> with actual key name. It must be unique per-client.
Sample key registration output
Key 'test-key' issued for client 'test'
API key (shown only once; store securely):
xma_fjom3rUtBIYSxQ30o2rJGFXLyGMRATIe126aJLpRD8t3-Rp1x2-WnURIkr9gITDEGVlC9ya21R6TW6eiRNUAXQ
Relying parties must use the key xma_... to access the API. Note that it is not stored and it is only time when it is shown, so store it safely immediately.