lib: add additional celery logger to sentry ignore
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
		| @ -178,22 +178,6 @@ func NewApplication(p api.ProxyOutpostConfig, c *http.Client, cs *ak.CryptoStore | ||||
| 	return a, nil | ||||
| } | ||||
|  | ||||
| func (a *Application) IsAllowlisted(r *http.Request) bool { | ||||
| 	for _, u := range a.UnauthenticatedRegex { | ||||
| 		var testString string | ||||
| 		if a.Mode() == api.PROXYMODE_PROXY || a.Mode() == api.PROXYMODE_FORWARD_SINGLE { | ||||
| 			testString = r.URL.Path | ||||
| 		} else { | ||||
| 			testString = r.URL.String() | ||||
| 		} | ||||
| 		a.log.WithField("regex", u.String()).WithField("url", testString).Trace("Matching URL against allow list") | ||||
| 		if u.MatchString(testString) { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| func (a *Application) Mode() api.ProxyMode { | ||||
| 	return *a.proxyConfig.Mode | ||||
| } | ||||
|  | ||||
| @ -6,6 +6,7 @@ import ( | ||||
| 	"net/http" | ||||
| 	"strings" | ||||
|  | ||||
| 	"goauthentik.io/api" | ||||
| 	"goauthentik.io/internal/constants" | ||||
| ) | ||||
|  | ||||
| @ -62,3 +63,19 @@ func (a *Application) addHeaders(headers http.Header, c *Claims) { | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (a *Application) IsAllowlisted(r *http.Request) bool { | ||||
| 	for _, u := range a.UnauthenticatedRegex { | ||||
| 		var testString string | ||||
| 		if a.Mode() == api.PROXYMODE_PROXY || a.Mode() == api.PROXYMODE_FORWARD_SINGLE { | ||||
| 			testString = r.URL.Path | ||||
| 		} else { | ||||
| 			testString = r.URL.String() | ||||
| 		} | ||||
| 		a.log.WithField("regex", u.String()).WithField("url", testString).Trace("Matching URL against allow list") | ||||
| 		if u.MatchString(testString) { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
| 	return false | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer