625deb973b
* feat: Add sqlpage.hmac function for cryptographic signing Co-authored-by: contact <contact@ophir.dev> * feat: Add sqlpage.hmac function for secure data signing Co-authored-by: contact <contact@ophir.dev> * Test HMAC function with RFC vectors and update tests Co-authored-by: contact <contact@ophir.dev> * feat: Add sqlpage.hmac() function for secure signatures Co-authored-by: contact <contact@ophir.dev> * feat: Add base64 output option to hmac function Co-authored-by: contact <contact@ophir.dev> * Refactor hmac function for cleaner output formatting Co-authored-by: contact <contact@ophir.dev> * Add webhook HMAC signature validation tests Co-authored-by: contact <contact@ophir.dev> * Refactor HMAC function and update SQL examples for clarity and consistency - Changed function parameters to remove Option types for data and key in the HMAC function. - Improved SQL documentation and examples for HMAC usage, including clearer descriptions and updated error handling. - Enhanced test cases for webhook HMAC validation to ensure accurate signature checks and responses. - Removed obsolete test file for HMAC with null values. * Update HMAC validation logic to handle NULL values in SQL queries - Modified conditions in SQL queries to check for NULL values alongside signature mismatches. - Enhanced documentation on NULL handling for HMAC checks to improve clarity and portability. * remove debug logging from ci --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
6 lines
374 B
SQL
6 lines
374 B
SQL
-- Test HMAC with base64 output format
|
|
-- Redirect if hash doesn't match expected value
|
|
SELECT 'redirect' as component, '/error.sql' as link
|
|
WHERE sqlpage.hmac('The quick brown fox jumps over the lazy dog', 'key', 'sha256-base64') != '97yD9DBThCSxMpjmqm+xQ+9NWaFJRhdZl0edvC0aPNg=';
|
|
|
|
SELECT 'text' as component, 'It works ! HMAC SHA-256 base64 output is correct' as contents; |