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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify permission check in x/validators #527

Closed
husio opened this issue Apr 15, 2019 · 0 comments · Fixed by #600
Closed

Simplify permission check in x/validators #527

husio opened this issue Apr 15, 2019 · 0 comments · Fixed by #600
Assignees

Comments

@husio
Copy link
Contributor

husio commented Apr 15, 2019

The current implementation of permission check in x/validators is very indirect and hard to track down.

To undestand permissions check this chain must be followed
1 -> 2 -> 3 -> 4 -> 5 -> 6

I believe this whole chain of indirection can be reduced to a single line in which we directly ensure permissions using auth instance.

auth.HasAddress(ctx, addr)

This is how we check permission everywhere, so I believe there is no reason to not code this logic into the application.

@ethanfrey ethanfrey mentioned this issue Apr 15, 2019
31 tasks
@husio husio self-assigned this May 8, 2019
husio added a commit that referenced this issue May 8, 2019
- remove controller and authenticate directly in the handler
- implement a custom bucket type instead of using orm.Bucket and helper
  functions
- remove custom errors and use those declared in errors package instead
- wrap all returned errors and provide additional description

resolve #527
husio added a commit that referenced this issue May 8, 2019
- remove controller and authenticate directly in the handler
- implement a custom bucket type instead of using orm.Bucket and helper
  functions
- remove custom errors and use those declared in errors package instead
- wrap all returned errors and provide additional description

resolve #527
@husio husio closed this as completed in #600 May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant