fix(query): realtime data on defined requests (#3726)

* feat: directly specify factors on addCustomLoginPolicy and return on LoginPolicy responses

* fix proto

* update login policy

* feat: directly specify idp on addCustomLoginPolicy and return on LoginPolicy responses

* fix: tests

* fix(projection): trigger bulk

* refactor: clean projection pkg

* instance should bulk

* fix(query): should trigger bulk on id calls

* tests

* build prerelease

* fix: add shouldTriggerBulk

* fix: test

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
Silvan
2022-06-14 07:51:00 +02:00
committed by GitHub
parent 5c805c48db
commit dd2f31683c
146 changed files with 1097 additions and 1239 deletions

View File

@@ -33,7 +33,7 @@ func (l *Login) getPasswordComplexityPolicy(r *http.Request, authReq *domain.Aut
}
func (l *Login) getPasswordComplexityPolicyByUserID(r *http.Request, authReq *domain.AuthRequest, userID string) (*iam_model.PasswordComplexityPolicyView, string, error) {
user, err := l.query.GetUserByID(r.Context(), userID)
user, err := l.query.GetUserByID(r.Context(), false, userID)
if err != nil {
return nil, "", nil
}

View File

@@ -15,7 +15,7 @@ func (l *Login) getOrgDomainPolicy(r *http.Request, orgID string) (*query.Domain
if orgID == "" {
return l.query.DefaultDomainPolicy(r.Context())
}
return l.query.DomainPolicyByOrg(r.Context(), orgID)
return l.query.DomainPolicyByOrg(r.Context(), false, orgID)
}
func (l *Login) getIDPConfigByID(r *http.Request, idpConfigID string) (*iam_model.IDPConfigView, error) {
@@ -26,5 +26,5 @@ func (l *Login) getLoginPolicy(r *http.Request, orgID string) (*query.LoginPolic
if orgID == "" {
return l.query.DefaultLoginPolicy(r.Context())
}
return l.query.LoginPolicyByID(r.Context(), orgID)
return l.query.LoginPolicyByID(r.Context(), false, orgID)
}

View File

@@ -369,7 +369,7 @@ func (l *Login) getBaseData(r *http.Request, authReq *domain.AuthRequest, title
if labelPolicy != nil {
baseData.LabelPolicy = labelPolicy.ToDomain()
}
policy, err := l.query.DefaultPrivacyPolicy(r.Context())
policy, err := l.query.DefaultPrivacyPolicy(r.Context(), false)
if err != nil {
return baseData
}
@@ -498,7 +498,7 @@ func (l *Login) getOrgPrimaryDomain(r *http.Request, authReq *domain.AuthRequest
if authReq != nil && authReq.RequestedPrimaryDomain != "" {
return authReq.RequestedPrimaryDomain
}
org, err := l.query.OrgByID(r.Context(), orgID)
org, err := l.query.OrgByID(r.Context(), false, orgID)
if err != nil {
logging.New().WithError(err).Error("cannot get default org")
return ""