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
9 changes: 4 additions & 5 deletions docs/endpoints/calendar_endpoint.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
## Endpoints
## Calendar Endpoints

### Overview


This API interacts with the CSH Google calendar to pull the number of events set in the .env file to display in the calendar widget on Jumpstart

---

### Authentication

This API does **not** implement authentication by default.
If you deploy in production, you should secure the API (e.g., with a reverse proxy, network policy, or FastAPI dependencies).
The API we are using does not require authenication. It just needs the Public URL of the calendar. This can be any calendar for testing purposes.

---

Expand All @@ -21,7 +20,7 @@ If you deploy in production, you should secure the API (e.g., with a reverse pro
Example error response:
```json
{
"error": "Vault is sealed, cannot store credentials."
"error": "Failed to fetch the Calendar!"
}
```

Expand Down
18 changes: 18 additions & 0 deletions docs/endpoints/wikithoughts.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Wiki Thoughts Endpoints

### Overview

This is a builtin API from MediaWiki and allows us to pull sections from the Wiki that are formatted in a certain way. See Wiki Thoughts Core for more info.

### Authentication

The MediaWiki API requires authentication in the form of a bot user. Credentials can be made [here](https://wiki.csh.rit.edu/wiki/Special:BotPasswords). You will also have to specify a category to pull from the Wiki, which for jumpstart is "Jumpstart Curated".

### Error Handling

In the event of an Error, the API will log an error and display default text

```json
{
"WARNING": "508 Bot is not authenticated, cancelling fetch of category pages"
}
```

::: api.endpoints.wikithought
8 changes: 4 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ use_directory_urls: false
nav:
- Home: index.md
- Getting Started: getting-started/getting-started.md
- Core:
- Wikithoughts: core/Wiki-thoughts.md
- Calendar: core/CSH Calendar.md
- Slack: core/Slack.md
- Endpoints:
- Calendar: endpoints/calendar_endpoint.md
- Announcements: endpoints/announcements.md
- Slack Bot: endpoints/slack_bot.md
- Wiki Thoughts: endpoints/wikithoughts.md
- Core:
- Calendar: core/CSH Calendar.md
- Slack: core/Slack.md
- Wikithoughts: core/Wiki-thoughts.md
- Scripts:
- Setup: getting-started/setup.md

Expand Down
2 changes: 2 additions & 0 deletions src/api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ async def message_actions(payload: str = Form(...)) -> JSONResponse:
"""

try:
logger.info(f"Received payload: {payload}")
form_json: dict = json.loads(payload)
logger.info(f"Parsed form_json: {form_json}")
response_url = form_json.get("response_url")

if form_json.get("type") != "block_actions":
Expand Down
Loading