1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

Add tracing annotations

This patch changes several internal packages to receive and pass tracing
annotations, making use of the new tracing library, so we can have
better debugging information.
This commit is contained in:
Alberto Bertogli
2022-03-07 01:43:58 +00:00
parent 9c6661eca2
commit 4a00a83c23
15 changed files with 151 additions and 80 deletions

View File

@@ -65,8 +65,8 @@ func (a *Authenticator) Register(domain string, be Backend) {
}
// Authenticate the user@domain with the given password.
func (a *Authenticator) Authenticate(user, domain, password string) (bool, error) {
tr := trace.New("Auth.Authenticate", user+"@"+domain)
func (a *Authenticator) Authenticate(tr *trace.Trace, user, domain, password string) (bool, error) {
tr = tr.NewChild("Auth.Authenticate", user+"@"+domain)
defer tr.Finish()
// Make sure the call takes a.AuthDuration + 0-20% regardless of the
@@ -104,8 +104,8 @@ func (a *Authenticator) Authenticate(user, domain, password string) (bool, error
}
// Exists checks that user@domain exists.
func (a *Authenticator) Exists(user, domain string) (bool, error) {
tr := trace.New("Auth.Exists", user+"@"+domain)
func (a *Authenticator) Exists(tr *trace.Trace, user, domain string) (bool, error) {
tr = tr.NewChild("Auth.Exists", user+"@"+domain)
defer tr.Finish()
if be, ok := a.backends[domain]; ok {