Closed finn-tbd closed 9 months ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
Attention: 7 lines
in your changes are missing coverage. Please review.
Comparison is base (
c372d25
) 80.50% compared to head (b36d176
) 91.24%.
Files | Patch % | Lines |
---|---|---|
src/http-api.ts | 93.10% | 6 Missing :warning: |
src/storage.ts | 94.73% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've given it a first pass (minus the tests) and it looks good so far when analyzing the individual pieces. Want to spend a little more time today re-reviewing the PoW calculation pieces and giving it a last pass including tests.
Just a few small nits and questions above.
This PR adds optional (disabled by default) authorization to all endpoints. New DIDs wishing to use an instance of dwn-server with registration requirements must complete a proof-of-work challenge, agree to the server's terms of service, or both. Requests for DIDs that have not completed the requirements will be rejected.
POW authorization can be enabled by setting
DWN_REGISTRATION_POW=true
. Authorized DIDs are tracked in a database, configured by settingDWN_STORAGE_REGISTRATION
orDWN_STORAGE
. Note that only SQL-based stores are supported.