perf: remove owner removed columns from projections for oidc (#6925)

* fix: remove owner removed columns from login names projection

* fix: remove owner removed columns from flow projection

* fix: remove owner removed columns from project, projectgrant and member projections

* fix: correct unit tests for session projection

* fix: correct unit tests for session projection
This commit is contained in:
Stefan Benz
2023-11-20 16:21:08 +01:00
committed by GitHub
parent 3bed5f50a8
commit 0ec7a74877
65 changed files with 358 additions and 654 deletions

View File

@@ -103,13 +103,13 @@ type orgViewProvider interface {
}
type userGrantProvider interface {
ProjectByClientID(context.Context, string, bool) (*query.Project, error)
ProjectByClientID(context.Context, string) (*query.Project, error)
UserGrantsByProjectAndUserID(context.Context, string, string) ([]*query.UserGrant, error)
}
type projectProvider interface {
ProjectByClientID(context.Context, string, bool) (*query.Project, error)
SearchProjectGrants(ctx context.Context, queries *query.ProjectGrantSearchQueries, withOwnerRemoved bool) (projects *query.ProjectGrants, err error)
ProjectByClientID(context.Context, string) (*query.Project, error)
SearchProjectGrants(ctx context.Context, queries *query.ProjectGrantSearchQueries) (projects *query.ProjectGrants, err error)
}
type applicationProvider interface {
@@ -132,7 +132,7 @@ func (repo *AuthRequestRepo) CreateAuthRequest(ctx context.Context, request *dom
return nil, err
}
request.ID = reqID
project, err := repo.ProjectProvider.ProjectByClientID(ctx, request.ApplicationID, false)
project, err := repo.ProjectProvider.ProjectByClientID(ctx, request.ApplicationID)
if err != nil {
return nil, err
}
@@ -1617,7 +1617,7 @@ func userGrantRequired(ctx context.Context, request *domain.AuthRequest, user *u
var project *query.Project
switch request.Request.Type() {
case domain.AuthRequestTypeOIDC, domain.AuthRequestTypeSAML, domain.AuthRequestTypeDevice:
project, err = userGrantProvider.ProjectByClientID(ctx, request.ApplicationID, false)
project, err = userGrantProvider.ProjectByClientID(ctx, request.ApplicationID)
if err != nil {
return false, err
}
@@ -1638,7 +1638,7 @@ func projectRequired(ctx context.Context, request *domain.AuthRequest, projectPr
var project *query.Project
switch request.Request.Type() {
case domain.AuthRequestTypeOIDC, domain.AuthRequestTypeSAML, domain.AuthRequestTypeDevice:
project, err = projectProvider.ProjectByClientID(ctx, request.ApplicationID, false)
project, err = projectProvider.ProjectByClientID(ctx, request.ApplicationID)
if err != nil {
return false, err
}
@@ -1659,7 +1659,7 @@ func projectRequired(ctx context.Context, request *domain.AuthRequest, projectPr
if err != nil {
return false, err
}
grants, err := projectProvider.SearchProjectGrants(ctx, &query.ProjectGrantSearchQueries{Queries: []query.SearchQuery{projectID, grantedOrg}}, false)
grants, err := projectProvider.SearchProjectGrants(ctx, &query.ProjectGrantSearchQueries{Queries: []query.SearchQuery{projectID, grantedOrg}})
if err != nil {
return false, err
}