Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug output #546

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading