Skip to content

Commit b12d514

Browse files
Merge pull request #218 from swamphacks/dev
Release 1.3
2 parents f2c7f3f + d586236 commit b12d514

19 files changed

Lines changed: 902 additions & 94 deletions

File tree

‎apps/api/docs/docs.go‎

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎apps/api/docs/swagger.json‎

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,47 @@
16801680
]
16811681
}
16821682
},
1683+
"/events/{eventId}/application/download-resume": {
1684+
"get": {
1685+
"description": "This handler creates a presigned S3 URL with GET permission for the user's specific object, which is their uploaded resume. The client can use this URL to download the object.",
1686+
"responses": {
1687+
"200": {
1688+
"content": {
1689+
"application/json": {
1690+
"schema": {
1691+
"type": "string"
1692+
}
1693+
}
1694+
},
1695+
"description": "OK"
1696+
},
1697+
"400": {
1698+
"content": {
1699+
"application/json": {
1700+
"schema": {
1701+
"$ref": "#/components/schemas/response.ErrorResponse"
1702+
}
1703+
}
1704+
},
1705+
"description": "Bad request/Malformed request."
1706+
},
1707+
"500": {
1708+
"content": {
1709+
"application/json": {
1710+
"schema": {
1711+
"$ref": "#/components/schemas/response.ErrorResponse"
1712+
}
1713+
}
1714+
},
1715+
"description": "Server Error: error handling download resume request"
1716+
}
1717+
},
1718+
"summary": "Download the user's uploaded resume from their event application",
1719+
"tags": [
1720+
"Application"
1721+
]
1722+
}
1723+
},
16831724
"/events/{eventId}/application/save": {
16841725
"post": {
16851726
"description": "Save user's progress on the application. File/Upload fields are not saved.",
@@ -3108,6 +3149,89 @@
31083149
]
31093150
}
31103151
},
3152+
"/teams/{teamId}/members/{userId}": {
3153+
"delete": {
3154+
"description": "Kicks a member from a team. Only the team owner can perform this action.",
3155+
"parameters": [
3156+
{
3157+
"description": "The authenticated session token/id",
3158+
"in": "cookie",
3159+
"name": "sh_session_id",
3160+
"required": true,
3161+
"schema": {
3162+
"type": "string"
3163+
}
3164+
},
3165+
{
3166+
"description": "The ID of the team",
3167+
"in": "path",
3168+
"name": "team_id",
3169+
"required": true,
3170+
"schema": {
3171+
"type": "string"
3172+
}
3173+
},
3174+
{
3175+
"description": "The ID of the user to be kicked",
3176+
"in": "path",
3177+
"name": "userId",
3178+
"required": true,
3179+
"schema": {
3180+
"type": "string"
3181+
}
3182+
}
3183+
],
3184+
"responses": {
3185+
"204": {
3186+
"description": "Successfully kicked the team member"
3187+
},
3188+
"400": {
3189+
"content": {
3190+
"application/json": {
3191+
"schema": {
3192+
"$ref": "#/components/schemas/response.ErrorResponse"
3193+
}
3194+
}
3195+
},
3196+
"description": "Bad Request: Missing or malformed parameters."
3197+
},
3198+
"401": {
3199+
"content": {
3200+
"application/json": {
3201+
"schema": {
3202+
"$ref": "#/components/schemas/response.ErrorResponse"
3203+
}
3204+
}
3205+
},
3206+
"description": "Unauthenticated: Requester is not currently authenticated."
3207+
},
3208+
"403": {
3209+
"content": {
3210+
"application/json": {
3211+
"schema": {
3212+
"$ref": "#/components/schemas/response.ErrorResponse"
3213+
}
3214+
}
3215+
},
3216+
"description": "Forbidden: Requester is not allowed to perform this action."
3217+
},
3218+
"500": {
3219+
"content": {
3220+
"application/json": {
3221+
"schema": {
3222+
"$ref": "#/components/schemas/response.ErrorResponse"
3223+
}
3224+
}
3225+
},
3226+
"description": "Something went wrong."
3227+
}
3228+
},
3229+
"summary": "Kick a member from a team",
3230+
"tags": [
3231+
"Team"
3232+
]
3233+
}
3234+
},
31113235
"/teams/{teamId}/pending-joins": {
31123236
"get": {
31133237
"description": "Retrieves a team's pending join requests. This is only allowed for the team's owner.",

‎apps/api/docs/swagger.yaml‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,33 @@ paths:
11571157
summary: Get Application By User and Event ID
11581158
tags:
11591159
- Application
1160+
/events/{eventId}/application/download-resume:
1161+
get:
1162+
description: This handler creates a presigned S3 URL with GET permission for
1163+
the user's specific object, which is their uploaded resume. The client can
1164+
use this URL to download the object.
1165+
responses:
1166+
"200":
1167+
content:
1168+
application/json:
1169+
schema:
1170+
type: string
1171+
description: OK
1172+
"400":
1173+
content:
1174+
application/json:
1175+
schema:
1176+
$ref: '#/components/schemas/response.ErrorResponse'
1177+
description: Bad request/Malformed request.
1178+
"500":
1179+
content:
1180+
application/json:
1181+
schema:
1182+
$ref: '#/components/schemas/response.ErrorResponse'
1183+
description: 'Server Error: error handling download resume request'
1184+
summary: Download the user's uploaded resume from their event application
1185+
tags:
1186+
- Application
11601187
/events/{eventId}/application/save:
11611188
post:
11621189
description: Save user's progress on the application. File/Upload fields are
@@ -1876,6 +1903,59 @@ paths:
18761903
summary: Get a team and its members by team id.
18771904
tags:
18781905
- Team
1906+
/teams/{teamId}/members/{userId}:
1907+
delete:
1908+
description: Kicks a member from a team. Only the team owner can perform this
1909+
action.
1910+
parameters:
1911+
- description: The authenticated session token/id
1912+
in: cookie
1913+
name: sh_session_id
1914+
required: true
1915+
schema:
1916+
type: string
1917+
- description: The ID of the team
1918+
in: path
1919+
name: team_id
1920+
required: true
1921+
schema:
1922+
type: string
1923+
- description: The ID of the user to be kicked
1924+
in: path
1925+
name: userId
1926+
required: true
1927+
schema:
1928+
type: string
1929+
responses:
1930+
"204":
1931+
description: Successfully kicked the team member
1932+
"400":
1933+
content:
1934+
application/json:
1935+
schema:
1936+
$ref: '#/components/schemas/response.ErrorResponse'
1937+
description: 'Bad Request: Missing or malformed parameters.'
1938+
"401":
1939+
content:
1940+
application/json:
1941+
schema:
1942+
$ref: '#/components/schemas/response.ErrorResponse'
1943+
description: 'Unauthenticated: Requester is not currently authenticated.'
1944+
"403":
1945+
content:
1946+
application/json:
1947+
schema:
1948+
$ref: '#/components/schemas/response.ErrorResponse'
1949+
description: 'Forbidden: Requester is not allowed to perform this action.'
1950+
"500":
1951+
content:
1952+
application/json:
1953+
schema:
1954+
$ref: '#/components/schemas/response.ErrorResponse'
1955+
description: Something went wrong.
1956+
summary: Kick a member from a team
1957+
tags:
1958+
- Team
18791959
/teams/{teamId}/members/me:
18801960
delete:
18811961
description: Leaves a team if the requester is on the team. Depends on cookies

‎apps/api/internal/api/api.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func (api *API) setupRoutes(mw *mw.Middleware) {
115115
r.Get("/{teamId}", api.Handlers.Teams.GetTeam)
116116
r.Get("/{teamId}/pending-joins", api.Handlers.Teams.GetPendingRequestsForTeam)
117117
r.Delete("/{teamId}/members/me", api.Handlers.Teams.LeaveTeam)
118+
r.Delete("/{teamId}/members/{userId}", api.Handlers.Teams.KickMemberFromTeam)
118119
r.Post("/join/{requestId}/accept", api.Handlers.Teams.AcceptTeamJoinRequest)
119120
r.Post("/join/{requestId}/reject", api.Handlers.Teams.RejectTeamJoinRequest)
120121
})

‎apps/api/internal/api/handlers/auth.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func NewAuthHandler(authService *services.AuthService, cfg *config.Config, logge
3939
// @Success 200 {object} middleware.UserContext
4040
// @Failure 401 {object} response.ErrorResponse "Unauthenticated: Requester is not currently authenticated."
4141
// @Failure 500 {object} response.ErrorResponse
42-
// @Router /auth/me [get]
42+
// @Router /auth/me [get]
4343
func (h *AuthHandler) GetMe(w http.ResponseWriter, r *http.Request) {
4444
user, err := h.authService.GetMe(r.Context())
4545
if err != nil {

0 commit comments

Comments
 (0)