Security-first dual function approach for nanoids#2
Merged
Conversation
- Add nanoid() function for secure random IDs (recommended default) - Add nanoid_sortable() function for time-ordered IDs (use carefully) - Update README with security warnings and recommendations - Update all test files for dual-function approach - Add comprehensive dual_function_test.sql test suite - Update init script for clean database setup - Recommend secure nanoid() by default with clear privacy guidance Security improvement: Regular nanoid() no longer leaks timing information. Only use nanoid_sortable() when temporal ordering is essential. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Test both nanoid() and nanoid_sortable() functions - Verify security characteristics (random vs time-ordered) - Run comprehensive test suite on PostgreSQL 15 - Performance benchmarks and batch testing - Function availability and parameter validation Ensures all tests pass before merging changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Updated workflow to only run on main branch since develop branch doesn't exist. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed aggregate function error by separating window function calls into separate CTEs before aggregating results. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace \timing commands with status messages - psql meta-commands don't work in non-interactive mode via -c flag - Performance test now executes without syntax errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a security-first dual function approach to address the timing information leakage concern:
nanoid()- Secure, purely random IDs (recommended default)nanoid_sortable()- Time-ordered IDs (use only when sorting is essential)Key Changes
nanoid()no longer embeds timestampsnanoid_sortable()Security Benefits
Test Coverage
Test plan
🤖 Generated with Claude Code