MCPcopy
hub / github.com/tinyauthapp/tinyauth / IsBypassedIP

Method IsBypassedIP

internal/service/auth_service.go:598–613  ·  view source on GitHub ↗
(acls config.AppIP, ip string)

Source from the content-addressed store, hash-verified

596}
597
598func (auth *AuthService) IsBypassedIP(acls config.AppIP, ip string) bool {
599 for _, bypassed := range acls.Bypass {
600 res, err := utils.FilterIP(bypassed, ip)
601 if err != nil {
602 tlog.App.Warn().Err(err).Str("item", bypassed).Msg("Invalid IP/CIDR in bypass list")
603 continue
604 }
605 if res {
606 tlog.App.Debug().Str("ip", ip).Str("item", bypassed).Msg("IP is in bypass list, allowing access")
607 return true
608 }
609 }
610
611 tlog.App.Debug().Str("ip", ip).Msg("IP not in bypass list, continuing with authentication")
612 return false
613}
614
615func (auth *AuthService) NewOAuthSession(serviceName string, params OAuthURLParams) (string, OAuthPendingSession, error) {
616 auth.ensureOAuthSessionLimit()

Callers 1

proxyHandlerMethod · 0.80

Calls 1

FilterIPFunction · 0.92

Tested by

no test coverage detected