MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / CheckSecurity

Function CheckSecurity

core/utils/security/security.go:42–58  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

40}
41
42func CheckSecurity(c *gin.Context) bool {
43 authService := service.NewIAuthService()
44 entrance := authService.GetSecurityEntrance()
45 if entrance != "" && !checkEntrance(c) && !checkSession(c) {
46 HandleNotSecurity(c, "")
47 return false
48 }
49 if !checkBindDomain(c) {
50 HandleNotSecurity(c, "err_domain")
51 return false
52 }
53 if !checkIPLimit(c) {
54 HandleNotSecurity(c, "err_ip_limit")
55 return false
56 }
57 return true
58}
59
60func ToIndexHtml(c *gin.Context) {
61 c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8")

Callers

nothing calls this directly

Calls 6

GetSecurityEntranceMethod · 0.95
checkEntranceFunction · 0.85
HandleNotSecurityFunction · 0.85
checkBindDomainFunction · 0.85
checkIPLimitFunction · 0.85
checkSessionFunction · 0.70

Tested by

no test coverage detected