-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete user rbac attachments on deletion of users (#271)
* Delete user rbac attachments on deletion of users * Add a DeleteUser method so we can delete rbac attachments for a user. * Make noop.go fully no-op (makes sure that a call to DeleteUser) even with RBAC off is OK. All other endpoints now fully no-op for consistency. * Introduce a UserHandler to contain dependencies for the user handlers * Fix tests post merge * Move handler deps to providers * Created a RBAC Provider * Created a User Provider * Fix linting issues
- Loading branch information
Showing
13 changed files
with
273 additions
and
192 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package providers | ||
|
||
import ( | ||
"github.com/labstack/echo" | ||
) | ||
|
||
// RBACProvider provides all the handler endpoints for RBAC actions. | ||
type RBACProvider interface { | ||
AddRole(c echo.Context) error | ||
DeleteRole(c echo.Context) error | ||
GetAllRoles(c echo.Context) error | ||
GetUserAttachedRoles(c echo.Context) error | ||
GetRolesAttachedUsers(c echo.Context) error | ||
AttachRole(c echo.Context) error | ||
DetachRole(c echo.Context) error | ||
} | ||
|
||
// UserProvider provides all the handler endpoints for User actions. | ||
type UserProvider interface { | ||
UserLogin(c echo.Context) error | ||
UserGetAll(c echo.Context) error | ||
UserChangePassword(c echo.Context) error | ||
UserResetTriggerToken(c echo.Context) error | ||
UserDelete(c echo.Context) error | ||
UserAdd(c echo.Context) error | ||
UserGetPermissions(c echo.Context) error | ||
UserPutPermissions(c echo.Context) error | ||
} |
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.