-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registration Gating (Proof-of-Work, Terms of Service) #87
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
===========================================
+ Coverage 80.50% 91.24% +10.73%
===========================================
Files 15 20 +5
Lines 985 1702 +717
Branches 97 204 +107
===========================================
+ Hits 793 1553 +760
+ Misses 192 149 -43 ☔ View full report in Codecov by Sentry. |
…complete some tasks before they may user the server. proof of work challenge and terms of service challenges are currently available
* main: Removed the need for createProfile()
…ne scenario tests
* main: bump dwn-sql-store version and dwn-server (#98)
clock.restore(); | ||
}); | ||
|
||
it('should facilitate tenant registration with terms-of-service and proof-or-work turned on', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shamilovtim, this shows how tenant registration is done!
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small nits in the tests.
This looks good, and the added TODOs will make it even better when necessary. 🚀 🐐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
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.