wip/kick #36
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: gorb/backend#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wip/kick"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added the member endpoint, with a get and a delete(kick) request method
Needs changes
@ -0,0 +10,4 @@
mod uuid;
pub fn router(app_state: Arc<AppState>) -> Router<Arc<AppState>> {
this router should not have a layer and merging it with an empty router is pointless here, function body should be written as:
and the function should not need the
app_state
parameter@ -0,0 +38,4 @@
State(app_state): State<Arc<AppState>>,
Path(member_uuid): Path<Uuid>,
Extension(CurrentUser(uuid)): Extension<CurrentUser<Uuid>>,
) -> Result<impl IntoResponse, Error> {
instead of calling
app_state.pool.get().await?
on multiple functions you should define it and use the same one multiple times@ -30,2 +31,3 @@
.nest("/auth", auth::router(app_state.clone()))
.nest("/channels", channels::router(app_state))
.nest("/channels", channels::router(app_state.clone()))
.nest("/member", member::router(app_state))
this should be moved to the router_with_auth instead as all endpoints inside /members needs auth, also it should be
/members
plural and not/member
singular. This also goes for the folder/module namewhy plural, we are only accessing a single member
@baaboe wrote in #36 (comment):
Because it’s accessing a singular resource from the
members
resource collection. It’s a REST API thing./members
contains all members, even though you're only accessing one, think of it like a folder tree with /members containing all of the members of every guild out there but you only have access to a subset of themthe
get()
function needs to check membership, missed it in the review. A user that is not a member of a server should not be able to view members of that server