Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Feature/1182 collaborator api communication with keycloak #1184

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
45cf135
feat: authenticate with keycloak and get users
Bushuo Jan 27, 2024
9d89b88
refactor: change structure
Bushuo Jan 28, 2024
0aed4d5
refactor: improve api
Bushuo Jan 28, 2024
17f9a20
feat: thread safety
Bushuo Jan 28, 2024
5130c23
tests: add load-test testing thread safety
Bushuo Jan 30, 2024
fb8a79d
fix: use a mutex instead of rwlock
Bushuo Feb 5, 2024
9436250
fix: wrong url
Bushuo Feb 5, 2024
731fdaf
feat: add role parsing
Bushuo Feb 6, 2024
c107799
wip: map collaborator api
Bushuo Feb 9, 2024
a5f6a2a
feat: find all map collaborators
Bushuo Feb 9, 2024
846c6d1
chore: fix some warnings, improve docs
Bushuo Feb 10, 2024
dcf537b
feat: search for users by their username
Bushuo Feb 10, 2024
5bd4dc4
refactor: improvements
Bushuo Feb 10, 2024
6527d5c
chore: add changelog
Bushuo Feb 10, 2024
937f0c7
feat: delete collaborators from a map
Bushuo Feb 10, 2024
e26ca38
chore: update docs
Bushuo Feb 10, 2024
9208fbc
fix: tests
Bushuo Feb 10, 2024
73063c8
chore: fix doc links
Bushuo Feb 10, 2024
907b099
fix: tests
Bushuo Feb 10, 2024
3673c89
refactor: yeet oath2 lib, yank secrecy lib, make auth lit 🔥
Bushuo Feb 14, 2024
f45998e
chore: improve load testing docs, adapt env.sample
Bushuo Feb 15, 2024
3293457
chore: add docs for keycloak admin rest api setup
Bushuo Feb 15, 2024
b585677
wip: pagination of user api
Bushuo Feb 15, 2024
da1886c
feat: pagination for user_search
Bushuo Feb 15, 2024
19252ce
wip: polymorphic keycloak api
Bushuo Feb 15, 2024
5e84d6f
feat: mock api if keycloak env is not set
Bushuo Feb 16, 2024
1ce1aff
chore: rename owner to creator in comments
Bushuo Feb 16, 2024
32446ff
tests: fix keycloak api initialization
Bushuo Feb 16, 2024
60ebcad
chore: fix remaining occurrences of AUTH_DISCOVERY_URL
Bushuo Feb 17, 2024
8fe651c
refactor: fix bad variable names
Bushuo Feb 17, 2024
eb9ad63
fix: collaborators not matching user_ids
Bushuo Feb 17, 2024
e66a7d6
fix: implement transaction according to diesel_async readme
Bushuo Feb 17, 2024
de11fd4
refactor: pull out magic number into constant
Bushuo Feb 18, 2024
7555d8f
fix: remove unused variables
Bushuo Feb 26, 2024
ec5e929
fix: timeline bcs rebase
Bushuo Mar 2, 2024
2f63f2b
refactor: map form into one form component
Bushuo Feb 11, 2024
86ad2ea
fix: translations
Bushuo Feb 11, 2024
02525cd
feat: collaborator panel and some hooks
Bushuo Feb 12, 2024
29c3464
feat: add/remove collaborators in frontend
Bushuo Feb 14, 2024
aeb31d6
chore: update vite & fix story
Bushuo Mar 27, 2024
1a21ad4
chore: update snapshots
Bushuo Mar 27, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ BIND_ADDRESS_PORT=8080
VITE_BASE_API_URL=http://localhost:8080
VITE_NEXTCLOUD_URI=https://cloud.permaplant.net
# OAuth2 (other URLs will be fetched from this URL)
AUTH_DISCOVERY_URI=https://auth.permaplant.net/realms/PermaplanT/.well-known/openid-configuration
AUTH_HOST=https://auth.permaplant.net
AUTH_CLIENT_ID=localhost
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"name": "Debug",
"program": "${workspaceFolder}/backend/target/debug/backend",
"args": [],
"cwd": "${workspaceFolder}/backend"
"cwd": "${workspaceFolder}/backend",
"envFile": "${workspaceFolder}/backend/.env"
},
{
"type": "chrome",
Expand Down
7 changes: 6 additions & 1 deletion backend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ BIND_ADDRESS_HOST=127.0.0.1
BIND_ADDRESS_PORT=8080

# OAuth2 (other URLs will be fetched from this URL)
AUTH_DISCOVERY_URI=https://auth.permaplant.net/realms/PermaplanT/.well-known/openid-configuration
AUTH_HOST=https://auth.permaplant.net
AUTH_CLIENT_ID=localhost

# Keycloak API Credentials (will be used to fetch user info)
# If you do not want to setup keycloak locally, leave these empty, the api will return dummy data
AUTH_ADMIN_CLIENT_ID=configured-in-keycloak
AUTH_ADMIN_CLIENT_SECRET=configured-in-keycloak

# Logging config (will be used by env_logger)
RUST_LOG='backend=debug,actix_web=debug'
87 changes: 50 additions & 37 deletions backend/Cargo.lock

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

4 changes: 3 additions & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ env_logger = "0.10.0"
futures = "0.3.28"
futures-util = "0.3.30"
image = { version = "0.24.6", default-features = false, features = ["png"] }

secrecy = { version = "0.8", features = ["serde"] }
url = "2.5.0"
async-trait = "0.1.77"

[dev-dependencies]
jsonwebkey = { version = "0.3.5", features = ["generate", "jwt-convert"] }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS map_collaborators;
7 changes: 7 additions & 0 deletions backend/migrations/2024-02-07-205556_map_collaborators/up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS map_collaborators (
map_id integer NOT NULL,
user_id uuid NOT NULL,
created_at timestamp without time zone NOT NULL,
FOREIGN KEY (map_id) REFERENCES maps (id) ON DELETE CASCADE,
PRIMARY KEY (map_id, user_id)
);
Loading