Commit graph

1589 commits

Author SHA1 Message Date
Zack
df9c71edb2
feat: returns if user is new for both oauth and password login (#67)
* feat: returns if user is new for both oauth and password login

* test: add test for firt time sign_in and subsequent

* chore: remove uneeded use

* fix: compile

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-09-21 14:05:25 +08:00
Zack
bbc913e45f
feat: support name for oauth sign in (#65)
* feat: support name for oauth sign in

* fix: add sqlx metadata

* feat: improve api, add name modifications

* fix: add sqlx query metadata
2023-09-21 09:28:07 +08:00
Nathan.fooo
ca0813e265
refactor: ws ping (#66)
* chore: ws client

* chore: update ws ping

* chore: fix test

* chore: public funcs

* chore: fix test

* chore: check clent-api compile
2023-09-20 20:53:39 +08:00
Zack
0676db7ed6
feat: Workspace members (#63)
* fix: create user if they sign up with oauth

* feat: add workspaces_members add and remove operations

* feat: add insert workspace members

* feat: attach db ops to api ops

* refactor: separate user and workspace scope

* chore: add sqx query metadata

* chore: add 2nd registered user for testing

* ci: use valid email

* ci: fix registered password invalid

* fix: use email instead of uid

* fix: use email instead of uid sqlx query metadata

* feat: add test for workspace member

* test: added workspace add and delete with checking

* ci: fix email
2023-09-19 20:59:16 +08:00
Nathan.fooo
923a9b41fe
chore: expost entity from client-api (#64) 2023-09-19 11:29:02 +08:00
Zack
a201cceb9b
Merge pull request #62 from AppFlowy-IO/nginx
Nginx: Routing SSL and Non SSL
2023-09-19 09:38:07 +08:00
Zack
02474c80c4
Merge pull request #59 from AppFlowy-IO/entity_api
fix: use borrow
2023-09-19 09:34:04 +08:00
Fu Zi Xiang
7c2204f41a
fix: dev: remove appflowy_cloud as dep in docker compose 2023-09-18 21:18:58 +08:00
Fu Zi Xiang
2352f3dcab
fix: add authorize for gotrue 2023-09-18 20:57:36 +08:00
Fu Zi Xiang
79c8b9478f
feat: nginx reroute callback and verify 2023-09-18 20:49:54 +08:00
Fu Zi Xiang
73be24ad2b
fix: use borrow 2023-09-18 11:59:35 +08:00
Nathan.fooo
7ae645a7c1
test: add ws reconnect test (#58)
* test: add test

* test: add reconnect
2023-09-18 11:42:32 +08:00
Zack
6c4bbbbf7f
feat: Nginx (#57)
* feat: added nginx to docker-compose

* ci: base64 decode for cert and key

* test: fix: wrap secert with double quote

* fix: revert previous cert dir

* feat: use 443 for default https port in nginx

* fix: correct 443 (from 433)

* fix: use correct github action secrets

* fix: use docker compose force recreate

* fix: use another crt and key

* fix: use appflowy cloud crt and key
2023-09-18 11:42:18 +08:00
Nathan.fooo
8f8f6af0f9
feat: Integrate to client (#52)
* refactor: ws client

* chore: update

* chore: update

* chore: add ext_url

* chore: rename structs

* chore: add token notify
2023-09-17 12:52:44 +08:00
Nathan.fooo
d24c13692a
feat: remove actix-web deps from client_api (#49)
* chore: remove actix-web deps

* chore: fix client error

* chore: expose error

* chore: delete tests
2023-09-16 09:31:47 +08:00
Zack
3c598f178e
ci: test env docker-compose deployment (#48)
* ci: test env docker-compose deployment

* ci: test deployment

* fix: replace delimiter with pipe to avoid conflict

* fix: API_EXTERNAL_URL_TEST from secrets

* chore: remove unneeded deploy when pull request

* fix: cloud public host name/address

* chore: trigger: change to push

* chore: add ext_url for exposed gotrue auth server
2023-09-15 21:13:43 +08:00
Nathan.fooo
e9fc2af43c
feat: implement websocket client (#47)
* feat: implement websocket client

* chore: clippy

* chore: update

* chore: update env
2023-09-15 12:11:04 +08:00
Zack
7345da7c46
feat: Autorefresh (#44)
* feat: use gotrue from source instead of docker hub image

* test: fix test due to gotrue upgrade

* fix: update prod docker-compose

* chore: cargo fmt --all

* chore: cargo fmt --all

* feat: autorefresh

* test: add test case and auto refresh scenario
2023-09-15 11:21:05 +08:00
Nathan.fooo
939ea29c3b
feat: Realtime multiple conn test(#45)
* chore: multiple connection with same user

* chore: connect with device id

* fix: multiple connection

* test: add more test

* chore: fmt
2023-09-15 09:59:37 +08:00
Zack
9fc2acbc35
feat: Docker/gotrue (#43)
* feat: use gotrue from source instead of docker hub image

* test: fix test due to gotrue upgrade

* fix: update prod docker-compose

* chore: cargo fmt --all
2023-09-14 20:41:04 +08:00
Zack
b3be09e264
feat: added refresh ability on server and client (#41)
* feat: added refresh ability on server and client

* fix: use refresh token for refresh and add test case

* chore: cargo fmt --all

* chore: cargo clippy

* fix: cargo clippy

* test: added async mutex for registered user for consistency

* fix: remove unneeded files

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-09-14 15:58:18 +08:00
Nathan.fooo
e03a6ce587
test: fix collab edit test (#42)
* test: fix

* chore: cargo sqlx check workspce

* chore: remove rocksdb deps
2023-09-14 14:05:15 +08:00
Nathan.fooo
b1adcc7919
test: websocket connect and then edit collab test (#40)
* refactor: realtime dir

* test: add test

* test: fix
2023-09-14 09:34:24 +08:00
Zack
8d11d7b6cf
feat: support external oauth (#35)
* feat: support external oauth

* chore: cargo fmt

* doc: add docs for google oauth2

* fix: use btree map and get for oauth

* feat: client to open url for oauth login

* feat: add test case for oauth not available

* feat: add placeholder for sign_in_url

* fix: use

* feat: client sign up with url

* feat: add sign_in_with_url simple test

* fix: use url fragments and string split

* fix: test case and gotrue error handling

* fix: return error and remove unwrap

* chore: remove unused file not in module tree

* fix: test cases

* chore: add cfg feature cloud to isolate dependencies
2023-09-13 21:08:13 +08:00
Nathan.fooo
c42158b7cb
test: add ws connect test (#39)
* test: add ws connect test

* chore: format log
2023-09-13 17:04:42 +08:00
Nathan.fooo
107627f4d8
feat: implement snapshot handler (#38) 2023-09-13 15:25:51 +08:00
Nathan.fooo
3aa4d20ad3
chore: reduce deps of client_api crate (#37) 2023-09-13 13:12:07 +08:00
Nathan.fooo
b32fcff4d4
test: Collab handler test (#36)
* chore: implement collab requests

* test: add more tests

* chore: update scope path
2023-09-13 12:52:22 +08:00
Nathan.fooo
f0f58f98f3
feat: create collab handlers (#34)
* feat: logged user after sign up/sign in

* test: fix test

* chore: update sqlx files

* chore: add router

* chore: parser user uuid from token
2023-09-12 21:52:25 +08:00
Zack
0d59211e55
feat: expose workspace and profile api (#32)
* feat: expose workspace and profile api

* feat: add impl for client_api

* feat: add test case for workspace and profile
2023-09-12 16:14:14 +08:00
Nathan.fooo
9ac53dca8e
chore: implement collab storage using postrges (#31)
* chore: implement collab storage using postrges

* chore: update collab rev

* chore: update .sqlx files
2023-09-12 15:36:33 +08:00
Zack
da03009004
feat: use apply server migration when server starts (#30)
* feat: use apply server migration when server starts

* fix: add docs and fix local run

* feat: refactor migration

* feat: local build server wait on gotrue

* fix: add back sqlx commands

* fix: add migrations directory

* fix: try SQLX_OFFLINE=true

* test: fix rustlint

* chore: clippy fmt

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-09-12 15:12:08 +08:00
Zack
853f089ca0
feat: test gotrue when app start, use state for gotrue client, use go… (#24)
* feat: test gotrue when app start, use state for gotrue client, use gotrue UUID instead of BIGINT for user uid

* feat: backward compatibility with native authetication

* fix: native auth use uuid instead

* fix: sqlx preparation

* fix: sqlx metadata and unused variable

* fix: clippy

* fix: create workspace if not exist after sign in

* chore: update .sqlx with new query

* feat: query workspace

* revert: revert using i64 for user id

* fix: update sqlx queries

* fix: update .sqlx metadata

* feat: only use uuid from sqlx types, select user_profile view

* ci: add version check

* ci: add missing sqlx files

* chore: cargo fmt
2023-09-11 17:16:41 +08:00
Nathan.fooo
d0fdde7bf5
chore: remove unused deps (#29)
* chore: remove unused deps

* tests: fix
2023-09-11 16:21:16 +08:00
Nathan.fooo
4e964677b3
refactor: return AppError (#28)
* refactor: return AppError

* chore: impl from response for AppResponse
2023-09-11 15:23:55 +08:00
Nathan.fooo
63c992602f
tests: fix realtime tests (#27)
* tests: fix realtime tests

* chore: update collab rev

* ci: fix realtime ci

* ci: update test path
2023-09-11 15:14:58 +08:00
Nathan.fooo
3cd3240bfc
chore: move realtime test (#26)
* chore: fix tests

* chore: add test server

* chore: move tests
2023-09-10 19:35:29 +08:00
Nathan.fooo
f964d14002
chore: kill the appflowy_cloud instance if it already exist (#25) 2023-09-10 12:37:08 +08:00
Nathan.fooo
4a56cbb91f
refactor: refactor app data struct (#23)
* refactor: refactor app data struct to reduce memory cost

* refactor: rename AppData to AppResponse

* chore: implement traits

* chore: remove default features of actix-web
2023-09-10 11:56:22 +08:00
Nathan.fooo
7a09e1b860
chore: remove redundant sqlx command (#22)
* chore: remove redundant sqlx command

* chore: remove docker_env.sh

* chore: copy sqlx to docker

* chore update
2023-09-08 22:51:16 +08:00
Nathan.fooo
186ce6c5af
fix: run_local_server script (#21) 2023-09-08 20:35:06 +08:00
Zack
d4577f5e61
Feat: enrich http dto (#20)
* feat: add scripts for easier dev

* feat: add Json<T> as resp type for http server

* feat: restructure server and client shared entity

* feat: restructure server and client shared entity

* feat: use serde_repr to deserialize enum into json number

* feat: minor adjustment to results and server error

* feat: test: fix unconfirmed email message

* feat: test: add test case for existing user

* feat: test: modified api for sign_out

* feat: test: add test case pass
2023-09-08 20:01:28 +08:00
Nathan.fooo
384501a00d
refactor: save collab data in pg (#19) 2023-09-08 19:41:35 +08:00
Nathan.fooo
c1f8d79169
chore: separate crates (#18) 2023-09-07 19:40:11 +08:00
Zack
36499be26c
docs: test + deploy + environmental variables (#14)
* doc: test + deploy + environmental variables

* doc: local dev and testing(WIP)

* dev: set up local testing

* fix: ci: add DATABASE_URL env

* chore: update .env

* ci: fix

* dev: docker-compose-dev.yml

* ci: update

* ci: test env

* ci: add services

* ci: add services

* ci: update port

* ci: rename ci.yaml to rustlint.yaml

* ci: test

* ci: simplify tests

* ci: use cargo sqlx commands directly

* ci: fix: registered user

* ci: fix: test registered user creation

* ci: fix: test registered user creation - 2

* ci: fix: debug docker ci

* ci: fix: docker integration registered user

* ci: fix: docker integration registered user

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-09-07 15:29:39 +08:00
Nathan.fooo
e2e6d79cb0
chore: create tables (#16)
* chore: create tables

* ci: remove postgres service

* chore: separate ci

* chore: run cargo clippy with sqlx offline mode

* refactor: create docker action

* chore: rename

* chore: update table

* chore: update supabase_admin

* chore: update supabase_admin

* chore: remove create auth.jwt function
2023-09-07 10:43:10 +08:00
Nathan.fooo
f9825d4221
feat: refactor server collab (#15)
* refactor: collab storage

* chore: fix test

* chore: update sqlx version

* chore: disable realtime test

* chore: sqlx prepare

* chore: remove init.sql
2023-09-06 18:22:40 +08:00
Zack
b28d5dda4c
feat: ci: dockerize gotrue auth server (#13)
* feat: ci: dockerize gotrue auth server

* feat: build: add gotrue to docker-compose

* fix: build: docker-compose + test

* feat: ci: simplify tests

* feat: ci: add back needed services for compilation

* fix: ci: github secrets

* fix: ci: use signup

* fix: ci: add export

* fix: test: generate unique email for registration to avoid conflict
2023-09-06 14:12:39 +08:00
Zack
c8ae099e90
feat: Auth server integration (#9)
* feat: integrate signup with gotrue auth server

* feat: added email and password sign in via auth server

* feat: added sign in scenarios and client handling

* fix: added missing files

* feat: refine api and store access token in client

* feat: impl token decode and placeholder for signout

* feat: added impl for logout with auth server

* feat: auth server dependency injection, client sign_out impl

* feat: abstract verify token, add placeholder for update endpoint

* feat: make authorization as a param of http handler request

* feat: add update_user to client of auth server

* feat: add client code and test cases for password change

* chore: rename appflowy-server to appflowy-cloud

* ci: upgrade reqwest version to fix audit issue

* ci: fix again

* ci: added gotrue env secrets

---------

Co-authored-by: nathan <nathan@appflowy.io>
2023-09-04 11:23:40 +08:00
Zack
d50de4e4d8
feat: added capability to decode supabase web token (#8) 2023-08-11 08:43:21 +08:00