topaz
topaz copied to clipboard
Add new endpoint for config
When the console service is configured topaz exposes a /api/v1/config endpoint with a JSON containing URLs to the endpoints it provides.
The topaz console is moving to a model where it can display multiple configs. To support this in Topaz we need to add a new endpoint e.g. /api/v2/config with the following format
[
{
"configType": "auto",
"name": "<some_random_name_for_config>",
"address": "https://localhost:8080/api/v2/config",
"asertoDirectoryUrl": "https://localhost:9394",
"authorizerServiceUrl": "https://localhost:8384",
"authorizerApiKey": "",
"directoryApiKey": "",
"directoryTenantId": "",
"asertoDirectoryReaderUrl": "https://localhost:9394",
"asertoDirectoryWriterUrl": "https://localhost:9394",
"asertoDirectoryModelUrl": "https://localhost:9394"
}
]
The format was updated to
{
"readOnly": true,
"configs": [
{
"configType": "auto",
"name": "Topaz Config",
"address": "https://localhost:4321/api/v2/config",
"asertoDirectoryUrl": "https://localhost:9393",
"authorizerServiceUrl": "https://localhost:8383",
"authorizerApiKey": "",
"directoryApiKey": "",
"directoryTenantId": "",
"asertoDirectoryReaderUrl": "https://localhost:9393",
"asertoDirectoryWriterUrl": "https://localhost:9393",
"asertoDirectoryModelUrl": "https://localhost:9393"
}
]
}
done
curl -s -k https://localhost:8080/api/v2/config | jq .
{
"readOnly": true,
"authenticationType": "anonymous",
"configs": [
{
"configType": "auto",
"name": "Topaz Config",
"address": "https://localhost:8080/api/v2/config",
"authorizerServiceUrl": "https://localhost:8383",
"authorizerApiKey": "",
"directoryServiceUrl": "https://localhost:9393",
"directoryApiKey": "",
"directoryTenantId": "",
"directoryReaderServiceUrl": "https://localhost:9393",
"directoryWriterServiceUrl": "https://localhost:9393",
"directoryImporterServiceUrl": "https://localhost:9393",
"directoryExporterServiceUrl": "https://localhost:9393",
"directoryModelServiceUrl": "https://localhost:9393"
}
]
}