fix: check oidc / api config (#1940)

This commit is contained in:
Livio Amstutz
2021-06-27 11:20:59 +02:00
committed by GitHub
parent 724df5d6c4
commit c6ad784a6c
6 changed files with 34 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/caos/logging"
"github.com/caos/zitadel/internal/crypto"
"github.com/caos/zitadel/internal/errors"
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
"github.com/caos/zitadel/internal/project/model"
)
@@ -72,6 +73,9 @@ func (p *Project) appendChangeAPIConfigEvent(event *es_models.Event) error {
}
if i, a := GetApplication(p.Applications, config.AppID); a != nil {
if p.Applications[i].OIDCConfig == nil {
return errors.ThrowInvalidArgument(nil, "MODEL-ADbsd", "api config is nil")
}
return p.Applications[i].APIConfig.setData(event)
}
return nil

View File

@@ -165,6 +165,9 @@ func (p *Project) appendChangeOIDCConfigEvent(event *es_models.Event) error {
}
if i, a := GetApplication(p.Applications, config.AppID); a != nil {
if p.Applications[i].OIDCConfig == nil {
return errors.ThrowInvalidArgument(nil, "MODEL-aBR5G", "oidc config is nil")
}
return p.Applications[i].OIDCConfig.setData(event)
}
return nil