Add encrypted key support for chat and nodes

Introduces encrypted private key storage for nodes and users, updates chat message schema to support sender-side encryption, and adds supporting libraries and tests for cryptographic signing and identity unlock flows. Includes new database migrations, API route updates, and React components for identity unlock prompts.
This commit is contained in:
Christopher
2026-01-27 17:13:28 -08:00
parent 25f71e320b
commit 5903022f8a
46 changed files with 7457 additions and 113 deletions
@@ -0,0 +1,40 @@
/**
* IdentityUnlockPrompt Component Tests
*
* Tests the IdentityUnlockPrompt modal component
* Validates: Requirements US-2.3, US-5.1
*/
import { describe, it, expect } from 'vitest';
describe('IdentityUnlockPrompt Component', () => {
it('should have correct prop types', () => {
// This test verifies the component interface compiles correctly
type IdentityUnlockPromptProps = {
onUnlock?: () => void;
onCancel?: () => void;
};
// Test with all props
const propsWithCallbacks: IdentityUnlockPromptProps = {
onUnlock: () => console.log('unlocked'),
onCancel: () => console.log('cancelled'),
};
expect(propsWithCallbacks.onUnlock).toBeDefined();
expect(propsWithCallbacks.onCancel).toBeDefined();
// Test with no props (all optional)
const propsEmpty: IdentityUnlockPromptProps = {};
expect(propsEmpty.onUnlock).toBeUndefined();
expect(propsEmpty.onCancel).toBeUndefined();
});
it('should export the component', async () => {
// Verify the component can be imported
const module = await import('./IdentityUnlockPrompt');
expect(module.IdentityUnlockPrompt).toBeDefined();
expect(typeof module.IdentityUnlockPrompt).toBe('function');
});
});