-
Notifications
You must be signed in to change notification settings - Fork 75
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
add per-ticket API authentication scheme #514
Closed
itswisdomagain
wants to merge
26
commits into
decred:master
from
itswisdomagain:upstream-ticket-auth
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4c6992b
setup ticket ownership validation/authentication middleware
itswisdomagain ae81af2
implement v3 auth middleware
itswisdomagain cf0f138
add v3 api support
itswisdomagain 3769865
use ticket validity age from config
itswisdomagain 375f20e
track timestamp usage in ticket auth routine
itswisdomagain f4c9c26
cache ticket auth signature instead of timestamp
itswisdomagain 136e908
return more descriptive error messages on ticket auth failure
itswisdomagain 3fc6f04
support new ticketauth api auth scheme on /v1 and /v2 api endpoints
itswisdomagain 2940a31
allow timestamps value 5mins into future
itswisdomagain 14fce14
allow access to some /api routes without valid auth header
itswisdomagain 9b529a6
remove maxticketchallengeage config option, use constant value
itswisdomagain 1970e45
return proper error for invalid ticket signature cases
itswisdomagain 4b0145c
ctx.WalletConnection -> ctx.WalletConnection.RPCClient()
itswisdomagain 8a7cf8f
Joe's review
itswisdomagain 5ccd341
rename OwnerRewardAddress to UserRewardAddress
itswisdomagain 4ac97e5
gitignore vendor
itswisdomagain a892cf7
use dcrutil/v2, wallet/v3 and txscript/v2
itswisdomagain 64558ac
bump dcrwallet/wallet mod version
itswisdomagain b8db13e
go fmt
itswisdomagain a9cf03c
post rebase fixes and cleanup
itswisdomagain 2f0c03d
refactor application.Init
itswisdomagain 10e8b82
unexport some types and properties, fix panics
itswisdomagain dcd59fc
validate tx hash supplied for ticket ownership validation
itswisdomagain be5e840
fix panic on api request without acceptable auth header
itswisdomagain f5bbac5
use passed context for GetTicketInfo stakepoold rpc call
itswisdomagain 8384d53
bump stakepoold minor version
itswisdomagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ testing/ | |
*.orig | ||
debug | ||
public/**/*.gz | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We might want to start tracking txids in the db, as we want to become more self-sufficient. Although I am aware that you want to reduce the communication between the db and stakepoold, because it is on another machine. A centralized area to track tickets is needed, imo. What do you think? It should be discussed somewhere... I'll make an issue after a little more thought.
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.
I'm not sure we can totally remove reliance on dcrwallet; unless that's possible and is something we're working towards, I'd prefer that where possible, we not store information that we can deduce by making 1 or 2 RPC calls. But you can open an issue for this and we can discuss it more and see what we can come up with.
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.
As I later commented below, this may be a good idea after all. I can proceed to implement in this PR if that's agreed.