fix: return api config in ApplicationView (#1330)

This commit is contained in:
Livio Amstutz 2021-02-23 08:11:09 +01:00 committed by GitHub
parent bcf47a82c6
commit 16a47c6542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -101,6 +101,13 @@ func oidcConfigFromApplicationViewModel(app *proj_model.ApplicationView) *manage
}
}
func apiConfigFromApplicationViewModel(app *proj_model.ApplicationView) *management.APIConfig {
return &management.APIConfig{
ClientId: app.OIDCClientID,
AuthMethodType: apiAuthMethodTypeFromModel(proj_model.APIAuthMethodType(app.OIDCAuthMethodType)),
}
}
func complianceProblemsToLocalizedMessages(problems []string) []*message.LocalizedMessage {
converted := make([]*message.LocalizedMessage, len(problems))
for i, p := range problems {
@ -264,6 +271,10 @@ func applicationViewFromModel(application *proj_model.ApplicationView) *manageme
converted.AppConfig = &management.ApplicationView_OidcConfig{
OidcConfig: oidcConfigFromApplicationViewModel(application),
}
} else {
converted.AppConfig = &management.ApplicationView_ApiConfig{
ApiConfig: apiConfigFromApplicationViewModel(application),
}
}
return converted
}

View File

@ -2857,6 +2857,7 @@ message ApplicationView {
string name = 5;
oneof app_config {
OIDCConfig oidc_config = 8;
APIConfig api_config = 10;
}
uint64 sequence = 9;