-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add basic auth to stakerd routes #155
Conversation
func BasicAuthMiddleware(expUsername, expPwd string) func(http.HandlerFunc) http.HandlerFunc { | ||
return func(next http.HandlerFunc) http.HandlerFunc { | ||
return func(w http.ResponseWriter, r *http.Request) { | ||
user, pass, ok := r.BasicAuth() |
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 wonder whether we can take some insipiration in how auth is done from btcd - https://github.com/btcsuite/btcd/blob/cba88226f49d5162c83c3edb562cc926edb4a87f/rpcserver.go#L4150 🤔
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.
This seems more complex, but I can those maps to the staker service and have the BasicAuthMiddleware
as a method to check basic auth
authsha [sha256.Size]byte
limitauthsha [sha256.Size]byte
* feat: add basic auth to stakerd routes * chore: add #155 to cl * chore: warn user about env * chore: RPC from cometbft to add basic auth middleware * fix: lint * chore: add auth to stakercli requests * chore: removed print for load .env * chore: removed opaque set * chore: add auth middleware to / as well * chore: add comment for auth Rpc client * chore: add auth env to manager * chore: use vars * fix: add client auth to e2e test
* feat: add basic auth to stakerd routes (#155) * feat: add basic auth to stakerd routes * chore: add #155 to cl * chore: warn user about env * chore: RPC from cometbft to add basic auth middleware * fix: lint * chore: add auth to stakercli requests * chore: removed print for load .env * chore: removed opaque set * chore: add auth middleware to / as well * chore: add comment for auth Rpc client * chore: add auth env to manager * chore: use vars * fix: add client auth to e2e test * chore: add env auth vars to StartManagerStakerApp
.env.example
and tip on readme to add AUTH envsCloses: #153