Skip to content

Commit

Permalink
fix: use correct type in user ID context key
Browse files Browse the repository at this point in the history
  • Loading branch information
smlx committed Oct 15, 2024
1 parent 7c93f5c commit 6741a96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/lagoondb/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ func (c *Client) UserBySSHFingerprint(
}
return nil, err
}
// usid column in set NOT NULL, so this should be impossible
if user.UUID == nil {
return nil, errors.New("NULL user UUID")
}
return &user, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/sshtoken/authhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func pubKeyAuth(log *slog.Logger, ldb LagoonDBService) ssh.PublicKeyHandler {
// successful. Inject the user UUID into the context so it can be used in
// the session handler.
authnSuccessTotal.Inc()
ctx.SetValue(userUUIDkey, user.UUID)
ctx.SetValue(userUUIDkey, *user.UUID)
log.Info("authentication successful",
slog.String("userUUID", user.UUID.String()))
return true
Expand Down

0 comments on commit 6741a96

Please sign in to comment.