mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-03 11:12:29 +00:00
feat: app handling compliance (#527)
* feat: check oidc compliance * fix: add tests * fix: add oidc config tests * fix: add oidc config tests user agent * fix: test oidc config compliance * fix: test oidc config compliance * fix: useragent implicit authmethod none * fix: merge master * feat: translate compliance problems * feat: check native app for custom url * fix: better compliance handling * fix: better compliance handling * feat: add odidc dev mode * fix: remove deprecated request fro management api * fix: oidc package version * fix: migration * fix: tests * fix: remove unused functions * fix: generate proto files * fix: native implicit and code none compliant * fix: create project * Update internal/project/model/oidc_config_test.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: tests * Update internal/project/model/oidc_config.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * Update internal/project/model/oidc_config.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: tests Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -296,10 +296,31 @@ func (repo *ProjectRepo) ProjectChanges(ctx context.Context, id string, lastSequ
|
||||
return changes, nil
|
||||
}
|
||||
|
||||
func (repo *ProjectRepo) ApplicationByID(ctx context.Context, appID string) (*proj_model.ApplicationView, error) {
|
||||
app, err := repo.View.ApplicationByID(appID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
func (repo *ProjectRepo) ApplicationByID(ctx context.Context, projectID, appID string) (*proj_model.ApplicationView, error) {
|
||||
app, viewErr := repo.View.ApplicationByID(appID)
|
||||
if viewErr != nil && !caos_errs.IsNotFound(viewErr) {
|
||||
return nil, viewErr
|
||||
}
|
||||
if caos_errs.IsNotFound(viewErr) {
|
||||
app = new(model.ApplicationView)
|
||||
}
|
||||
|
||||
events, esErr := repo.ProjectEvents.ProjectEventsByID(ctx, projectID, app.Sequence)
|
||||
if caos_errs.IsNotFound(viewErr) && len(events) == 0 {
|
||||
return nil, caos_errs.ThrowNotFound(nil, "EVENT-Fshu8", "Errors.Application.NotFound")
|
||||
}
|
||||
|
||||
if esErr != nil {
|
||||
logging.Log("EVENT-SLCo9").WithError(viewErr).Debug("error retrieving new events")
|
||||
return model.ApplicationViewToModel(app), nil
|
||||
}
|
||||
|
||||
viewApp := *app
|
||||
for _, event := range events {
|
||||
err := app.AppendEvent(event)
|
||||
if err != nil {
|
||||
return model.ApplicationViewToModel(&viewApp), nil
|
||||
}
|
||||
}
|
||||
return model.ApplicationViewToModel(app), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user