Skip to content

Commit

Permalink
Add debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
adombeck committed Jan 13, 2025
1 parent 7ed5992 commit 0f04be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/services/nss/nss.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ func (s Service) GetPasswdByName(ctx context.Context, req *authd.GetPasswdByName
}

if !errors.Is(err, users.NoDataFoundError{}) || !req.GetShouldPreCheck() {
log.Debugf(context.Background(), "GetPasswdByName: %v", err)
return nil, noDataFoundErrorToGRPCError(err)
}

// If the user is not found in the local cache, we check if it exists in at least one broker.
pwent, err := s.userPreCheck(ctx, req.GetName())
if err != nil {
log.Debugf(context.Background(), "GetPasswdByName: %v", err)
return nil, status.Error(codes.NotFound, err.Error())
}

Expand Down
2 changes: 2 additions & 0 deletions internal/users/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (m *Manager) Stop() error {
func (m *Manager) UpdateUser(u UserInfo) (err error) {
defer decorate.OnError(&err, "failed to update user %q", u.Name)

log.Debugf(context.TODO(), "Updating user %q", u.Name)

if u.Name == "" {
return errors.New("empty username")
}
Expand Down

0 comments on commit 0f04be9

Please sign in to comment.