Commit d7b08a3
committed
fix: accept EOA-subject admin keys in legacy VerifyJwtKeyForUser
GetKey (the API key exchange handler used by SDK authWithAPIKey) calls
VerifyJwtKeyForUser, which had two bugs that combined to reject every
key generated by the modern create-api-key CLI:
1. It only treated the literal string "apikey" as an admin subject,
but PR #509 changed CreateAdminKey to require an EOA address as
the JWT subject — so admin keys never matched the role-based path.
2. For EOA-subject JWTs, even when claimAddress == userWallet, the
function fell through to "Malform JWT Key Claim" because the
address-match branch was missing a `return true, nil`.
Add an EOA-subject branch that mirrors the modern verifyAuth contract:
admin-role keys may manage any wallet; non-admin keys are valid only
when subject == userWallet.
Discovered while debugging AvaProtocol/ava-sdk-js#209 CI failures.1 parent 0b07f28 commit d7b08a3
1 file changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
88 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
89 | 103 | | |
90 | 104 | | |
91 | 105 | | |
| 106 | + | |
92 | 107 | | |
93 | 108 | | |
94 | 109 | | |
| |||
0 commit comments