45 Commits

Author SHA1 Message Date
tcheeric
85dfb739ad fix: Add active field to user object in daemon response
- Calculate `active` based on the absence of `revokedAt`.
2025-11-26 21:24:31 +00:00
tcheeric
666ab0d987 fix: Include revoked field in admin token response
- Add `revoked` field to indicate if a token is revoked based on `deletedAt`.
2025-11-26 21:24:23 +00:00
tcheeric
1cfa8f82d7 fix: Add revoked field to admin token response
- Include `revoked` field to indicate if a token is revoked based on its `deletedAt` property.
2025-11-26 21:24:15 +00:00
tcheeric
af02c644c0 fix: Exclude soft-deleted keys when retrieving key list
- Fetch keys marked as deleted from the database and filter them out.
- Ensure soft-deleted keys are skipped during processing.
2025-11-26 18:26:33 +00:00
tcheeric
ee8f9af717 fix: Update ping command response from 'ok' to 'pong' 2025-11-26 18:26:22 +00:00
tcheeric
35ab552e79 test: Update ping command test to expect 'pong' response 2025-11-26 18:26:03 +00:00
tcheeric
dc86897db4 feat: Persist created key to database in create_new_key
- Use Prisma to upsert key details upon creation.
- Add database mocking for related unit tests.
- Ensure `create_new_key` saves keyName and pubkey for future operations.
2025-11-26 16:34:36 +00:00
tcheeric
7ed4835bda feat: Add key_npub to admin token response and update .gitignore
- Include `key_npub` field in token response for admin methods.
- Update `.gitignore` to ignore `/claude/` and `/idea/` directories.
2025-11-26 15:46:44 +00:00
tcheeric
539106c4f1 fix: Convert policyId to integer in create_new_token
The policyId parameter comes as a string from NIP-46 RPC params but
Prisma expects an integer for the Token.policyId field. Added parseInt()
to convert the string to integer before passing to prisma.token.create().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 13:54:18 +00:00
tcheeric
16dc15b486 feat!: Add Admin API methods and NIP-46 compliance
BREAKING CHANGE: Admin API now uses kind 24133 instead of 24134

This release adds 11 new admin methods and ensures full NIP-46 compliance
by switching from the non-standard kind 24134 to the spec-compliant 24133.

## New Admin Methods

### Key Management
- `get_key` - Get details about a specific key
- `delete_key` - Soft-delete a key and its tokens
- `rotate_key` - Create new key and migrate permissions

### Policy Management
- `get_policy` - Get policy details with rules
- `delete_policy` - Soft-delete a policy

### Permission Management
- `grant_permission` - Grant user access with a policy
- `revoke_permission` - Revoke user's access to a key
- `get_permissions` - Get user's permissions on a key

### Token Management
- `get_token` - Get token details
- `revoke_token` - Soft-delete a token
- `validate_token` - Check if a token is valid

## NIP-46 Compliance

Changed all admin communication from kind 24134 to kind 24133
(NDKKind.NostrConnect) to comply with the NIP-46 specification.
Kind 24134 was never part of the official spec.

## Other Changes

- Added Vitest test framework with 93 tests
- Fixed TypeScript compilation errors
- Updated documentation with breaking change notice
- Version bump to 0.11.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 03:41:15 +00:00
tcheeric
deda485763 fix: nostr-tools v2 compatibility and null kind handling
- Fix compatibility with nostr-tools v2 which changed nip19 encoding/decoding
  to use Uint8Array instead of hex strings
- Add hex utility functions (bytesToHex, hexToBytes) for conversion
- Fix null kind handling in create_new_policy to prevent database errors
  when policy rules have no kind specified
- Default method to "sign_event" when not specified in policy rules
- Bump version to 0.10.6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 02:38:18 +00:00
Pablo Fernandez
ff5387b778 updates 2024-09-21 13:44:24 -04:00
Pablo Fernandez
2fde57ff90 respond to create_account with the kind that it came with 2024-02-15 13:03:43 +00:00
Nour
40391c536f
fix: create connection.txt inside config folder 2024-01-26 15:16:26 +00:00
Nour
894f3c3d14
feat: allow customizing auth host 2024-01-26 15:14:40 +00:00
reya
bc28858146 pass url prefix to handlebar 2024-01-23 14:31:49 +07:00
reya
f3b8aa8ebb fix 2024-01-23 14:24:52 +07:00
reya
c28e58de88 fix 2024-01-23 14:16:20 +07:00
reya
91f1d73295 fix 2024-01-23 14:15:50 +07:00
reya
c40d26c651 fix invalid url 2024-01-23 14:11:01 +07:00
reya
65e067505b fix again 2024-01-23 14:06:52 +07:00
reya
30ab41907d fix 2024-01-23 13:54:15 +07:00
reya
7ee7e0cfff fix again 2024-01-23 13:47:15 +07:00
reya
129cb99673 fix 2024-01-23 13:44:18 +07:00
reya
67f43d95af add base url to template 2024-01-23 13:35:28 +07:00
Pablo Fernandez
c92b169435 fix wrong nip46 key used 2024-01-08 15:29:54 +00:00
Pablo Fernandez
bfcb0992d4 allow using nip05 to sign from the client too 2024-01-02 14:46:24 +00:00
Pablo Fernandez
d9c07c0115 redirect to callback on auth 2024-01-02 13:54:56 +00:00
Pablo Fernandez
67c5252983 better error handling 2024-01-02 11:12:28 +00:00
Pablo Fernandez
dc1e3d4aca small refactors 2023-12-20 22:02:21 +00:00
Pablo Fernandez
59fd987c41 implement create_account in client 2023-12-20 14:57:51 +00:00
Pablo Fernandez
0a5682d1e4 create_account work 2023-12-20 10:21:24 +00:00
Pablo Fernandez
e5febb3345 wip 2023-12-01 11:18:39 +00:00
pablof7z
d2cc06244e Remove debug message 2023-07-08 12:35:02 +02:00
pablof7z
c7f546add1 Check if existing signing conditions belong to a revoked user 2023-07-08 12:34:51 +02:00
pablof7z
6f16cafd41 lots of things that I forgot to commit 😂 2023-07-06 22:29:31 +02:00
pablof7z
59556e673b follow 2023-06-29 16:55:23 +02:00
pablof7z
45e4f615a8 setup a skeleton profile to improve UX on first load on coracle 2023-06-29 16:02:46 +02:00
pablof7z
db0c9ae3fb minor improvements 2023-06-28 21:44:39 +02:00
pablof7z
f949c116db write to a file the connection string 2023-06-27 01:59:39 +02:00
pablof7z
6775855e0c fix import 2023-06-25 15:35:48 +02:00
pablof7z
c43f1cc95e Policies and single-use tokens 2023-06-04 10:03:02 +02:00
pablof7z
28f4788aec updates 2023-05-31 20:27:33 +02:00
pablof7z
74cd9715ac updates 2023-05-31 20:26:29 +02:00
pablof7z
54de9cfa8e initial commit 2023-05-15 20:05:55 +02:00