forked from zitadel/zitadel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
policy_handler.go
37 lines (30 loc) · 1.12 KB
/
policy_handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package login
import (
"net/http"
iam_model "github.com/dennigogo/zitadel/internal/iam/model"
"github.com/dennigogo/zitadel/internal/query"
)
func (l *Login) getDefaultDomainPolicy(r *http.Request) (*query.DomainPolicy, error) {
return l.query.DefaultDomainPolicy(r.Context())
}
func (l *Login) getOrgDomainPolicy(r *http.Request, orgID string) (*query.DomainPolicy, error) {
if orgID == "" {
return l.query.DefaultDomainPolicy(r.Context())
}
return l.query.DomainPolicyByOrg(r.Context(), false, orgID)
}
func (l *Login) getIDPConfigByID(r *http.Request, idpConfigID string) (*iam_model.IDPConfigView, error) {
return l.authRepo.GetIDPConfigByID(r.Context(), idpConfigID)
}
func (l *Login) getLoginPolicy(r *http.Request, orgID string) (*query.LoginPolicy, error) {
if orgID == "" {
return l.query.DefaultLoginPolicy(r.Context())
}
return l.query.LoginPolicyByID(r.Context(), false, orgID)
}
func (l *Login) getLabelPolicy(r *http.Request, orgID string) (*query.LabelPolicy, error) {
if orgID == "" {
return l.query.DefaultActiveLabelPolicy(r.Context())
}
return l.query.ActiveLabelPolicyByOrg(r.Context(), orgID)
}