Commit graph

94 commits

Author SHA1 Message Date
67af0c1e74 feat: add channel endpoint 2025-05-07 17:24:56 +02:00
cf1476f641 fix: correct merge error 2025-05-05 21:16:09 +02:00
beb9fc10ba feat: use new auth and convert to get request 2025-05-04 23:40:03 +02:00
fb76e6df08 feat: use new auth 2025-05-04 23:39:36 +02:00
c9d3b2cd12 Merge branch 'main' into wip/messaging 2025-05-04 23:24:10 +02:00
c2bface373 Merge pull request 'wip/authorization-header' (#7) from wip/authorization-header into main
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
Reviewed-on: #7
Reviewed-by: SauceyRed <saucey@saucey.red>

Uses authorization headers instead of keeping access_token and refresh_token in body.

auth header is used for `access_token`

## Changes
Moved everything to /api

### POST -> GET /v1/users/me
Request: auth header

### POST -> GET /v1/users/{uuid}
Request: auth header

### POST -> GET /v1/users
Request: auth header and query params `start=int` and `amount=int`

### POST /v1/auth/register
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/login
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/refresh
Request: cookie `refresh_token`
Response: Remove `refresh_token` from body and instead set-cookie `refresh_token`

### POST /v1/auth/revoke
Request: auth header (password still in body)
2025-05-04 21:18:27 +00:00
c61f96ffe7 feat: expire refresh_token immediately on unauthorized response 2025-05-04 23:02:17 +02:00
0f897dc0c6 feat: return refresh_token in cookie 2025-05-04 22:13:28 +02:00
ebb4286c08 refactor: move api to /api
serve api under /api
2025-05-04 22:13:05 +02:00
f12f81d584 fix: extract auth value 2025-05-04 21:30:33 +02:00
a3846a2620 fix: use correct header 2025-05-04 20:30:28 +02:00
cbf0131d14 feat: switch to headers for auth 2025-05-04 19:09:12 +02:00
6c706d973e style: use created_at instead of created 2025-05-04 19:09:06 +02:00
aa865e2ed4 feat: add utils.rs
provides a function that extracts auth header from headers
2025-05-04 18:11:12 +02:00
776750578d style: 🎨 restructure server folder 2025-05-04 06:25:01 +02:00
d72214eb56 fix: make server channel template not error out 2025-05-04 01:18:24 +02:00
6abd2a9d52 feat: implement guild fetching with uuid
only returns if you are a member of the guild in question
2025-05-04 01:17:25 +02:00
f9e1e276f0 feat: implement guild creation 2025-05-04 01:16:57 +02:00
8883ff6400 feat: modify existing tables and add more tables for servers/chatting 2025-05-04 01:16:14 +02:00
8241196284 feat: add boilerplate rust files 2025-05-03 05:32:22 +02:00
34b984a1b5 feat: add tables for guilds, members, channels, messages, emojis and reactions 2025-05-03 05:31:35 +02:00
838947a7ca build: add tokio-tungstenite dependency 2025-05-03 05:27:38 +02:00
bcf857d6b2 refactor: flatten login function
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 20:32:13 +02:00
0d07af7d79 feat: style: return unauthorized when token isnt found and flatten function structure
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 19:26:37 +02:00
1d7cdf343b feat: add users endpoint and add me and uuid under it
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
Adds a users endpoint that returns all users on the server, will require instance permissions in future.
Place previous user requests under users to avoid having multiple endpoints.
2025-05-02 19:19:59 +02:00
cc07d78325 build: add a run-dev.sh for local testing
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 16:23:45 +02:00
2c73a07961 build: use one log file instead of 2 2025-05-02 16:23:11 +02:00
c76fd73179 refactor: move regex code to mod.rs 2025-05-02 16:22:30 +02:00
0ccfa53746 docs: remove left over comment 2025-05-02 16:21:44 +02:00
97f7595cc5 style: cargo clippy and format
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 15:20:22 +02:00
5d0d666094 ci: remove unused cross file
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 14:52:28 +02:00
b853ed3e98 use docker as build system
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 14:23:50 +02:00
4295e93134 ci: dont use tee
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:53:03 +02:00
ad4effd425 ci: specify path for tee since the command wasnt found
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
I have no idea how this even happened, it should be included in the image
2025-05-02 13:50:06 +02:00
f020345e8a ci: install docker in rust container
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:46:03 +02:00
040be2126c ci: try using cross for cross compile
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:38:33 +02:00
3647dbcd41 ci: add musl-dev
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:25:50 +02:00
eaa4fab96f Revert "ci: add step to install libssl-dev"
This reverts commit df99a1effe.
2025-05-02 13:24:52 +02:00
df99a1effe ci: add step to install libssl-dev
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:18:13 +02:00
dc5ac8889a ci: try using alpine for cross
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:13:01 +02:00
0f94bfbd28 fix: add missing dashes
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 13:09:24 +02:00
b16d9c3b71 ci: build for x86_64 and arm64
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
This is an *attempt* to make the build system work for arm64 images as well, fingers crossed!
2025-05-02 13:08:24 +02:00
8f611c5d37 chore: use debian:12-slim in docker 2025-05-02 13:07:41 +02:00
481c2c3648 feat: use a logging library
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
gives us logs from actix and sqlx that otherwise arent exposed to us
2025-05-02 01:18:13 +02:00
80111af3de chore: use image from forgejo container registry
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 00:41:26 +02:00
280e989c4b ci: remove unused docker commands
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-05-02 00:34:46 +02:00
6c53d23bb7 ci: use --push on docker build
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 00:29:43 +02:00
28fdcdcd3e ci: add missing tag to push
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 00:26:11 +02:00
f6888b1803 ci: use environment instead of settings
Some checks failed
ci/woodpecker/push/build-and-publish Pipeline failed
2025-05-02 00:22:48 +02:00
7ad2771f52 ci: add build and docker publish ci 2025-05-02 00:21:18 +02:00