Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 [Bug]: rmb-sdk-go Peer router middlewares not working #924

Closed
AbdelrahmanElawady opened this issue Mar 7, 2024 · 2 comments
Closed
Assignees
Labels
rmb-sdk belongs to rmb type_bug Something isn't working
Milestone

Comments

@AbdelrahmanElawady
Copy link
Collaborator

AbdelrahmanElawady commented Mar 7, 2024

What happened?

Peer router method Use accepts middlewares but does not actually use them.

which network/s did you face the problem on?

Dev

@AbdelrahmanElawady AbdelrahmanElawady added type_bug Something isn't working rmb-sdk belongs to rmb labels Mar 7, 2024
@rawdaGastan rawdaGastan self-assigned this Mar 7, 2024
@rawdaGastan rawdaGastan added this to the 1.0.0 milestone Mar 7, 2024
@rawdaGastan
Copy link
Collaborator

Tested on farmerbot

  • auth middleware for power subroutes
$ cd ../poweroff && go run main.go
2024/03/07 12:44:58 you are not authorized for this action. your twin id is `81`, only the farm owner with twin id `164` is authorized
exit status 1

$ cd ../poweron && go run main.go
2024/03/07 12:45:05 you are not authorized for this action. your twin id is `81`, only the farm owner with twin id `164` is authorized
exit status 1

$ cd ../includenode && go run main.go
2024/03/07 12:45:19 you are not authorized for this action. your twin id is `81`, only the farm owner with twin id `164` is authorized
exit status 1
  • Tried version sub route and worked fine without the middleware
$ cd ../version && go run main.go
version: v0.14.11

@AbdelrahmanElawady
Copy link
Collaborator Author

Verified:

Tried it in this commit and worked fine.

requests to the node under admin subroute responded with "unauthorized" (if not the farm owner)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rmb-sdk belongs to rmb type_bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants