-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add /api/v2/config endpoint #278
Conversation
Pull Request Test Coverage Report for Build 7888525799Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
91049d3
to
403b21c
Compare
403b21c
to
9495937
Compare
pkg/app/handlers/config.go
Outdated
AsertoDirectoryURL string `json:"asertoDirectoryUrl"` | ||
AuthorizerServiceURL string `json:"authorizerServiceUrl"` | ||
AuthorizerAPIKey string `json:"authorizerApiKey"` | ||
DirectoryAPIKey string `json:"directoryApiKey"` | ||
DirectoryTenantID string `json:"directoryTenantId"` | ||
AsertoDirectoryReaderURL *string `json:"asertoDirectoryReaderUrl,omitempty"` | ||
AsertoDirectoryWriterURL *string `json:"asertoDirectoryWriterUrl,omitempty"` | ||
AsertoDirectoryModelURL *string `json:"asertoDirectoryModelUrl,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BogdanIrimie could we create some symmetry between authorizer and directory?
Let me know if this looks good and i can do the same in BFF
AuthorizerServiceURL string `json:"authorizerServiceUrl"`
AuthorizerAPIKey string `json:"authorizerApiKey"`
DirectoryServiceURL string `json:"directoryServiceUrl"`
DirectoryAPIKey string `json:"directoryApiKey"`
DirectoryTenantID string `json:"directoryTenantId"`
DirectoryReaderServiceURL *string `json:"directoryReaderServiceUrl,omitempty"`
DirectoryWriterServiceURL *string `json:"directoryWriterServiceUrl,omitempty"`
DirectoryModelServiceURL *string `json:"directoryModelServiceUrl,omitempty"`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, the result after the changes is
{
"readOnly": true,
"configs": [
{
"configType": "auto",
"name": "Topaz Config",
"address": "https://localhost:4321/api/v2/config",
"authorizerServiceUrl": "https://localhost:8383",
"authorizerApiKey": "",
"directoryApiKey": "",
"directoryTenantId": "",
"directoryReaderServiceUrl": "https://localhost:9393",
"directoryWriterServiceUrl": "https://localhost:9393",
"directoryModelServiceUrl": "https://localhost:9393"
}
]
}
c3f8756
to
219e9bd
Compare
Added the |
d9363f2
to
ff12835
Compare
0eb422c
to
d742f94
Compare
pkg/app/handlers/config.go
Outdated
cfgV2 := &TopazCfgV2{ | ||
Type: "auto", | ||
Name: "Topaz Config", | ||
Address: "https://localhost:4321/api/v2/config", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to hardcode the Address. I think we need to provide the configured address for the console service here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated so we return the console URL e.g.
{
"readOnly": true,
"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"
}
]
}
The topaz console is moving to the v2 config which contains a list of configs. To support this in topaz we are adding
/api/v2/config
endpoint which returns a list of configs and a flag that says if the configs are editable or not. In the case of topaz they are never editable that is why we set thereadOnly
flag to trueSample output of the new endpoint
Request example:
The API keys are returned only when the user is authenticated or if anonymous auth is enabled.
closes https://github.com/aserto-dev/workspace/issues/576