Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init analytics sdk #132

Open
wants to merge 317 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
317 commits
Select commit Hold shift + click to select a range
5b0373a
Merge pull request #154 from nightly-labs/domain-verification-chanlle…
Giems Apr 4, 2024
ed4015f
passkey reset rust implementation
Apr 5, 2024
241f06e
passkey challenge
Apr 5, 2024
26a1090
delete passkey, passkey challenge
Apr 5, 2024
4049e7c
add passkey start
Apr 5, 2024
a0bf068
add passkey finish
Apr 5, 2024
796bd60
Merge pull request #159 from nightly-labs/add-passkey
Giems Apr 5, 2024
20b1434
Merge pull request #157 from nightly-labs/delete-passkey
Giems Apr 5, 2024
3bbebf5
get user metadata
Apr 5, 2024
e45360d
Merge pull request #156 from nightly-labs/reset-passkey
Giems Apr 5, 2024
6505e7c
endpoint get team metadata
Apr 8, 2024
e52f10f
endpoint for team admin to fetch users list
Apr 8, 2024
7de64b6
leftover
Apr 8, 2024
0a4b3ba
change users privileges endpoint
Apr 8, 2024
9131b82
Merge pull request #165 from nightly-labs/change-user-privileges
Giems Apr 9, 2024
b17d4d1
update current methods + tests
Apr 9, 2024
65d9b23
login with passkey
Apr 9, 2024
b0f5422
Merge pull request #167 from nightly-labs/login-with-passkey
Giems Apr 9, 2024
f13991a
Merge branch 'analytics-sdk' into update-sdk
Apr 9, 2024
bc77e2f
update types
Apr 9, 2024
4743cd0
types update
Apr 9, 2024
bcada78
reset credentials done
Apr 9, 2024
af1725e
add script to quickly fully recreate bindings
Apr 9, 2024
6dffc7a
add remaining methods to sdk
Apr 9, 2024
35ec554
update bindings imports
Apr 9, 2024
7e9625f
bump
Apr 9, 2024
2c233f6
add remaining tests
Apr 10, 2024
05604e9
Merge pull request #169 from nightly-labs/update-sdk
Giems Apr 16, 2024
5c6489e
WIP
Apr 17, 2024
c826915
WIP part 2
Apr 18, 2024
2c85fbe
WIP 3
Apr 19, 2024
cd9ffeb
Save progress before small metadata DB refactor
Apr 19, 2024
ef9aff3
language aggregations
Apr 22, 2024
4568879
save new aggregations
Apr 24, 2024
1001e00
gen helpers
Apr 25, 2024
21ca9a5
build client
Apr 25, 2024
3465f0a
bump toml
Apr 26, 2024
12dc79e
init grafana sdk usage
Apr 30, 2024
a1a1c43
bump
Apr 30, 2024
0c09633
handle grafana add user to the team
May 6, 2024
abc40d4
grafana remove user from the team
May 7, 2024
197db52
cleaning
May 7, 2024
f27da0a
Merge pull request #172 from nightly-labs/grafana-sdk-usage
Giems May 7, 2024
af77b92
Merge pull request #170 from nightly-labs/grafana-api-wrapper
Giems May 7, 2024
78b986b
db cleaning
May 7, 2024
4ab4b60
fix tests
May 7, 2024
65b084a
Merge pull request #171 from nightly-labs/grafana-init-views
Giems May 7, 2024
a8d985a
Analytics fixes (#173)
Giems May 8, 2024
9a2945f
Merge branch 'main' into analytics-sdk
May 8, 2024
d7abcfb
test app id assignment (#175)
Giems May 9, 2024
d0a1dab
fix uniqueness of domain verification challenge
May 10, 2024
19af890
fix table keys
May 13, 2024
a5fcd2a
fix sdk clients
May 13, 2024
efee7c1
fix message
May 13, 2024
815cdc9
init analytics sdk tests
May 13, 2024
606600b
fix origin != domain
May 14, 2024
da550f4
update types
May 14, 2024
7eac8d5
add optional ws params on baseApp init
May 14, 2024
6ecb1df
update types
May 14, 2024
59cd941
skip ip requests during localhost tests
May 14, 2024
108c9ca
e2e ts tests for analytics sdk
May 14, 2024
2091239
fix env
May 14, 2024
fe3c860
script for clean db start
May 15, 2024
865ba5e
save partially removed progress
May 22, 2024
01a16de
save progress
May 22, 2024
ca061ac
update
May 22, 2024
38d0196
backups work
May 22, 2024
fe28c41
cleaning
May 23, 2024
46828cc
move variables to env, update scripts
May 24, 2024
f8676b8
update scripts to read env values properly
May 24, 2024
5e1b9f2
fix
May 24, 2024
0ae5598
workflow update
May 24, 2024
67622d1
fix
May 24, 2024
421b601
test
May 24, 2024
3b9a504
test fix
May 24, 2024
5cda2ff
test fix
May 24, 2024
78c1b83
test fix
May 24, 2024
cd03e47
test fix without ofelia
May 24, 2024
fec6527
fix permissions
May 24, 2024
64f40fb
fix
May 24, 2024
5eadc42
test db start with ofelia
May 24, 2024
8bf517a
test new readme
May 27, 2024
70d6ff8
test note box
May 27, 2024
1014903
Merge pull request #180 from nightly-labs/postgress_settings
Giems May 27, 2024
d7bb014
Merge pull request #177 from nightly-labs/analytics-tests
Giems May 27, 2024
4f83d4f
update main readme
May 27, 2024
04e7a95
update database readme
May 29, 2024
5299883
finish database readme
May 29, 2024
38e4a7d
fix
May 29, 2024
1455251
fix
May 29, 2024
5ac9146
finish grafana readme
Jun 3, 2024
bb24cd3
update
Jun 3, 2024
8c01604
test data
Jun 3, 2024
aa06fa9
add network param in tables and aggregations
Jun 4, 2024
38775e2
fixes on db
Jun 4, 2024
d0f4c22
fix rust axum handlers, fix sdk
Jun 4, 2024
1bcd169
Merge pull request #181 from nightly-labs/readme
Giems Jun 6, 2024
939dd95
dirty WIP
Jun 6, 2024
4b298d0
add network table
Jun 7, 2024
2db893a
add new network on app connect
Jun 7, 2024
9d93a85
fix workers amount issue
Jun 7, 2024
539e983
bump template
Jun 7, 2024
da17454
Init domain verification status
Jun 10, 2024
dc801c9
remove logs
Jun 11, 2024
e5f3a85
update domain verification status
Jun 11, 2024
e87358d
add new endpoint to cancel domain verification request
Jun 11, 2024
7539e7b
add method to cloud sdk
Jun 12, 2024
35dea48
remove .only marker
Jun 12, 2024
47aaed0
Merge pull request #183 from nightly-labs/domain-verification-status
Giems Jun 17, 2024
8885d3c
add refresh auth token endpoint
Jun 18, 2024
859fb9b
update sdk
Jun 18, 2024
46b7722
fix
Jun 18, 2024
184e159
fix
Jun 18, 2024
8fc130b
test fix
Jun 18, 2024
3c83322
fix
Jun 18, 2024
a6c74ce
fix
Jun 18, 2024
ba97124
add comment
Jun 18, 2024
38473db
Merge pull request #184 from nightly-labs/refresh-token
Giems Jun 18, 2024
7578d1b
bump nightly-cloud version
Jun 19, 2024
89e69b3
fix type, add missing methods, fix error type
Jun 21, 2024
8653527
Merge pull request #185 from nightly-labs/fix-missing-elements
Giems Jun 21, 2024
0c0caa7
bump cloud to 0.0.3
Jun 24, 2024
32d4d01
update passkey TFA
Jun 24, 2024
1103492
bump version to 0.0.4
Jun 24, 2024
26c58a5
update verification for register endpoints
Jun 25, 2024
e2e1a3f
update verification for reset endpoints
Jun 25, 2024
3daae8b
fix rust tests
Jun 25, 2024
e2cf60f
update bindings
Jun 25, 2024
8f59107
update cloud sdk
Jun 25, 2024
09061ea
fix
Jun 25, 2024
21d80b5
review fixes
Jun 25, 2024
9da5fca
bump cloud sdk to 0.0.5
Jun 25, 2024
5eb92a9
Merge pull request #186 from nightly-labs/update-password-change-flow
Giems Jun 25, 2024
4d945e3
mail on dev
Jun 26, 2024
08e3895
fix rust tests
Jun 26, 2024
a2412ae
fix sdk tests
Jun 27, 2024
d31c8e2
test
Jun 27, 2024
9267f15
fix
Jun 27, 2024
729e285
fix
Jun 27, 2024
7ad90ad
fix
Jun 27, 2024
6da8aa9
fix analytics sdk
Jun 27, 2024
d0ccf99
get metadata permissions fixed
dzlk17 Jul 17, 2024
e46ade8
fixed
dzlk17 Jul 19, 2024
5114ce1
fixed
dzlk17 Jul 19, 2024
26f06ce
Merge pull request #190 from nightly-labs/get_team_metadata_fixed
dzlk17 Jul 19, 2024
ab6af57
update
NorbertBodziony Aug 7, 2024
5979439
grafana init setup
Aug 9, 2024
69e3cec
grafana read only user
Aug 12, 2024
e05d543
bump
Giems Aug 12, 2024
4ce5fbf
Merge pull request #195 from nightly-labs/finish-grafana-setup
Giems Aug 13, 2024
a130554
update datasource setup
Giems Aug 13, 2024
bbc32c0
Merge pull request #188 from nightly-labs/mail-dev
Giems Aug 13, 2024
1febb2f
Merge pull request #182 from nightly-labs/global_dashboard
Giems Aug 13, 2024
440d284
update passkey params
Giems Aug 22, 2024
208a32c
passkey_fixed
dzlk17 Aug 27, 2024
500880b
fixed
dzlk17 Aug 28, 2024
e400cce
fixed
dzlk17 Aug 28, 2024
44b4743
fixed
dzlk17 Aug 28, 2024
0665612
fixes
NorbertBodziony Aug 28, 2024
716851f
fix
NorbertBodziony Aug 28, 2024
1ad8eb7
Merge pull request #198 from nightly-labs/passkey_fixed
dzlk17 Sep 3, 2024
2b50268
paskey_fixed
dzlk17 Sep 3, 2024
c39fd49
WIP: 6da8aa95 fix analytics sdk
dzlk17 Sep 3, 2024
76d4b7e
Merge pull request #199 from nightly-labs/passkey_registration_fixed
dzlk17 Sep 3, 2024
627d64e
fix type
Giems Sep 9, 2024
7e56711
new sdk version
dzlk17 Sep 9, 2024
e518872
hack for a type
robertg93 Sep 10, 2024
6146f95
bump version
robertg93 Sep 10, 2024
4193835
leave team
dzlk17 Sep 13, 2024
a05d224
fixed
dzlk17 Sep 13, 2024
651946a
fixed
dzlk17 Sep 13, 2024
67d6c28
fixed
dzlk17 Sep 13, 2024
bc171d0
Merge pull request #202 from nightly-labs/leave_team
dzlk17 Sep 13, 2024
f92f5f9
passkey fixed
dzlk17 Sep 16, 2024
cc0ca8c
Merge pull request #203 from nightly-labs/passkey_fixed
dzlk17 Sep 16, 2024
555b7c5
bump type
Giems Sep 16, 2024
5fbf0a8
fix delete passkey
Giems Sep 18, 2024
e663ed4
Merge pull request #206 from nightly-labs/better-errors
Giems Sep 18, 2024
c9ba0a6
mailer fixed
dzlk17 Sep 23, 2024
647ccd0
Merge pull request #207 from nightly-labs/mailer_fixed
dzlk17 Sep 23, 2024
00c4f60
mail templates
dzlk17 Sep 24, 2024
c3f172b
init
robertg93 Sep 24, 2024
6535b8d
fixes
dzlk17 Sep 24, 2024
bdcfc8a
fixes
dzlk17 Sep 24, 2024
647459a
Merge pull request #208 from nightly-labs/templates
dzlk17 Sep 24, 2024
13b0328
fixes
dzlk17 Sep 24, 2024
e3c0e5f
templates fixed
dzlk17 Sep 25, 2024
46e28e7
domain_fixed
dzlk17 Sep 25, 2024
9bfa9a1
fixes
dzlk17 Sep 25, 2024
c13bc34
Fix domain verification by multiple apps
Giems Sep 26, 2024
94e23fa
update bindings
Giems Sep 26, 2024
a84fde8
fixed
dzlk17 Sep 27, 2024
1e9e76d
Merge pull request #209 from nightly-labs/domain_fixed
dzlk17 Sep 27, 2024
7eaa2b7
Merge pull request #211 from nightly-labs/fix-domain-verifications
Giems Sep 27, 2024
14c0e80
passkey_fixed
dzlk17 Sep 27, 2024
eb6c259
bump cloud sdk to 0.0.27
Giems Sep 27, 2024
0677efd
mail_template_test
dzlk17 Oct 3, 2024
a997beb
delete team and app
dzlk17 Oct 11, 2024
d962cdc
side panel and footer storybook
dzlk17 Oct 11, 2024
6e4cbf5
fixed
dzlk17 Oct 13, 2024
ab13fcd
fixed
dzlk17 Oct 14, 2024
79726d0
fixed
dzlk17 Oct 14, 2024
358a282
fixed
dzlk17 Oct 14, 2024
54d1492
fixed
dzlk17 Oct 14, 2024
bee4743
fixed
dzlk17 Oct 15, 2024
8b603f7
fixed
dzlk17 Oct 15, 2024
a936de5
Merge pull request #215 from nightly-labs/delete_team_and_app
dzlk17 Oct 15, 2024
1f11c48
enpdoints
dzlk17 Oct 15, 2024
d49308d
fix
dzlk17 Oct 15, 2024
7d9fbb5
Merge pull request #216 from nightly-labs/endpoints
dzlk17 Oct 15, 2024
97d8f24
database_fixed
dzlk17 Oct 15, 2024
4b257e2
database fixed
dzlk17 Oct 16, 2024
d911280
fixed
dzlk17 Oct 17, 2024
af32303
Merge pull request #217 from nightly-labs/database_fixed
dzlk17 Oct 17, 2024
a005cde
fixed
dzlk17 Oct 17, 2024
c245751
Merge pull request #218 from nightly-labs/database_fixed
dzlk17 Oct 17, 2024
0a97651
grafana_restore
dzlk17 Oct 29, 2024
7e1dc67
fixed
dzlk17 Oct 30, 2024
1891e6f
fixed
dzlk17 Oct 30, 2024
2fef753
fixed
dzlk17 Oct 30, 2024
3c1359c
fixed
dzlk17 Oct 30, 2024
709b44e
fixed
dzlk17 Oct 30, 2024
f61d142
fixed
dzlk17 Nov 4, 2024
809a6d4
Merge pull request #219 from nightly-labs/grafana_restore
dzlk17 Nov 4, 2024
31aa71a
rust_update
dzlk17 Nov 14, 2024
738e7a4
delete_account (#221)
dzlk17 Nov 20, 2024
73a10f1
account_removal_mail_fixed
dzlk17 Nov 20, 2024
eac3920
Revert "account_removal_mail_fixed"
dzlk17 Nov 20, 2024
21eff50
account_removal_mail_fixed
dzlk17 Nov 20, 2024
fd2a875
Delete account grafana (#222)
dzlk17 Nov 22, 2024
dc4b93b
account_removal_mail_added_
dzlk17 Nov 27, 2024
7d4cf45
login_with_password_fixed
dzlk17 Nov 28, 2024
55297ea
Unwraps removed (#224)
dzlk17 Dec 3, 2024
9260353
auth_token fixed
dzlk17 Dec 3, 2024
26868ef
auth_token fixed
dzlk17 Dec 3, 2024
5b8ee0f
update client generation script
Giems Dec 4, 2024
658433a
update grafana client codegen
Giems Dec 4, 2024
2a99609
update docker compose config
Giems Dec 5, 2024
c9a9e99
update env
Giems Dec 5, 2024
05c0fa5
add comment
Giems Dec 5, 2024
d82d0de
update token validation
Giems Dec 5, 2024
7283c63
update jwt token
Giems Dec 5, 2024
8ba2e59
fix tests
Giems Dec 5, 2024
c4b486f
remove print
Giems Dec 6, 2024
e2e769b
fix env
Giems Dec 6, 2024
5ef59c4
test bigger sleep
Giems Dec 6, 2024
8d9d977
Merge pull request #226 from nightly-labs/update-grafana-client-gener…
Giems Dec 6, 2024
259329f
update
robertg93 Dec 6, 2024
5ad76ca
refresh_token_fixed
dzlk17 Dec 10, 2024
1c1ecca
verify_domain_fixed
dzlk17 Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[alias]
tests-relay = "test"
tests-with-db = "test --features cloud_db_tests -- --test-threads=1"
test-integration = "test --features cloud_integration_tests -- --test-threads=1"
88 changes: 15 additions & 73 deletions .env
Original file line number Diff line number Diff line change
@@ -1,74 +1,16 @@
ENV=DEV # PROD or DEV
ONLY_RELAY_SERVICE=TRUE # TRUE - This will start only nightly relay service without cloud service
ENV=PROD # PROD or DEV
ONLY_RELAY_SERVICE=FALSE # TRUE - This will start only nightly relay service without cloud service
NONCE=VERY_SECRET_NONCE
# Generated so it can work with grafana
# ssh-keygen -t rsa -b 4096 -m PEM -f grafana.key -N ""
# openssl rsa -in grafana.key -pubout -outform PEM -out grafana.key.pub
# TEST KEY DO NO USE IN PRODUCTION
JWT_SECRET="-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEAzlUYIpqSUAyLJaf8ZUef06YBh5DcmaTrwGcVwC57VtywY7bH
XQUtGooULQjiYgnyOPxHDt2W+gQW1axiMxOQew0MF0kXYQhg0+WA1dcWOsxCDpyL
c4z+E7EmdV7MTuvsDR2TLhZ6DFmVbN4ca64Wvftz//3Ptc/I1/VpfGsHWb0Vpmph
kbE9vWGHzzJVp/Lvtk7ybcpfxiiNWEi7unr7/TIEsqy93lCRfpLKIvO06ITH1GZz
7+VPL/8q8lrH5kSwxqo5szq1mEa0pNN6hTpocz00x5oBfL9K/TNLQNgdb5uOOfjQ
9pYtZ49UDyMLs5lCsZ6ue+SIbWrJXDEPMIEgLzx9nnvytL9wbiwo5GQdIaDAZXMw
VVdKQGyqx+UhaHmrb1u0RVRcFzO/QPWzNCWvoxJGfg9dVTxfjaa1HzQ0irPs86zC
QUnt0OyTuq0SmUgTCNXLSQaN8MigN++zwT4cIRDB0WMgmu8sxtnmA3Zq+2GYT97j
mbdVMB34DVbXI4UigD3UieVe4rO95cEssoUTAFG0pthv64BRKIIRNch+eiBBjkGp
nWKRybzsmqnEqpMf9v7KQU9hmpBJDbi6KA6w3fg3KSroJZwosbAwdBuylCfQgq1j
Z6UfR/ss9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KQU9hmpBJDbi6KA6w
3fg3KSroJZwosbAwdBuylCfQgq1jZ6UfR/ss9kYGhaWbCB3ARmY9XHFc+OZuFW0p
ohgfBfs9RDMDVkTa4tzBAGsCAwEAAQ==
-----END PUBLIC KEY-----
"
[email protected]
# Different than db address specified in infra/.env due to docker shenanigans, used in setting up datasource in grafana
# This is a address of the whole docker interface not just container with database
# Can be found by looking for docker0 entry by sing command ifconfig/ip -a
DATABASE_ADDRESS=172.17.0.1
GRAFANA_BASE_PATH=http://localhost:3005/api
# TEST LOGIN DO NO USE IN PRODUCTION
GF_SECURITY_ADMIN_USER=admin
# TEST PASSWORD DO NO USE IN PRODUCTION
GF_SECURITY_ADMIN_PASSWORD=admin
# TEST PASSWORD DO NO USE IN PRODUCTION
MAILER_PASSWORD=ZtA5gFKMsXzHmEm
MAILER_ACTIVE=TRUE
56 changes: 53 additions & 3 deletions .github/workflows/connect-test-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
timeout-minutes: 10
runs-on: [testing]
steps:
- name: Set CI Environment Variable
run: echo "CI_ENVIRONMENT=true" >> $GITHUB_ENV
- name: Fix permissions
continue-on-error: true
run: |
Expand All @@ -31,9 +33,24 @@ jobs:
- name: Setup Infra
working-directory: ./infra
run: |
docker-compose down
docker-compose --profile full down
rm -rf .infra/target
rm -rf .infra/backups
rm -rf .infra/config
rm -rf .infra/logs
rm -rf .infra/ofelia_logs
echo ${{secrets.TESTING_LAPTOP_PASSWORD}} | sudo -S ./scripts/clean_start.sh
- name: Setup Grafana
working-directory: ./grafana
run: |
echo "GRAFANA_USER_ID=$(id -u):$(id -g)" >> $GITHUB_ENV
rm -rf ./grafana-data
mkdir -p ./grafana-data
echo ${{secrets.TESTING_LAPTOP_PASSWORD}} | sudo -S chmod 777 -R ${{ env.GRAFANA_USER_ID }} ./grafana-data
docker-compose down
docker-compose up -d --no-deps --force-recreate --remove-orphans
env:
GRAFANA_USER_ID: ${{ env.GRAFANA_USER_ID }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -50,13 +67,25 @@ jobs:
working-directory: ./infra
run: |
( docker-compose logs --follow & ) | grep -q "database system is ready to accept connections"

if [[ "$FAILURE" -eq 1 ]]; then
echo "Database init failed. Printing last 20 log entries:"
docker-compose logs | tail -n 20
fi
- name: Wait for Grafana
continue-on-error: true
timeout-minutes: 2
working-directory: ./grafana
run: |
( docker-compose logs --follow & ) | grep -q "Update check succeeded"
- name: Prepare db tables
run: |
cargo run --bin tables_migration
- name: run cargo test
run: |
cargo tests-with-db
cargo test-integration
cargo run --bin nightly-connect-server &
sleep 50
- name: test base local
run: |
pnpm test:ci
Expand All @@ -69,8 +98,29 @@ jobs:
run: |
pnpm test:ci
working-directory: ./sdk/packages/sui
- name: kill-nightly-connect
run: |
kill $(pgrep -f 'nightly-connect-server')
- name: run connect with db
run: |
cargo run --bin nightly-connect-server &
sleep 5
env:
ONLY_RELAY_SERVICE: FALSE
- name: test cloud local
run: |
pnpm test:ci
working-directory: ./sdk/packages/cloud
- name: test analytics local
run: |
pnpm test:ci
working-directory: ./sdk/packages/analytics
- name: Clean target
working-directory: ./infra
run: |
docker-compose down
docker-compose --profile down
rm -rf .infra/target
rm -rf .infra/backups
rm -rf .infra/config
rm -rf .infra/logs
rm -rf .infra/ofelia_logs
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/target
/Cargo.lock
/.vscode
/.vscode
/grafana-client-gen/build
/infra/target
/infra/config
/infra/logs
/infra/backups
/infra/ofelia_logs
19 changes: 16 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["server", "database"]
members = ["server", "database", "openapi"]

[workspace.dependencies]
ctrlc = "3.4.2"
Expand All @@ -27,9 +27,17 @@ tower = { version = "0.4.13", features = [
"limit",
] }
tower-http = { version = "0.5.2", features = ["cors", "trace"] }
reqwest = {version = "0.11.24", features = ["json"]}
reqwest = { version = "0.11.24", features = ["json"] }
tokio = { version = "1.35.1", features = ["full"] }
async-trait = "0.1.77"
r-cache = "0.5.0"
lettre = "0.11.6"
addr = "0.15.6"
hickory-resolver = "0.24.0"
webauthn-rs = { version = "0.4.8", features = [
"danger-allow-state-serialisation",
] }
sha256 = "1.5.0"

# If you're updating sqlx, make sure that chrono version below is the same as the one in sqlx
sqlx = { version = "0.7.3", features = [
Expand All @@ -39,4 +47,9 @@ sqlx = { version = "0.7.3", features = [
"postgres",
"chrono",
] }
chrono = { version = "0.4.22", features = ["serde"] }
chrono = { version = "0.4.22", features = ["serde"] }
configparser = "3.1.0"

[profile.dev]
debug = 0
strip = "debuginfo"
8 changes: 7 additions & 1 deletion database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ log = { workspace = true }
strum = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
webauthn-rs = { workspace = true }
uuid7 = { workspace = true }

[dev-dependencies]
rand = { workspace = true }
futures = { workspace = true }

[features]
cloud_db_tests = []
cloud_integration_tests = []
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
import type { MobileMetadata } from "./MobileMetadata";
import type { WebMetadata } from "./WebMetadata";

export type DeviceMetadata = { mobile: MobileMetadata } | { web: WebMetadata };
export type DeviceMetadata = { mobile: MobileMetadata } | { web: WebMetadata } | "unknown";
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface TransactionToSign { transaction: string, metadata?: string, }
export type DomainVerificationStatus = "Pending" | "Verified" | "Cancelled";
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export type HttpAddUserToTeamResponse = null;
export type PaginationCursor = string;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface WebMetadata { browser: string, version: string, os: string, osVersion: string, }
export interface WebMetadata { browser: string, browserVersion: string, os: string, osVersion: string, }
4 changes: 4 additions & 0 deletions database/bindings/WhitelistedDomain.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { DomainVerificationStatus } from "./DomainVerificationStatus";

export interface WhitelistedDomain { domain: string, status: DomainVerificationStatus, }
1 change: 1 addition & 0 deletions database/migrations/0000_extensions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE EXTENSION postgis;
9 changes: 5 additions & 4 deletions database/migrations/0001_types.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ CREATE TYPE geo_location AS (
CREATE TYPE event_type_enum AS ENUM (
'AppConnect',
'AppDisconnect',
'ClientConnectInit',
'ClientConnectResolve'
'ClientConnect',
'ClientDisconnect',
'SingMessage',
'SignMessage',
'SignTransaction',
'SignAndSendTransaction',
'ChangeWallet',
'ChangeNetwork'
);
);

CREATE TYPE device_medium_type_enum AS ENUM ('Browser', 'Mobile', 'Unknown');
9 changes: 7 additions & 2 deletions database/migrations/0002_team.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
CREATE TABLE team(
team_id TEXT NOT NULL UNIQUE,
grafana_id TEXT UNIQUE,
team_name TEXT NOT NULL,
personal BOOLEAN NOT NULL,
subscription subscription,
team_admin_id TEXT NOT NULL,
registration_timestamp TIMESTAMPTZ NOT NULL,
PRIMARY KEY (team_name, team_admin_id)
);
deactivated_at TIMESTAMPTZ
);

CREATE UNIQUE INDEX unique_active_team_name
ON team (team_admin_id, team_name)
WHERE deactivated_at IS NULL;
9 changes: 0 additions & 9 deletions database/migrations/0003_grafana_users.sql

This file was deleted.

11 changes: 11 additions & 0 deletions database/migrations/0003_users.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE users(
user_id TEXT NOT NULL UNIQUE,
email TEXT NOT NULL UNIQUE,
password_hash TEXT,
passkeys TEXT,
creation_timestamp TIMESTAMPTZ NOT NULL,
deactivated_at TIMESTAMPTZ
);

CREATE INDEX users_name_idx ON users(user_id);
CREATE INDEX users_email_idx ON users(email);
7 changes: 5 additions & 2 deletions database/migrations/0004_registered_apps.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ CREATE TABLE registered_apps(
app_name TEXT NOT NULL,
whitelisted_domains TEXT [] NOT NULL,
ack_public_keys TEXT [] NOT NULL,
registration_timestamp TIMESTAMPTZ NOT NULL
registration_timestamp TIMESTAMPTZ NOT NULL,
deactivated_at TIMESTAMPTZ
);

CREATE UNIQUE INDEX app_id_idx ON registered_apps(app_id);
CREATE UNIQUE INDEX unique_active_app_name
ON registered_apps (team_id, app_name)
WHERE deactivated_at IS NULL;
2 changes: 1 addition & 1 deletion database/migrations/0005_user_app_privilages.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CREATE TABLE user_app_privileges (
creation_timestamp TIMESTAMPTZ NOT NULL,
privilege_level privilege_level_enum NOT NULL,
PRIMARY KEY (user_id, app_id),
FOREIGN KEY (user_id) REFERENCES grafana_users (user_id) ON DELETE CASCADE,
FOREIGN KEY (user_id) REFERENCES users (user_id) ON DELETE CASCADE,
FOREIGN KEY (app_id) REFERENCES registered_apps (app_id) ON DELETE CASCADE
);
4 changes: 4 additions & 0 deletions database/migrations/0007_sessions.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CREATE TABLE networks (
network TEXT PRIMARY KEY
);

CREATE TABLE sessions (
session_id TEXT NOT NULL,
app_id TEXT NOT NULL,
Expand Down
1 change: 1 addition & 0 deletions database/migrations/0009_connection_events.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CREATE TABLE connection_events (
event_id BIGSERIAL NOT NULL,
app_id TEXT NOT NULL, -- Always references the related app, whether an app or client connection
network TEXT NOT NULL,
session_id TEXT NOT NULL,
entity_id TEXT NOT NULL, -- The ID of the connecting entity (could be the same app_id or client_profile_id or client_id)
entity_type entity_type_enum NOT NULL, -- Distinguishes between 'client' and 'app'
Expand Down
Loading