Skip to content

Commit

Permalink
Add debug output
Browse files Browse the repository at this point in the history
This should help us debug cases where users which should have been added
to the database can not be found.

refs: #536
  • Loading branch information
adombeck committed Sep 19, 2024
1 parent 7921867 commit 9c32bdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/brokers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ func (m *Manager) NewSession(brokerID, username, lang, mode string) (sessionID s
return "", "", err
}

log.Debug(context.Background(), fmt.Sprintf("%s: New session for %q", sessionID, username))

m.transactionsToBrokerMu.Lock()
defer m.transactionsToBrokerMu.Unlock()
m.transactionsToBroker[sessionID] = broker
Expand Down
2 changes: 2 additions & 0 deletions internal/services/pam/pam.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ func (s Service) IsAuthenticated(ctx context.Context, req *authd.IARequest) (res
data = ""
}

log.Debug(ctx, fmt.Sprintf("%s: Authentication result: %s", sessionID, access))

return &authd.IAResponse{
Access: access,
Msg: data,
Expand Down
3 changes: 3 additions & 0 deletions internal/users/cache/update.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cache

import (
"context"
"encoding/json"
"errors"
"fmt"
Expand All @@ -9,6 +10,7 @@ import (
"strconv"
"time"

"github.com/ubuntu/authd/internal/log"
"go.etcd.io/bbolt"
)

Expand Down Expand Up @@ -75,6 +77,7 @@ func updateUser(buckets map[string]bucketWithName, userContent userDB) error {
}

// Update user buckets
log.Debug(context.Background(), fmt.Sprintf("Updating entry of user %q (UID: %d)", userContent.Name, userContent.UID))
updateBucket(buckets[userByIDBucketName], userContent.UID, userContent)
updateBucket(buckets[userByNameBucketName], userContent.Name, userContent)

Expand Down

0 comments on commit 9c32bdf

Please sign in to comment.