outpost/ldap: set request_id in sentry
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
734e5fcab4
commit
ffbab2cd68
|
@ -23,11 +23,12 @@ type BindRequest struct {
|
||||||
func (ls *LDAPServer) Bind(bindDN string, bindPW string, conn net.Conn) (ldap.LDAPResultCode, error) {
|
func (ls *LDAPServer) Bind(bindDN string, bindPW string, conn net.Conn) (ldap.LDAPResultCode, error) {
|
||||||
span := sentry.StartSpan(context.TODO(), "authentik.providers.ldap.bind",
|
span := sentry.StartSpan(context.TODO(), "authentik.providers.ldap.bind",
|
||||||
sentry.TransactionName("authentik.providers.ldap.bind"))
|
sentry.TransactionName("authentik.providers.ldap.bind"))
|
||||||
|
rid := uuid.New().String()
|
||||||
|
span.SetTag("request_uid", rid)
|
||||||
span.SetTag("user.username", bindDN)
|
span.SetTag("user.username", bindDN)
|
||||||
defer span.Finish()
|
defer span.Finish()
|
||||||
|
|
||||||
bindDN = strings.ToLower(bindDN)
|
bindDN = strings.ToLower(bindDN)
|
||||||
rid := uuid.New().String()
|
|
||||||
req := BindRequest{
|
req := BindRequest{
|
||||||
BindDN: bindDN,
|
BindDN: bindDN,
|
||||||
BindPW: bindPW,
|
BindPW: bindPW,
|
||||||
|
|
|
@ -24,12 +24,13 @@ type SearchRequest struct {
|
||||||
|
|
||||||
func (ls *LDAPServer) Search(bindDN string, searchReq ldap.SearchRequest, conn net.Conn) (ldap.ServerSearchResult, error) {
|
func (ls *LDAPServer) Search(bindDN string, searchReq ldap.SearchRequest, conn net.Conn) (ldap.ServerSearchResult, error) {
|
||||||
span := sentry.StartSpan(context.TODO(), "authentik.providers.ldap.search", sentry.TransactionName("authentik.providers.ldap.search"))
|
span := sentry.StartSpan(context.TODO(), "authentik.providers.ldap.search", sentry.TransactionName("authentik.providers.ldap.search"))
|
||||||
|
rid := uuid.New().String()
|
||||||
|
span.SetTag("request_uid", rid)
|
||||||
span.SetTag("user.username", bindDN)
|
span.SetTag("user.username", bindDN)
|
||||||
span.SetTag("ak_filter", searchReq.Filter)
|
span.SetTag("ak_filter", searchReq.Filter)
|
||||||
span.SetTag("ak_base_dn", searchReq.BaseDN)
|
span.SetTag("ak_base_dn", searchReq.BaseDN)
|
||||||
|
|
||||||
bindDN = strings.ToLower(bindDN)
|
bindDN = strings.ToLower(bindDN)
|
||||||
rid := uuid.New().String()
|
|
||||||
req := SearchRequest{
|
req := SearchRequest{
|
||||||
SearchRequest: searchReq,
|
SearchRequest: searchReq,
|
||||||
BindDN: bindDN,
|
BindDN: bindDN,
|
||||||
|
|
Reference in New Issue