Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions apps/api/docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions apps/api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,47 @@
]
}
},
"/events/{eventId}/application/download-resume": {
"get": {
"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.",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
},
"description": "OK"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Bad request/Malformed request."
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Server Error: error handling download resume request"
}
},
"summary": "Download the user's uploaded resume from their event application",
"tags": [
"Application"
]
}
},
"/events/{eventId}/application/save": {
"post": {
"description": "Save user's progress on the application. File/Upload fields are not saved.",
Expand Down Expand Up @@ -3108,6 +3149,89 @@
]
}
},
"/teams/{teamId}/members/{userId}": {
"delete": {
"description": "Kicks a member from a team. Only the team owner can perform this action.",
"parameters": [
{
"description": "The authenticated session token/id",
"in": "cookie",
"name": "sh_session_id",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The ID of the team",
"in": "path",
"name": "team_id",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The ID of the user to be kicked",
"in": "path",
"name": "userId",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"204": {
"description": "Successfully kicked the team member"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Bad Request: Missing or malformed parameters."
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Unauthenticated: Requester is not currently authenticated."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Forbidden: Requester is not allowed to perform this action."
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/response.ErrorResponse"
}
}
},
"description": "Something went wrong."
}
},
"summary": "Kick a member from a team",
"tags": [
"Team"
]
}
},
"/teams/{teamId}/pending-joins": {
"get": {
"description": "Retrieves a team's pending join requests. This is only allowed for the team's owner.",
Expand Down
80 changes: 80 additions & 0 deletions apps/api/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,33 @@ paths:
summary: Get Application By User and Event ID
tags:
- Application
/events/{eventId}/application/download-resume:
get:
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.
responses:
"200":
content:
application/json:
schema:
type: string
description: OK
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: Bad request/Malformed request.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: 'Server Error: error handling download resume request'
summary: Download the user's uploaded resume from their event application
tags:
- Application
/events/{eventId}/application/save:
post:
description: Save user's progress on the application. File/Upload fields are
Expand Down Expand Up @@ -1876,6 +1903,59 @@ paths:
summary: Get a team and its members by team id.
tags:
- Team
/teams/{teamId}/members/{userId}:
delete:
description: Kicks a member from a team. Only the team owner can perform this
action.
parameters:
- description: The authenticated session token/id
in: cookie
name: sh_session_id
required: true
schema:
type: string
- description: The ID of the team
in: path
name: team_id
required: true
schema:
type: string
- description: The ID of the user to be kicked
in: path
name: userId
required: true
schema:
type: string
responses:
"204":
description: Successfully kicked the team member
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: 'Bad Request: Missing or malformed parameters.'
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: 'Unauthenticated: Requester is not currently authenticated.'
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: 'Forbidden: Requester is not allowed to perform this action.'
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/response.ErrorResponse'
description: Something went wrong.
summary: Kick a member from a team
tags:
- Team
/teams/{teamId}/members/me:
delete:
description: Leaves a team if the requester is on the team. Depends on cookies
Expand Down
1 change: 1 addition & 0 deletions apps/api/internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
fmt.Printf("%v", err)
}

fmt.Fprintln(w, htmlContent)

Check failure on line 77 in apps/api/internal/api/api.go

View workflow job for this annotation

GitHub Actions / API Lint

Error return value of `fmt.Fprintln` is not checked (errcheck)
})

// Health check
Expand Down Expand Up @@ -115,6 +115,7 @@
r.Get("/{teamId}", api.Handlers.Teams.GetTeam)
r.Get("/{teamId}/pending-joins", api.Handlers.Teams.GetPendingRequestsForTeam)
r.Delete("/{teamId}/members/me", api.Handlers.Teams.LeaveTeam)
r.Delete("/{teamId}/members/{userId}", api.Handlers.Teams.KickMemberFromTeam)
r.Post("/join/{requestId}/accept", api.Handlers.Teams.AcceptTeamJoinRequest)
r.Post("/join/{requestId}/reject", api.Handlers.Teams.RejectTeamJoinRequest)
})
Expand Down
2 changes: 1 addition & 1 deletion apps/api/internal/api/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewAuthHandler(authService *services.AuthService, cfg *config.Config, logge
// @Success 200 {object} middleware.UserContext
// @Failure 401 {object} response.ErrorResponse "Unauthenticated: Requester is not currently authenticated."
// @Failure 500 {object} response.ErrorResponse
// @Router /auth/me [get]
// @Router /auth/me [get]
func (h *AuthHandler) GetMe(w http.ResponseWriter, r *http.Request) {
user, err := h.authService.GetMe(r.Context())
if err != nil {
Expand Down
Loading
Loading