diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 01732df3f..8fbcfe86b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -22,7 +22,7 @@ env:
jobs:
test:
runs-on: [self-hosted, Linux]
- container: rust:1.74
+ container: rust:1.75
services:
postgres:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index f4fed2500..8bec6c503 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -16,7 +16,7 @@ env:
jobs:
rustdoc:
runs-on: [self-hosted, Linux]
- container: rust:1.74
+ container: rust:1.75
services:
postgres:
image: postgres:15-alpine
diff --git a/.sqlx/query-eb982489a09c45fcaec74346f499c657d3018d01be7e095683a40160d533f410.json b/.sqlx/query-00454ac37de808986d66b6abd808fb648b288f49586113cea21d889dca9655b9.json
similarity index 78%
rename from .sqlx/query-eb982489a09c45fcaec74346f499c657d3018d01be7e095683a40160d533f410.json
rename to .sqlx/query-00454ac37de808986d66b6abd808fb648b288f49586113cea21d889dca9655b9.json
index 5e191c1e1..e91d531de 100644
--- a/.sqlx/query-eb982489a09c45fcaec74346f499c657d3018d01be7e095683a40160d533f410.json
+++ b/.sqlx/query-00454ac37de808986d66b6abd808fb648b288f49586113cea21d889dca9655b9.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT instance_name, main_logo_url, nav_logo_url, wireguard_enabled, webhooks_enabled, worker_enabled, openid_enabled FROM settings WHERE id = 1;\n ",
+ "query": "SELECT instance_name, main_logo_url, nav_logo_url, wireguard_enabled, webhooks_enabled, worker_enabled, openid_enabled FROM settings WHERE id = 1",
"describe": {
"columns": [
{
@@ -52,5 +52,5 @@
false
]
},
- "hash": "eb982489a09c45fcaec74346f499c657d3018d01be7e095683a40160d533f410"
+ "hash": "00454ac37de808986d66b6abd808fb648b288f49586113cea21d889dca9655b9"
}
diff --git a/.sqlx/query-e7e944f6bce4dce8cd58889dca8e38ceab97af014b51bfa24933e296e803effc.json b/.sqlx/query-035360e0dd260aece5c89979b28e87a85eb04e2b0eec2d9bc63e8fee6abda27e.json
similarity index 53%
rename from .sqlx/query-e7e944f6bce4dce8cd58889dca8e38ceab97af014b51bfa24933e296e803effc.json
rename to .sqlx/query-035360e0dd260aece5c89979b28e87a85eb04e2b0eec2d9bc63e8fee6abda27e.json
index eb7659098..30fd8c341 100644
--- a/.sqlx/query-e7e944f6bce4dce8cd58889dca8e38ceab97af014b51bfa24933e296e803effc.json
+++ b/.sqlx/query-035360e0dd260aece5c89979b28e87a85eb04e2b0eec2d9bc63e8fee6abda27e.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT wireguard_ip\n FROM wireguard_network_device\n WHERE device_id = $1 AND wireguard_network_id = $2\n ",
+ "query": "SELECT wireguard_ip FROM wireguard_network_device WHERE device_id = $1 AND wireguard_network_id = $2",
"describe": {
"columns": [
{
@@ -19,5 +19,5 @@
false
]
},
- "hash": "e7e944f6bce4dce8cd58889dca8e38ceab97af014b51bfa24933e296e803effc"
+ "hash": "035360e0dd260aece5c89979b28e87a85eb04e2b0eec2d9bc63e8fee6abda27e"
}
diff --git a/.sqlx/query-06d1ac982dc99c5dae010089cfb73a044397c5cb6bb9654dc5df420bf00d2955.json b/.sqlx/query-06d1ac982dc99c5dae010089cfb73a044397c5cb6bb9654dc5df420bf00d2955.json
new file mode 100644
index 000000000..e2fcfb80f
--- /dev/null
+++ b/.sqlx/query-06d1ac982dc99c5dae010089cfb73a044397c5cb6bb9654dc5df420bf00d2955.json
@@ -0,0 +1,24 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT latest_handshake \"latest_handshake: NaiveDateTime\" FROM wireguard_peer_stats_view WHERE device_id = $1 AND latest_handshake IS NOT NULL AND (latest_handshake_diff > $2 * interval '1 minute' OR latest_handshake_diff IS NULL) AND network = $3 ORDER BY collected_at DESC LIMIT 1",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "latest_handshake: NaiveDateTime",
+ "type_info": "Timestamp"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Float8",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ true
+ ]
+ },
+ "hash": "06d1ac982dc99c5dae010089cfb73a044397c5cb6bb9654dc5df420bf00d2955"
+}
diff --git a/.sqlx/query-6b07d6ea56bcded73038dfd59cff3d7d15049caf771aec6b0fcd42bea7169998.json b/.sqlx/query-0c5df6263cfa9e2bdf273c51993d40442a7ed65c986eef4e79e9d12aeb32edef.json
similarity index 69%
rename from .sqlx/query-6b07d6ea56bcded73038dfd59cff3d7d15049caf771aec6b0fcd42bea7169998.json
rename to .sqlx/query-0c5df6263cfa9e2bdf273c51993d40442a7ed65c986eef4e79e9d12aeb32edef.json
index 1794b02be..3116a4814 100644
--- a/.sqlx/query-6b07d6ea56bcded73038dfd59cff3d7d15049caf771aec6b0fcd42bea7169998.json
+++ b/.sqlx/query-0c5df6263cfa9e2bdf273c51993d40442a7ed65c986eef4e79e9d12aeb32edef.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT id \"id?\", \"name\",\"address\" \"address: _\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\" \"allowed_ips: _\",\"connected_at\" FROM \"wireguard_network\"",
+ "query": "SELECT id \"id?\", \"name\",\"address\" \"address: _\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\" \"allowed_ips: _\",\"connected_at\",\"mfa_enabled\",\"keepalive_interval\",\"peer_disconnect_threshold\" FROM \"wireguard_network\"",
"describe": {
"columns": [
{
@@ -52,6 +52,21 @@
"ordinal": 9,
"name": "connected_at",
"type_info": "Timestamp"
+ },
+ {
+ "ordinal": 10,
+ "name": "mfa_enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 11,
+ "name": "keepalive_interval",
+ "type_info": "Int4"
+ },
+ {
+ "ordinal": 12,
+ "name": "peer_disconnect_threshold",
+ "type_info": "Int4"
}
],
"parameters": {
@@ -67,8 +82,11 @@
false,
true,
false,
- true
+ true,
+ false,
+ false,
+ false
]
},
- "hash": "6b07d6ea56bcded73038dfd59cff3d7d15049caf771aec6b0fcd42bea7169998"
+ "hash": "0c5df6263cfa9e2bdf273c51993d40442a7ed65c986eef4e79e9d12aeb32edef"
}
diff --git a/.sqlx/query-0cf5e325412549a381f4a2309ccbdc9289ef5ce5169c5b8c853e7c4e7dfb1877.json b/.sqlx/query-0cf5e325412549a381f4a2309ccbdc9289ef5ce5169c5b8c853e7c4e7dfb1877.json
new file mode 100644
index 000000000..f3444d949
--- /dev/null
+++ b/.sqlx/query-0cf5e325412549a381f4a2309ccbdc9289ef5ce5169c5b8c853e7c4e7dfb1877.json
@@ -0,0 +1,22 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT name FROM wireguard_network_allowed_group wag JOIN \"group\" g ON wag.group_id = g.id WHERE wag.network_id = $1",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "name",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false
+ ]
+ },
+ "hash": "0cf5e325412549a381f4a2309ccbdc9289ef5ce5169c5b8c853e7c4e7dfb1877"
+}
diff --git a/.sqlx/query-0fa037b89c50e40ad95ae203cf70fe9162b8ae22444b29379c85fe0b9ca01799.json b/.sqlx/query-0fa037b89c50e40ad95ae203cf70fe9162b8ae22444b29379c85fe0b9ca01799.json
deleted file mode 100644
index c2c883025..000000000
--- a/.sqlx/query-0fa037b89c50e40ad95ae203cf70fe9162b8ae22444b29379c85fe0b9ca01799.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM token\n WHERE user_id = $1\n AND used_at IS NULL",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "0fa037b89c50e40ad95ae203cf70fe9162b8ae22444b29379c85fe0b9ca01799"
-}
diff --git a/.sqlx/query-1a01b8b88444b493abf74b2ec0ad649018244de3c7f23d98bfab71faa1a9fae1.json b/.sqlx/query-1a01b8b88444b493abf74b2ec0ad649018244de3c7f23d98bfab71faa1a9fae1.json
new file mode 100644
index 000000000..c6790b55f
--- /dev/null
+++ b/.sqlx/query-1a01b8b88444b493abf74b2ec0ad649018244de3c7f23d98bfab71faa1a9fae1.json
@@ -0,0 +1,92 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT id as \"id?\", name, address, port, pubkey, prvkey, endpoint, dns, allowed_ips, connected_at, mfa_enabled, keepalive_interval, peer_disconnect_threshold FROM wireguard_network WHERE mfa_enabled = true",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "address",
+ "type_info": "Inet"
+ },
+ {
+ "ordinal": 3,
+ "name": "port",
+ "type_info": "Int4"
+ },
+ {
+ "ordinal": 4,
+ "name": "pubkey",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 5,
+ "name": "prvkey",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 6,
+ "name": "endpoint",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 7,
+ "name": "dns",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 8,
+ "name": "allowed_ips",
+ "type_info": "InetArray"
+ },
+ {
+ "ordinal": 9,
+ "name": "connected_at",
+ "type_info": "Timestamp"
+ },
+ {
+ "ordinal": 10,
+ "name": "mfa_enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 11,
+ "name": "keepalive_interval",
+ "type_info": "Int4"
+ },
+ {
+ "ordinal": 12,
+ "name": "peer_disconnect_threshold",
+ "type_info": "Int4"
+ }
+ ],
+ "parameters": {
+ "Left": []
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ true,
+ false,
+ false,
+ false
+ ]
+ },
+ "hash": "1a01b8b88444b493abf74b2ec0ad649018244de3c7f23d98bfab71faa1a9fae1"
+}
diff --git a/.sqlx/query-1bb3c8ecbd6500717d639678e08ab52c14293fa64d260db812c89ed43a5a7cc8.json b/.sqlx/query-1bb3c8ecbd6500717d639678e08ab52c14293fa64d260db812c89ed43a5a7cc8.json
new file mode 100644
index 000000000..8d314a5fa
--- /dev/null
+++ b/.sqlx/query-1bb3c8ecbd6500717d639678e08ab52c14293fa64d260db812c89ed43a5a7cc8.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "UPDATE session SET expires = $1 WHERE id = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Timestamp",
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "1bb3c8ecbd6500717d639678e08ab52c14293fa64d260db812c89ed43a5a7cc8"
+}
diff --git a/.sqlx/query-501e4426106d4972d7bd6d769bb6dd239be2168c4afdfc618de4c7facaad67a3.json b/.sqlx/query-20dda55cfcf38db23d5553b65a9e4f48275d7b1d588869791a6741fa11be38a5.json
similarity index 70%
rename from .sqlx/query-501e4426106d4972d7bd6d769bb6dd239be2168c4afdfc618de4c7facaad67a3.json
rename to .sqlx/query-20dda55cfcf38db23d5553b65a9e4f48275d7b1d588869791a6741fa11be38a5.json
index 5c396350e..4b6e6f131 100644
--- a/.sqlx/query-501e4426106d4972d7bd6d769bb6dd239be2168c4afdfc618de4c7facaad67a3.json
+++ b/.sqlx/query-20dda55cfcf38db23d5553b65a9e4f48275d7b1d588869791a6741fa11be38a5.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT id \"id?\", device_id \"device_id!\", collected_at \"collected_at!\", network \"network!\",\n endpoint, upload \"upload!\", download \"download!\", latest_handshake \"latest_handshake!\", allowed_ips\n FROM wireguard_peer_stats\n WHERE device_id = $1 AND network = $2\n ORDER BY collected_at DESC\n LIMIT 1\n ",
+ "query": "SELECT id \"id?\", device_id \"device_id!\", collected_at \"collected_at!\", network \"network!\", endpoint, upload \"upload!\", download \"download!\", latest_handshake \"latest_handshake!\", allowed_ips FROM wireguard_peer_stats WHERE device_id = $1 AND network = $2 ORDER BY collected_at DESC LIMIT 1",
"describe": {
"columns": [
{
@@ -67,5 +67,5 @@
true
]
},
- "hash": "501e4426106d4972d7bd6d769bb6dd239be2168c4afdfc618de4c7facaad67a3"
+ "hash": "20dda55cfcf38db23d5553b65a9e4f48275d7b1d588869791a6741fa11be38a5"
}
diff --git a/.sqlx/query-26d95a39c9d11c1fcd5d35f4f0d8883b366b46937b94f25a3788604c72da0ecc.json b/.sqlx/query-26d95a39c9d11c1fcd5d35f4f0d8883b366b46937b94f25a3788604c72da0ecc.json
new file mode 100644
index 000000000..9076e114d
--- /dev/null
+++ b/.sqlx/query-26d95a39c9d11c1fcd5d35f4f0d8883b366b46937b94f25a3788604c72da0ecc.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM token WHERE user_id = $1 AND token_type = 'PASSWORD_RESET' AND used_at IS NULL",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "26d95a39c9d11c1fcd5d35f4f0d8883b366b46937b94f25a3788604c72da0ecc"
+}
diff --git a/.sqlx/query-b362d79ac6b116c97f7489cbfc5801c7f94ba91677af351ef235755bf804e1f7.json b/.sqlx/query-29809d24769e1c6cb572c666fd0caeeaeb3b13a524f503b21414d1394173eb24.json
similarity index 69%
rename from .sqlx/query-b362d79ac6b116c97f7489cbfc5801c7f94ba91677af351ef235755bf804e1f7.json
rename to .sqlx/query-29809d24769e1c6cb572c666fd0caeeaeb3b13a524f503b21414d1394173eb24.json
index 7634f9654..ffaf6c210 100644
--- a/.sqlx/query-b362d79ac6b116c97f7489cbfc5801c7f94ba91677af351ef235755bf804e1f7.json
+++ b/.sqlx/query-29809d24769e1c6cb572c666fd0caeeaeb3b13a524f503b21414d1394173eb24.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT id \"id?\", \"name\",\"address\" \"address: _\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\" \"allowed_ips: _\",\"connected_at\" FROM \"wireguard_network\" WHERE id = $1",
+ "query": "SELECT id \"id?\", \"name\",\"address\" \"address: _\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\" \"allowed_ips: _\",\"connected_at\",\"mfa_enabled\",\"keepalive_interval\",\"peer_disconnect_threshold\" FROM \"wireguard_network\" WHERE id = $1",
"describe": {
"columns": [
{
@@ -52,6 +52,21 @@
"ordinal": 9,
"name": "connected_at",
"type_info": "Timestamp"
+ },
+ {
+ "ordinal": 10,
+ "name": "mfa_enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 11,
+ "name": "keepalive_interval",
+ "type_info": "Int4"
+ },
+ {
+ "ordinal": 12,
+ "name": "peer_disconnect_threshold",
+ "type_info": "Int4"
}
],
"parameters": {
@@ -69,8 +84,11 @@
false,
true,
false,
- true
+ true,
+ false,
+ false,
+ false
]
},
- "hash": "b362d79ac6b116c97f7489cbfc5801c7f94ba91677af351ef235755bf804e1f7"
+ "hash": "29809d24769e1c6cb572c666fd0caeeaeb3b13a524f503b21414d1394173eb24"
}
diff --git a/.sqlx/query-73ab0d514bbce0a69e1b22d9f5a2a58be7427882b368eef4d45529e9e85d885c.json b/.sqlx/query-38f3ad2dc19d222226b85a10d6c83e209cf075f9b128ed33908c73cd74297d81.json
similarity index 65%
rename from .sqlx/query-73ab0d514bbce0a69e1b22d9f5a2a58be7427882b368eef4d45529e9e85d885c.json
rename to .sqlx/query-38f3ad2dc19d222226b85a10d6c83e209cf075f9b128ed33908c73cd74297d81.json
index 847391cec..d187d6402 100644
--- a/.sqlx/query-73ab0d514bbce0a69e1b22d9f5a2a58be7427882b368eef4d45529e9e85d885c.json
+++ b/.sqlx/query-38f3ad2dc19d222226b85a10d6c83e209cf075f9b128ed33908c73cd74297d81.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "UPDATE \"wireguard_network\" SET \"name\" = $2,\"address\" = $3,\"port\" = $4,\"pubkey\" = $5,\"prvkey\" = $6,\"endpoint\" = $7,\"dns\" = $8,\"allowed_ips\" = $9,\"connected_at\" = $10 WHERE id = $1",
+ "query": "UPDATE \"wireguard_network\" SET \"name\" = $2,\"address\" = $3,\"port\" = $4,\"pubkey\" = $5,\"prvkey\" = $6,\"endpoint\" = $7,\"dns\" = $8,\"allowed_ips\" = $9,\"connected_at\" = $10,\"mfa_enabled\" = $11,\"keepalive_interval\" = $12,\"peer_disconnect_threshold\" = $13 WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
@@ -14,10 +14,13 @@
"Text",
"Text",
"InetArray",
- "Timestamp"
+ "Timestamp",
+ "Bool",
+ "Int4",
+ "Int4"
]
},
"nullable": []
},
- "hash": "73ab0d514bbce0a69e1b22d9f5a2a58be7427882b368eef4d45529e9e85d885c"
+ "hash": "38f3ad2dc19d222226b85a10d6c83e209cf075f9b128ed33908c73cd74297d81"
}
diff --git a/.sqlx/query-3d5d8b6f640435a1986561c73cd809038cdddfb44133b97b5ba7392573239539.json b/.sqlx/query-3d5d8b6f640435a1986561c73cd809038cdddfb44133b97b5ba7392573239539.json
new file mode 100644
index 000000000..3dd50e700
--- /dev/null
+++ b/.sqlx/query-3d5d8b6f640435a1986561c73cd809038cdddfb44133b97b5ba7392573239539.json
@@ -0,0 +1,29 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT COALESCE(COUNT(DISTINCT(u.id)), 0) as \"active_users!\", COALESCE(COUNT(DISTINCT(s.device_id)), 0) as \"active_devices!\" FROM \"user\" u JOIN device d ON d.user_id = u.id JOIN wireguard_peer_stats s ON s.device_id = d.id WHERE latest_handshake >= $1 AND s.network = $2",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "active_users!",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "active_devices!",
+ "type_info": "Int8"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Timestamp",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ null,
+ null
+ ]
+ },
+ "hash": "3d5d8b6f640435a1986561c73cd809038cdddfb44133b97b5ba7392573239539"
+}
diff --git a/.sqlx/query-929535564469ee1701f83a1489301d0d652d5452369a2dce933f032cdb7092e2.json b/.sqlx/query-3e6fa53cc900724e25e127f472cb0cb5b5e76fbcf424a79b94862f623ea975fc.json
similarity index 74%
rename from .sqlx/query-929535564469ee1701f83a1489301d0d652d5452369a2dce933f032cdb7092e2.json
rename to .sqlx/query-3e6fa53cc900724e25e127f472cb0cb5b5e76fbcf424a79b94862f623ea975fc.json
index 8a1e90ee9..431b7f8fa 100644
--- a/.sqlx/query-929535564469ee1701f83a1489301d0d652d5452369a2dce933f032cdb7092e2.json
+++ b/.sqlx/query-3e6fa53cc900724e25e127f472cb0cb5b5e76fbcf424a79b94862f623ea975fc.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT device.id \"id?\", name, wireguard_pubkey, user_id, created\n FROM device WHERE user_id = $1\n ",
+ "query": "SELECT device.id \"id?\", name, wireguard_pubkey, user_id, created FROM device WHERE user_id = $1",
"describe": {
"columns": [
{
@@ -42,5 +42,5 @@
false
]
},
- "hash": "929535564469ee1701f83a1489301d0d652d5452369a2dce933f032cdb7092e2"
+ "hash": "3e6fa53cc900724e25e127f472cb0cb5b5e76fbcf424a79b94862f623ea975fc"
}
diff --git a/.sqlx/query-4183b4f169126bcc511ff76c7554622fc71857d0d459588b4f3934307611aee7.json b/.sqlx/query-4183b4f169126bcc511ff76c7554622fc71857d0d459588b4f3934307611aee7.json
deleted file mode 100644
index e2761039f..000000000
--- a/.sqlx/query-4183b4f169126bcc511ff76c7554622fc71857d0d459588b4f3934307611aee7.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n COALESCE(COUNT(DISTINCT(u.id)), 0) as \"active_users!\",\n COALESCE(COUNT(DISTINCT(s.device_id)), 0) as \"active_devices!\"\n FROM \"user\" u\n JOIN device d ON d.user_id = u.id\n JOIN wireguard_peer_stats s ON s.device_id = d.id\n WHERE latest_handshake >= $1 AND s.network = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "active_users!",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "active_devices!",
- "type_info": "Int8"
- }
- ],
- "parameters": {
- "Left": [
- "Timestamp",
- "Int8"
- ]
- },
- "nullable": [
- null,
- null
- ]
- },
- "hash": "4183b4f169126bcc511ff76c7554622fc71857d0d459588b4f3934307611aee7"
-}
diff --git a/.sqlx/query-4218fd109bd4a17b2a4551cfe0d14f2c9b6a37f25f0696d83078dae2c9f87c5f.json b/.sqlx/query-4218fd109bd4a17b2a4551cfe0d14f2c9b6a37f25f0696d83078dae2c9f87c5f.json
new file mode 100644
index 000000000..5354828a7
--- /dev/null
+++ b/.sqlx/query-4218fd109bd4a17b2a4551cfe0d14f2c9b6a37f25f0696d83078dae2c9f87c5f.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM wireguard_peer_stats WHERE collected_at < $1 AND (device_id, network, collected_at) NOT IN ( SELECT device_id, network, MAX(collected_at) FROM wireguard_peer_stats GROUP BY device_id, network)",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Timestamp"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "4218fd109bd4a17b2a4551cfe0d14f2c9b6a37f25f0696d83078dae2c9f87c5f"
+}
diff --git a/.sqlx/query-05e3fce0c51856f6033195c7523a2b5fd1c2a7968a7abd27394422a7c93e8815.json b/.sqlx/query-42ccaa218d47638ff39d9006095ac30ae1cd9dce74ec826ed875c39cc05f04f8.json
similarity index 54%
rename from .sqlx/query-05e3fce0c51856f6033195c7523a2b5fd1c2a7968a7abd27394422a7c93e8815.json
rename to .sqlx/query-42ccaa218d47638ff39d9006095ac30ae1cd9dce74ec826ed875c39cc05f04f8.json
index 7b35afeb1..8b795c04a 100644
--- a/.sqlx/query-05e3fce0c51856f6033195c7523a2b5fd1c2a7968a7abd27394422a7c93e8815.json
+++ b/.sqlx/query-42ccaa218d47638ff39d9006095ac30ae1cd9dce74ec826ed875c39cc05f04f8.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n date_trunc($1, collected_at) \"collected_at: NaiveDateTime\",\n cast(sum(upload) AS bigint) upload, cast(sum(download) AS bigint) download\n FROM wireguard_peer_stats_view\n WHERE collected_at >= $2 AND network = $3\n GROUP BY 1\n ORDER BY 1\n LIMIT $4\n ",
+ "query": "SELECT date_trunc($1, collected_at) \"collected_at: NaiveDateTime\", cast(sum(upload) AS bigint) upload, cast(sum(download) AS bigint) download FROM wireguard_peer_stats_view WHERE collected_at >= $2 AND network = $3 GROUP BY 1 ORDER BY 1 LIMIT $4",
"describe": {
"columns": [
{
@@ -33,5 +33,5 @@
null
]
},
- "hash": "05e3fce0c51856f6033195c7523a2b5fd1c2a7968a7abd27394422a7c93e8815"
+ "hash": "42ccaa218d47638ff39d9006095ac30ae1cd9dce74ec826ed875c39cc05f04f8"
}
diff --git a/.sqlx/query-66d2e2f3156ce802a0018bea5aa0718b2ce599d44de6382e854174053a639f5a.json b/.sqlx/query-442aac6474b466acc15578483d7d582a6face350a9c4c11db8b32fc251605cd6.json
similarity index 58%
rename from .sqlx/query-66d2e2f3156ce802a0018bea5aa0718b2ce599d44de6382e854174053a639f5a.json
rename to .sqlx/query-442aac6474b466acc15578483d7d582a6face350a9c4c11db8b32fc251605cd6.json
index f1a5f025f..7e6961bbf 100644
--- a/.sqlx/query-66d2e2f3156ce802a0018bea5aa0718b2ce599d44de6382e854174053a639f5a.json
+++ b/.sqlx/query-442aac6474b466acc15578483d7d582a6face350a9c4c11db8b32fc251605cd6.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\" FROM\n wireguard_network_device\n WHERE device_id = $1 AND wireguard_network_id = $2",
+ "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\", preshared_key, is_authorized FROM wireguard_network_device WHERE device_id = $1",
"describe": {
"columns": [
{
@@ -17,19 +17,30 @@
"ordinal": 2,
"name": "wireguard_ip: IpAddr",
"type_info": "Inet"
+ },
+ {
+ "ordinal": 3,
+ "name": "preshared_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "is_authorized",
+ "type_info": "Bool"
}
],
"parameters": {
"Left": [
- "Int8",
"Int8"
]
},
"nullable": [
false,
false,
+ false,
+ true,
false
]
},
- "hash": "66d2e2f3156ce802a0018bea5aa0718b2ce599d44de6382e854174053a639f5a"
+ "hash": "442aac6474b466acc15578483d7d582a6face350a9c4c11db8b32fc251605cd6"
}
diff --git a/.sqlx/query-45545d3190c14bb3e9528ab3d3a8522209f36956f65bf5a126682d5477db425e.json b/.sqlx/query-45545d3190c14bb3e9528ab3d3a8522209f36956f65bf5a126682d5477db425e.json
deleted file mode 100644
index 02e887ea1..000000000
--- a/.sqlx/query-45545d3190c14bb3e9528ab3d3a8522209f36956f65bf5a126682d5477db425e.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n UPDATE wireguard_network_device\n SET wireguard_ip = $3\n WHERE device_id = $1 AND wireguard_network_id = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Int8",
- "Inet"
- ]
- },
- "nullable": []
- },
- "hash": "45545d3190c14bb3e9528ab3d3a8522209f36956f65bf5a126682d5477db425e"
-}
diff --git a/.sqlx/query-bde600b9d9448806df37628d305a09b93f4d1217dfb1141a32be11673d76dd1f.json b/.sqlx/query-45a53587f6d8bee3de695b846d5bf85dbcf3fb1a202611480af6a7b9e28d864f.json
similarity index 68%
rename from .sqlx/query-bde600b9d9448806df37628d305a09b93f4d1217dfb1141a32be11673d76dd1f.json
rename to .sqlx/query-45a53587f6d8bee3de695b846d5bf85dbcf3fb1a202611480af6a7b9e28d864f.json
index 840991111..57db8db09 100644
--- a/.sqlx/query-bde600b9d9448806df37628d305a09b93f4d1217dfb1141a32be11673d76dd1f.json
+++ b/.sqlx/query-45a53587f6d8bee3de695b846d5bf85dbcf3fb1a202611480af6a7b9e28d864f.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT id as \"id?\", name, address, port, pubkey, prvkey, endpoint, dns, allowed_ips, connected_at FROM wireguard_network WHERE name = $1",
+ "query": "SELECT id as \"id?\", name, address, port, pubkey, prvkey, endpoint, dns, allowed_ips, connected_at, mfa_enabled, keepalive_interval, peer_disconnect_threshold FROM wireguard_network WHERE name = $1",
"describe": {
"columns": [
{
@@ -52,6 +52,21 @@
"ordinal": 9,
"name": "connected_at",
"type_info": "Timestamp"
+ },
+ {
+ "ordinal": 10,
+ "name": "mfa_enabled",
+ "type_info": "Bool"
+ },
+ {
+ "ordinal": 11,
+ "name": "keepalive_interval",
+ "type_info": "Int4"
+ },
+ {
+ "ordinal": 12,
+ "name": "peer_disconnect_threshold",
+ "type_info": "Int4"
}
],
"parameters": {
@@ -69,8 +84,11 @@
false,
true,
false,
- true
+ true,
+ false,
+ false,
+ false
]
},
- "hash": "bde600b9d9448806df37628d305a09b93f4d1217dfb1141a32be11673d76dd1f"
+ "hash": "45a53587f6d8bee3de695b846d5bf85dbcf3fb1a202611480af6a7b9e28d864f"
}
diff --git a/.sqlx/query-18e96b44b04c6ed00424ac497889e5952c877f1d14216f5b083fd7fa7c927bb7.json b/.sqlx/query-481658620e98faa574e26fe49abbecafa1166f16151c69b465cd49f334de7190.json
similarity index 55%
rename from .sqlx/query-18e96b44b04c6ed00424ac497889e5952c877f1d14216f5b083fd7fa7c927bb7.json
rename to .sqlx/query-481658620e98faa574e26fe49abbecafa1166f16151c69b465cd49f334de7190.json
index 210810108..b3830140f 100644
--- a/.sqlx/query-18e96b44b04c6ed00424ac497889e5952c877f1d14216f5b083fd7fa7c927bb7.json
+++ b/.sqlx/query-481658620e98faa574e26fe49abbecafa1166f16151c69b465cd49f334de7190.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\" FROM\n wireguard_network_device\n WHERE wireguard_network_id = $1",
+ "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\", preshared_key, is_authorized FROM wireguard_network_device WHERE device_id = $1 AND wireguard_network_id = $2",
"describe": {
"columns": [
{
@@ -17,18 +17,31 @@
"ordinal": 2,
"name": "wireguard_ip: IpAddr",
"type_info": "Inet"
+ },
+ {
+ "ordinal": 3,
+ "name": "preshared_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "is_authorized",
+ "type_info": "Bool"
}
],
"parameters": {
"Left": [
+ "Int8",
"Int8"
]
},
"nullable": [
false,
false,
+ false,
+ true,
false
]
},
- "hash": "18e96b44b04c6ed00424ac497889e5952c877f1d14216f5b083fd7fa7c927bb7"
+ "hash": "481658620e98faa574e26fe49abbecafa1166f16151c69b465cd49f334de7190"
}
diff --git a/.sqlx/query-48966c8c5f8999dad107a7c49d7c17f6a3a3b1bda1412df2b30bf2f770d70e8f.json b/.sqlx/query-48966c8c5f8999dad107a7c49d7c17f6a3a3b1bda1412df2b30bf2f770d70e8f.json
new file mode 100644
index 000000000..20ce12f88
--- /dev/null
+++ b/.sqlx/query-48966c8c5f8999dad107a7c49d7c17f6a3a3b1bda1412df2b30bf2f770d70e8f.json
@@ -0,0 +1,14 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM token WHERE user_id = $1 AND used_at IS NULL",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "48966c8c5f8999dad107a7c49d7c17f6a3a3b1bda1412df2b30bf2f770d70e8f"
+}
diff --git a/.sqlx/query-4f318cd5100bf4d155a555b927cc7421cb5324f70e427bd7e6f7312be4a20946.json b/.sqlx/query-4f318cd5100bf4d155a555b927cc7421cb5324f70e427bd7e6f7312be4a20946.json
deleted file mode 100644
index c3f53658b..000000000
--- a/.sqlx/query-4f318cd5100bf4d155a555b927cc7421cb5324f70e427bd7e6f7312be4a20946.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM wireguard_network_allowed_group\n WHERE network_id = $1 AND group_id IN (\n SELECT id\n FROM \"group\"\n WHERE name IN (SELECT * FROM UNNEST($2::text[]))\n )\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "TextArray"
- ]
- },
- "nullable": []
- },
- "hash": "4f318cd5100bf4d155a555b927cc7421cb5324f70e427bd7e6f7312be4a20946"
-}
diff --git a/.sqlx/query-865131a7e440c7e5f297cb8620487fe0cf641f481175adaf22982d1f983d362e.json b/.sqlx/query-5f1da7400599669d9591f6dded6c38d6f74286fd5660c1ccae20ce43617bbc8f.json
similarity index 57%
rename from .sqlx/query-865131a7e440c7e5f297cb8620487fe0cf641f481175adaf22982d1f983d362e.json
rename to .sqlx/query-5f1da7400599669d9591f6dded6c38d6f74286fd5660c1ccae20ce43617bbc8f.json
index 53638cdc0..fbd018000 100644
--- a/.sqlx/query-865131a7e440c7e5f297cb8620487fe0cf641f481175adaf22982d1f983d362e.json
+++ b/.sqlx/query-5f1da7400599669d9591f6dded6c38d6f74286fd5660c1ccae20ce43617bbc8f.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n WITH s AS (\n SELECT DISTINCT ON (device_id) *\n FROM wireguard_peer_stats\n ORDER BY device_id, latest_handshake DESC\n )\n SELECT\n d.id \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created\n FROM device d\n JOIN s ON d.id = s.device_id\n WHERE s.latest_handshake >= $1 AND s.network = $2\n ",
+ "query": "WITH s AS ( SELECT DISTINCT ON (device_id) * FROM wireguard_peer_stats ORDER BY device_id, latest_handshake DESC ) SELECT d.id \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created FROM device d JOIN s ON d.id = s.device_id WHERE s.latest_handshake >= $1 AND s.network = $2",
"describe": {
"columns": [
{
@@ -43,5 +43,5 @@
false
]
},
- "hash": "865131a7e440c7e5f297cb8620487fe0cf641f481175adaf22982d1f983d362e"
+ "hash": "5f1da7400599669d9591f6dded6c38d6f74286fd5660c1ccae20ce43617bbc8f"
}
diff --git a/.sqlx/query-63dd22326d77a452d5624d378b0653a7b6b98d71caaf55c6651a44bbd57df017.json b/.sqlx/query-63dd22326d77a452d5624d378b0653a7b6b98d71caaf55c6651a44bbd57df017.json
new file mode 100644
index 000000000..758eb4113
--- /dev/null
+++ b/.sqlx/query-63dd22326d77a452d5624d378b0653a7b6b98d71caaf55c6651a44bbd57df017.json
@@ -0,0 +1,40 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT wireguard_network_id as network_id, wireguard_ip as \"device_wireguard_ip: IpAddr\", preshared_key, is_authorized FROM wireguard_network_device WHERE device_id = $1",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "network_id",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "device_wireguard_ip: IpAddr",
+ "type_info": "Inet"
+ },
+ {
+ "ordinal": 2,
+ "name": "preshared_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "is_authorized",
+ "type_info": "Bool"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ true,
+ false
+ ]
+ },
+ "hash": "63dd22326d77a452d5624d378b0653a7b6b98d71caaf55c6651a44bbd57df017"
+}
diff --git a/.sqlx/query-6eb3f257ef7762c8633885b2b49d3f18033b11db0daf4133c2abaf8823a8a86a.json b/.sqlx/query-6eb3f257ef7762c8633885b2b49d3f18033b11db0daf4133c2abaf8823a8a86a.json
new file mode 100644
index 000000000..ba14f8502
--- /dev/null
+++ b/.sqlx/query-6eb3f257ef7762c8633885b2b49d3f18033b11db0daf4133c2abaf8823a8a86a.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM wireguard_network_device WHERE device_id = $1 AND wireguard_network_id = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "6eb3f257ef7762c8633885b2b49d3f18033b11db0daf4133c2abaf8823a8a86a"
+}
diff --git a/.sqlx/query-7b7092bd5fe377c8b28862721b05b3ca39aab9fb176fe970b9309d6371072e95.json b/.sqlx/query-7b7092bd5fe377c8b28862721b05b3ca39aab9fb176fe970b9309d6371072e95.json
deleted file mode 100644
index d53ea77b7..000000000
--- a/.sqlx/query-7b7092bd5fe377c8b28862721b05b3ca39aab9fb176fe970b9309d6371072e95.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM wireguard_peer_stats\n WHERE collected_at < $1\n AND (device_id, network, collected_at) NOT IN (\n SELECT device_id, network, MAX(collected_at)\n FROM wireguard_peer_stats\n GROUP BY device_id, network\n )",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Timestamp"
- ]
- },
- "nullable": []
- },
- "hash": "7b7092bd5fe377c8b28862721b05b3ca39aab9fb176fe970b9309d6371072e95"
-}
diff --git a/.sqlx/query-fd92ab2977c9c170e2254f13bd99fcb569ef4b44029783648b0613ca8db2a393.json b/.sqlx/query-84679835466cb41a74dd9ef281c9a69451102dae52ffb5a4df99e160a1ec8907.json
similarity index 73%
rename from .sqlx/query-fd92ab2977c9c170e2254f13bd99fcb569ef4b44029783648b0613ca8db2a393.json
rename to .sqlx/query-84679835466cb41a74dd9ef281c9a69451102dae52ffb5a4df99e160a1ec8907.json
index 900c1d364..15003141b 100644
--- a/.sqlx/query-fd92ab2977c9c170e2254f13bd99fcb569ef4b44029783648b0613ca8db2a393.json
+++ b/.sqlx/query-84679835466cb41a74dd9ef281c9a69451102dae52ffb5a4df99e160a1ec8907.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT d.id \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created\n FROM device d\n JOIN wireguard_network_device wnd\n ON d.id = wnd.device_id\n WHERE wnd.wireguard_ip = $1 AND wnd.wireguard_network_id = $2",
+ "query": "SELECT d.id \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created FROM device d JOIN wireguard_network_device wnd ON d.id = wnd.device_id WHERE wnd.wireguard_ip = $1 AND wnd.wireguard_network_id = $2",
"describe": {
"columns": [
{
@@ -43,5 +43,5 @@
false
]
},
- "hash": "fd92ab2977c9c170e2254f13bd99fcb569ef4b44029783648b0613ca8db2a393"
+ "hash": "84679835466cb41a74dd9ef281c9a69451102dae52ffb5a4df99e160a1ec8907"
}
diff --git a/.sqlx/query-8c69910bf01556b4e35a26a4bd583d1694b8053c8522e2e6a311e1e1b4b4de15.json b/.sqlx/query-8c69910bf01556b4e35a26a4bd583d1694b8053c8522e2e6a311e1e1b4b4de15.json
new file mode 100644
index 000000000..4aef0c1ba
--- /dev/null
+++ b/.sqlx/query-8c69910bf01556b4e35a26a4bd583d1694b8053c8522e2e6a311e1e1b4b4de15.json
@@ -0,0 +1,28 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT id \"id?\", name FROM \"group\" JOIN group_user ON \"group\".id = group_user.group_id WHERE group_user.user_id = $1",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "name",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false
+ ]
+ },
+ "hash": "8c69910bf01556b4e35a26a4bd583d1694b8053c8522e2e6a311e1e1b4b4de15"
+}
diff --git a/.sqlx/query-9132a40b7729383ce9c108baa1b412e872ae9c96792ae9722f66ccfb24f0a144.json b/.sqlx/query-9132a40b7729383ce9c108baa1b412e872ae9c96792ae9722f66ccfb24f0a144.json
new file mode 100644
index 000000000..caa6121c9
--- /dev/null
+++ b/.sqlx/query-9132a40b7729383ce9c108baa1b412e872ae9c96792ae9722f66ccfb24f0a144.json
@@ -0,0 +1,17 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "INSERT INTO wireguard_network_device (device_id, wireguard_network_id, wireguard_ip, is_authorized) VALUES ($1, $2, $3, $4) ON CONFLICT ON CONSTRAINT device_network DO UPDATE SET wireguard_ip = $3, is_authorized = $4",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8",
+ "Inet",
+ "Bool"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "9132a40b7729383ce9c108baa1b412e872ae9c96792ae9722f66ccfb24f0a144"
+}
diff --git a/.sqlx/query-92c38d7487d3aa5342fbe4d059cb073400544f1ce454d059ac13b24b32cbdbf4.json b/.sqlx/query-92c38d7487d3aa5342fbe4d059cb073400544f1ce454d059ac13b24b32cbdbf4.json
new file mode 100644
index 000000000..afa7cceb4
--- /dev/null
+++ b/.sqlx/query-92c38d7487d3aa5342fbe4d059cb073400544f1ce454d059ac13b24b32cbdbf4.json
@@ -0,0 +1,47 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "WITH stats AS ( SELECT DISTINCT ON (device_id) device_id, endpoint, latest_handshake FROM wireguard_peer_stats WHERE network = $1 ORDER BY device_id, collected_at DESC ) SELECT d.id as \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created FROM device d JOIN wireguard_network_device wnd ON wnd.device_id = d.id LEFT JOIN stats on d.id = stats.device_id WHERE wnd.wireguard_network_id = $1 AND wnd.is_authorized = true AND (stats.latest_handshake IS NULL OR (NOW() - stats.latest_handshake) > $2 * interval '1 second')",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id?",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "wireguard_pubkey",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "user_id",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 4,
+ "name": "created",
+ "type_info": "Timestamp"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Float8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ false
+ ]
+ },
+ "hash": "92c38d7487d3aa5342fbe4d059cb073400544f1ce454d059ac13b24b32cbdbf4"
+}
diff --git a/.sqlx/query-961bd7d2e2cc98e2b968ccb22e065f5c30566de00d9b96d8a70e3f08a31c9dc2.json b/.sqlx/query-961bd7d2e2cc98e2b968ccb22e065f5c30566de00d9b96d8a70e3f08a31c9dc2.json
deleted file mode 100644
index 3d581539c..000000000
--- a/.sqlx/query-961bd7d2e2cc98e2b968ccb22e065f5c30566de00d9b96d8a70e3f08a31c9dc2.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT\n latest_handshake \"latest_handshake: NaiveDateTime\"\n FROM wireguard_peer_stats_view\n WHERE device_id = $1\n AND latest_handshake IS NOT NULL\n AND (latest_handshake_diff > $2 * interval '1 minute' OR latest_handshake_diff IS NULL)\n AND network = $3\n ORDER BY collected_at DESC\n LIMIT 1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "latest_handshake: NaiveDateTime",
- "type_info": "Timestamp"
- }
- ],
- "parameters": {
- "Left": [
- "Int8",
- "Float8",
- "Int8"
- ]
- },
- "nullable": [
- true
- ]
- },
- "hash": "961bd7d2e2cc98e2b968ccb22e065f5c30566de00d9b96d8a70e3f08a31c9dc2"
-}
diff --git a/.sqlx/query-9838df2efdce6632793cb64bf4a118ceb4a68dad324366ed65813b05cc5ba63c.json b/.sqlx/query-9838df2efdce6632793cb64bf4a118ceb4a68dad324366ed65813b05cc5ba63c.json
deleted file mode 100644
index 919eec6c3..000000000
--- a/.sqlx/query-9838df2efdce6632793cb64bf4a118ceb4a68dad324366ed65813b05cc5ba63c.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n INSERT INTO wireguard_network_allowed_group (network_id, group_id)\n SELECT $1, g.id\n FROM \"group\" g\n WHERE g.name = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "9838df2efdce6632793cb64bf4a118ceb4a68dad324366ed65813b05cc5ba63c"
-}
diff --git a/.sqlx/query-9e659e4a6d973f6603f8c64ea6e7deaf8eb6824c4246d4135274e760b6af73e0.json b/.sqlx/query-9e659e4a6d973f6603f8c64ea6e7deaf8eb6824c4246d4135274e760b6af73e0.json
new file mode 100644
index 000000000..7cf799593
--- /dev/null
+++ b/.sqlx/query-9e659e4a6d973f6603f8c64ea6e7deaf8eb6824c4246d4135274e760b6af73e0.json
@@ -0,0 +1,17 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "UPDATE wireguard_network_device SET wireguard_ip = $3, is_authorized = $4 WHERE device_id = $1 AND wireguard_network_id = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Int8",
+ "Inet",
+ "Bool"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "9e659e4a6d973f6603f8c64ea6e7deaf8eb6824c4246d4135274e760b6af73e0"
+}
diff --git a/.sqlx/query-a2a9f1e0388ce6705deba02473a05c6de14f5f73248769f9faad9c28c411fad8.json b/.sqlx/query-a2a9f1e0388ce6705deba02473a05c6de14f5f73248769f9faad9c28c411fad8.json
deleted file mode 100644
index adb908c90..000000000
--- a/.sqlx/query-a2a9f1e0388ce6705deba02473a05c6de14f5f73248769f9faad9c28c411fad8.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "DELETE FROM token\n WHERE user_id = $1\n AND token_type = 'PASSWORD_RESET'\n AND used_at IS NULL",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "a2a9f1e0388ce6705deba02473a05c6de14f5f73248769f9faad9c28c411fad8"
-}
diff --git a/.sqlx/query-a6074af430326dc14dd2b50a6d2c4217fc4f3b662028eb0c8283b85d5a279eca.json b/.sqlx/query-a6074af430326dc14dd2b50a6d2c4217fc4f3b662028eb0c8283b85d5a279eca.json
new file mode 100644
index 000000000..497c65cca
--- /dev/null
+++ b/.sqlx/query-a6074af430326dc14dd2b50a6d2c4217fc4f3b662028eb0c8283b85d5a279eca.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "INSERT INTO wireguard_network_allowed_group (network_id, group_id) SELECT $1, g.id FROM \"group\" g WHERE g.name = $2",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Text"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "a6074af430326dc14dd2b50a6d2c4217fc4f3b662028eb0c8283b85d5a279eca"
+}
diff --git a/.sqlx/query-aa8bbafc145ad47aaac28e9863c19b1db6a855e917cdaf619a9461ad89b96917.json b/.sqlx/query-aa8bbafc145ad47aaac28e9863c19b1db6a855e917cdaf619a9461ad89b96917.json
deleted file mode 100644
index 96f0ec290..000000000
--- a/.sqlx/query-aa8bbafc145ad47aaac28e9863c19b1db6a855e917cdaf619a9461ad89b96917.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n DELETE FROM wireguard_network_device\n WHERE device_id = $1 AND wireguard_network_id = $2\n ",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Int8"
- ]
- },
- "nullable": []
- },
- "hash": "aa8bbafc145ad47aaac28e9863c19b1db6a855e917cdaf619a9461ad89b96917"
-}
diff --git a/.sqlx/query-ad0934b3563f5ab5ca351d0db6a2677301edffa66042632d02c9b77dd11a1e83.json b/.sqlx/query-ad0934b3563f5ab5ca351d0db6a2677301edffa66042632d02c9b77dd11a1e83.json
deleted file mode 100644
index b5c9df1d1..000000000
--- a/.sqlx/query-ad0934b3563f5ab5ca351d0db6a2677301edffa66042632d02c9b77dd11a1e83.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT name\n FROM wireguard_network_allowed_group wag\n JOIN \"group\" g ON wag.group_id = g.id\n WHERE wag.network_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "name",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false
- ]
- },
- "hash": "ad0934b3563f5ab5ca351d0db6a2677301edffa66042632d02c9b77dd11a1e83"
-}
diff --git a/.sqlx/query-c0e30b2a0b711ea77d88a6dc9c92d0faa187d2bb59bedd0c66d1eae866922901.json b/.sqlx/query-c0e30b2a0b711ea77d88a6dc9c92d0faa187d2bb59bedd0c66d1eae866922901.json
deleted file mode 100644
index 768f9b53d..000000000
--- a/.sqlx/query-c0e30b2a0b711ea77d88a6dc9c92d0faa187d2bb59bedd0c66d1eae866922901.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n WITH stats AS (\n SELECT DISTINCT ON (network) network, endpoint, latest_handshake\n FROM wireguard_peer_stats\n WHERE device_id = $2\n ORDER BY network, collected_at DESC\n )\n SELECT\n n.id as network_id, n.name as network_name, n.endpoint as gateway_endpoint,\n wnd.wireguard_ip as \"device_wireguard_ip: IpAddr\", stats.endpoint as device_endpoint,\n stats.latest_handshake as \"latest_handshake?\",\n COALESCE (((NOW() - stats.latest_handshake) < $1 * interval '1 minute'), false) as \"is_active!\"\n FROM wireguard_network_device wnd\n JOIN wireguard_network n ON n.id = wnd.wireguard_network_id\n LEFT JOIN stats on n.id = stats.network\n WHERE wnd.device_id = $2\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "network_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "network_name",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "gateway_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "device_wireguard_ip: IpAddr",
- "type_info": "Inet"
- },
- {
- "ordinal": 4,
- "name": "device_endpoint",
- "type_info": "Text"
- },
- {
- "ordinal": 5,
- "name": "latest_handshake?",
- "type_info": "Timestamp"
- },
- {
- "ordinal": 6,
- "name": "is_active!",
- "type_info": "Bool"
- }
- ],
- "parameters": {
- "Left": [
- "Float8",
- "Int8"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- false,
- true,
- false,
- null
- ]
- },
- "hash": "c0e30b2a0b711ea77d88a6dc9c92d0faa187d2bb59bedd0c66d1eae866922901"
-}
diff --git a/.sqlx/query-caf97c3a058eac0f9deb4e474b0d76a2d14a75d04f4ea5474e06adc9466a544d.json b/.sqlx/query-caf97c3a058eac0f9deb4e474b0d76a2d14a75d04f4ea5474e06adc9466a544d.json
new file mode 100644
index 000000000..72c3f6bd6
--- /dev/null
+++ b/.sqlx/query-caf97c3a058eac0f9deb4e474b0d76a2d14a75d04f4ea5474e06adc9466a544d.json
@@ -0,0 +1,35 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "SELECT d.wireguard_pubkey as pubkey, preshared_key, array[host(wnd.wireguard_ip)] as \"allowed_ips!: Vec\" FROM wireguard_network_device wnd JOIN device d ON wnd.device_id = d.id WHERE wireguard_network_id = $1 AND (is_authorized = true OR NOT $2) ORDER BY d.id ASC",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "pubkey",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "preshared_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "allowed_ips!: Vec",
+ "type_info": "TextArray"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "Bool"
+ ]
+ },
+ "nullable": [
+ false,
+ true,
+ null
+ ]
+ },
+ "hash": "caf97c3a058eac0f9deb4e474b0d76a2d14a75d04f4ea5474e06adc9466a544d"
+}
diff --git a/.sqlx/query-2da415f5b71186fcfbe7fdf3794606eb73b47c4ec120aaef50aff6c7d075dbdd.json b/.sqlx/query-cbe6cdf1b9dd1d13bbb460726e33001ee45dea8486fb02e8c375d7b513ac0d6d.json
similarity index 82%
rename from .sqlx/query-2da415f5b71186fcfbe7fdf3794606eb73b47c4ec120aaef50aff6c7d075dbdd.json
rename to .sqlx/query-cbe6cdf1b9dd1d13bbb460726e33001ee45dea8486fb02e8c375d7b513ac0d6d.json
index 9581c1f52..26232ef8b 100644
--- a/.sqlx/query-2da415f5b71186fcfbe7fdf3794606eb73b47c4ec120aaef50aff6c7d075dbdd.json
+++ b/.sqlx/query-cbe6cdf1b9dd1d13bbb460726e33001ee45dea8486fb02e8c375d7b513ac0d6d.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT id, mfa_enabled, totp_enabled, email_mfa_enabled, mfa_method as \"mfa_method: MFAMethod\", password_hash FROM \"user\"\n ",
+ "query": "SELECT id, mfa_enabled, totp_enabled, email_mfa_enabled, mfa_method as \"mfa_method: MFAMethod\", password_hash FROM \"user\"",
"describe": {
"columns": [
{
@@ -59,5 +59,5 @@
true
]
},
- "hash": "2da415f5b71186fcfbe7fdf3794606eb73b47c4ec120aaef50aff6c7d075dbdd"
+ "hash": "cbe6cdf1b9dd1d13bbb460726e33001ee45dea8486fb02e8c375d7b513ac0d6d"
}
diff --git a/.sqlx/query-cdda0d8e9b34aef0728fc390bf77a3211b708f23ecdb3df5cada3d628280a025.json b/.sqlx/query-cdda0d8e9b34aef0728fc390bf77a3211b708f23ecdb3df5cada3d628280a025.json
deleted file mode 100644
index c17124309..000000000
--- a/.sqlx/query-cdda0d8e9b34aef0728fc390bf77a3211b708f23ecdb3df5cada3d628280a025.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT d.wireguard_pubkey as pubkey, array[host(wnd.wireguard_ip)] as \"allowed_ips!: Vec\" FROM wireguard_network_device wnd\n JOIN device d\n ON wnd.device_id = d.id\n WHERE wireguard_network_id = $1\n ORDER BY d.id ASC\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "pubkey",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "allowed_ips!: Vec",
- "type_info": "TextArray"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false,
- null
- ]
- },
- "hash": "cdda0d8e9b34aef0728fc390bf77a3211b708f23ecdb3df5cada3d628280a025"
-}
diff --git a/.sqlx/query-d3b425017872becff45f39513c9e09b3d3ba8fc86e97c7f1ff21597a884af06d.json b/.sqlx/query-d3b425017872becff45f39513c9e09b3d3ba8fc86e97c7f1ff21597a884af06d.json
deleted file mode 100644
index 4c499f9f3..000000000
--- a/.sqlx/query-d3b425017872becff45f39513c9e09b3d3ba8fc86e97c7f1ff21597a884af06d.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT wireguard_network_id as network_id, wireguard_ip as \"device_wireguard_ip: IpAddr\"\n FROM wireguard_network_device\n WHERE device_id = $1\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "network_id",
- "type_info": "Int8"
- },
- {
- "ordinal": 1,
- "name": "device_wireguard_ip: IpAddr",
- "type_info": "Inet"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false,
- false
- ]
- },
- "hash": "d3b425017872becff45f39513c9e09b3d3ba8fc86e97c7f1ff21597a884af06d"
-}
diff --git a/.sqlx/query-ee6ed3df25517a6fedf6981166e58601de53af70dd28f69b84caca6e36cb8956.json b/.sqlx/query-ee6ed3df25517a6fedf6981166e58601de53af70dd28f69b84caca6e36cb8956.json
deleted file mode 100644
index d59b060a1..000000000
--- a/.sqlx/query-ee6ed3df25517a6fedf6981166e58601de53af70dd28f69b84caca6e36cb8956.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "INSERT INTO wireguard_network_device\n (device_id, wireguard_network_id, wireguard_ip)\n VALUES ($1, $2, $3)\n ON CONFLICT ON CONSTRAINT device_network\n DO UPDATE SET wireguard_ip = $3",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Int8",
- "Int8",
- "Inet"
- ]
- },
- "nullable": []
- },
- "hash": "ee6ed3df25517a6fedf6981166e58601de53af70dd28f69b84caca6e36cb8956"
-}
diff --git a/.sqlx/query-efe773da199984a169b636cafabd4ee0967c7dc68a04ec930f863d8f3f34c14a.json b/.sqlx/query-efe773da199984a169b636cafabd4ee0967c7dc68a04ec930f863d8f3f34c14a.json
new file mode 100644
index 000000000..408dde103
--- /dev/null
+++ b/.sqlx/query-efe773da199984a169b636cafabd4ee0967c7dc68a04ec930f863d8f3f34c14a.json
@@ -0,0 +1,59 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "WITH stats AS ( SELECT DISTINCT ON (network) network, endpoint, latest_handshake FROM wireguard_peer_stats WHERE device_id = $2 ORDER BY network, collected_at DESC ) SELECT n.id as network_id, n.name as network_name, n.endpoint as gateway_endpoint, wnd.wireguard_ip as \"device_wireguard_ip: IpAddr\", stats.endpoint as device_endpoint, stats.latest_handshake as \"latest_handshake?\", COALESCE (((NOW() - stats.latest_handshake) < $1 * interval '1 minute'), false) as \"is_active!\" FROM wireguard_network_device wnd JOIN wireguard_network n ON n.id = wnd.wireguard_network_id LEFT JOIN stats on n.id = stats.network WHERE wnd.device_id = $2",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "network_id",
+ "type_info": "Int8"
+ },
+ {
+ "ordinal": 1,
+ "name": "network_name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "gateway_endpoint",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "device_wireguard_ip: IpAddr",
+ "type_info": "Inet"
+ },
+ {
+ "ordinal": 4,
+ "name": "device_endpoint",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 5,
+ "name": "latest_handshake?",
+ "type_info": "Timestamp"
+ },
+ {
+ "ordinal": 6,
+ "name": "is_active!",
+ "type_info": "Bool"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Float8",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ true,
+ false,
+ null
+ ]
+ },
+ "hash": "efe773da199984a169b636cafabd4ee0967c7dc68a04ec930f863d8f3f34c14a"
+}
diff --git a/.sqlx/query-e19b29d2e52ad2a2a5c20ce205d5c949d02219fd252d78f7fffa202cc804b4c2.json b/.sqlx/query-f222309aff56e5182091655c0a6c34cddfee21a48f981c3ca22a6e064c18a769.json
similarity index 62%
rename from .sqlx/query-e19b29d2e52ad2a2a5c20ce205d5c949d02219fd252d78f7fffa202cc804b4c2.json
rename to .sqlx/query-f222309aff56e5182091655c0a6c34cddfee21a48f981c3ca22a6e064c18a769.json
index e1fe0b4b9..25ae273d7 100644
--- a/.sqlx/query-e19b29d2e52ad2a2a5c20ce205d5c949d02219fd252d78f7fffa202cc804b4c2.json
+++ b/.sqlx/query-f222309aff56e5182091655c0a6c34cddfee21a48f981c3ca22a6e064c18a769.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "INSERT INTO \"wireguard_network\" (\"name\",\"address\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\",\"connected_at\") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING id",
+ "query": "INSERT INTO \"wireguard_network\" (\"name\",\"address\",\"port\",\"pubkey\",\"prvkey\",\"endpoint\",\"dns\",\"allowed_ips\",\"connected_at\",\"mfa_enabled\",\"keepalive_interval\",\"peer_disconnect_threshold\") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12) RETURNING id",
"describe": {
"columns": [
{
@@ -19,12 +19,15 @@
"Text",
"Text",
"InetArray",
- "Timestamp"
+ "Timestamp",
+ "Bool",
+ "Int4",
+ "Int4"
]
},
"nullable": [
false
]
},
- "hash": "e19b29d2e52ad2a2a5c20ce205d5c949d02219fd252d78f7fffa202cc804b4c2"
+ "hash": "f222309aff56e5182091655c0a6c34cddfee21a48f981c3ca22a6e064c18a769"
}
diff --git a/.sqlx/query-f2c353b073b98ba636f9fbde139c2be9ba6f3cda184e0ee772cf900f8f110bd8.json b/.sqlx/query-f2c353b073b98ba636f9fbde139c2be9ba6f3cda184e0ee772cf900f8f110bd8.json
new file mode 100644
index 000000000..f0fca8cb4
--- /dev/null
+++ b/.sqlx/query-f2c353b073b98ba636f9fbde139c2be9ba6f3cda184e0ee772cf900f8f110bd8.json
@@ -0,0 +1,15 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "DELETE FROM wireguard_network_allowed_group WHERE network_id = $1 AND group_id IN ( SELECT id FROM \"group\" WHERE name IN (SELECT * FROM UNNEST($2::text[])) )",
+ "describe": {
+ "columns": [],
+ "parameters": {
+ "Left": [
+ "Int8",
+ "TextArray"
+ ]
+ },
+ "nullable": []
+ },
+ "hash": "f2c353b073b98ba636f9fbde139c2be9ba6f3cda184e0ee772cf900f8f110bd8"
+}
diff --git a/.sqlx/query-0b53e81d6f1ce3c3a68c871e7a4b9e41db58b112d12281516e10421d46fbbd94.json b/.sqlx/query-fdbb9308a58ade3fd1cba272fe3979ed4bafb1ee079fd8b23ac9c2ef95db2312.json
similarity index 59%
rename from .sqlx/query-0b53e81d6f1ce3c3a68c871e7a4b9e41db58b112d12281516e10421d46fbbd94.json
rename to .sqlx/query-fdbb9308a58ade3fd1cba272fe3979ed4bafb1ee079fd8b23ac9c2ef95db2312.json
index 828f2523d..dd54ba7fc 100644
--- a/.sqlx/query-0b53e81d6f1ce3c3a68c871e7a4b9e41db58b112d12281516e10421d46fbbd94.json
+++ b/.sqlx/query-fdbb9308a58ade3fd1cba272fe3979ed4bafb1ee079fd8b23ac9c2ef95db2312.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT DISTINCT ON (d.id) d.id as \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created\n FROM device d\n JOIN \"user\" u ON d.user_id = u.id\n JOIN group_user gu ON u.id = gu.user_id\n JOIN \"group\" g ON gu.group_id = g.id\n WHERE g.\"name\" IN (SELECT * FROM UNNEST($1::text[]))\n ORDER BY d.id ASC\n ",
+ "query": "SELECT DISTINCT ON (d.id) d.id as \"id?\", d.name, d.wireguard_pubkey, d.user_id, d.created FROM device d JOIN \"user\" u ON d.user_id = u.id JOIN group_user gu ON u.id = gu.user_id JOIN \"group\" g ON gu.group_id = g.id WHERE g.\"name\" IN (SELECT * FROM UNNEST($1::text[]))\n ORDER BY d.id ASC",
"describe": {
"columns": [
{
@@ -42,5 +42,5 @@
false
]
},
- "hash": "0b53e81d6f1ce3c3a68c871e7a4b9e41db58b112d12281516e10421d46fbbd94"
+ "hash": "fdbb9308a58ade3fd1cba272fe3979ed4bafb1ee079fd8b23ac9c2ef95db2312"
}
diff --git a/.sqlx/query-8880011a898ca2b97b0cfdbf027509d4855f46e4871caaa1fc95f2f612efcc4b.json b/.sqlx/query-ff9f1363df5b9dc633767b0d3addedea0baba7447d4557f681f26c666a2c47bc.json
similarity index 57%
rename from .sqlx/query-8880011a898ca2b97b0cfdbf027509d4855f46e4871caaa1fc95f2f612efcc4b.json
rename to .sqlx/query-ff9f1363df5b9dc633767b0d3addedea0baba7447d4557f681f26c666a2c47bc.json
index bb241b225..b4ff83fef 100644
--- a/.sqlx/query-8880011a898ca2b97b0cfdbf027509d4855f46e4871caaa1fc95f2f612efcc4b.json
+++ b/.sqlx/query-ff9f1363df5b9dc633767b0d3addedea0baba7447d4557f681f26c666a2c47bc.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\"\n FROM wireguard_network_device WHERE device_id = $1",
+ "query": "SELECT device_id, wireguard_network_id, wireguard_ip as \"wireguard_ip: IpAddr\", preshared_key, is_authorized FROM wireguard_network_device WHERE wireguard_network_id = $1",
"describe": {
"columns": [
{
@@ -17,6 +17,16 @@
"ordinal": 2,
"name": "wireguard_ip: IpAddr",
"type_info": "Inet"
+ },
+ {
+ "ordinal": 3,
+ "name": "preshared_key",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "is_authorized",
+ "type_info": "Bool"
}
],
"parameters": {
@@ -27,8 +37,10 @@
"nullable": [
false,
false,
+ false,
+ true,
false
]
},
- "hash": "8880011a898ca2b97b0cfdbf027509d4855f46e4871caaa1fc95f2f612efcc4b"
+ "hash": "ff9f1363df5b9dc633767b0d3addedea0baba7447d4557f681f26c666a2c47bc"
}
diff --git a/Cargo.lock b/Cargo.lock
index de5d7e60b..2fc3b589f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -54,9 +54,9 @@ dependencies = [
[[package]]
name = "ahash"
-version = "0.8.6"
+version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
+checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
dependencies = [
"cfg-if",
"getrandom",
@@ -97,9 +97,9 @@ dependencies = [
[[package]]
name = "anstream"
-version = "0.6.4"
+version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
+checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba"
dependencies = [
"anstyle",
"anstyle-parse",
@@ -126,9 +126,9 @@ dependencies = [
[[package]]
name = "anstyle-query"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748"
+checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
dependencies = [
"windows-sys 0.52.0",
]
@@ -145,9 +145,9 @@ dependencies = [
[[package]]
name = "anyhow"
-version = "1.0.75"
+version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
+checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]]
name = "argon2"
@@ -225,18 +225,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
name = "async-trait"
-version = "0.1.74"
+version = "0.1.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
+checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -288,8 +288,8 @@ dependencies = [
"bytes",
"futures-util",
"http 0.2.11",
- "http-body 0.4.5",
- "hyper 0.14.27",
+ "http-body 0.4.6",
+ "hyper 0.14.28",
"itoa",
"matchit",
"memchr",
@@ -306,18 +306,18 @@ dependencies = [
[[package]]
name = "axum"
-version = "0.7.2"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "202651474fe73c62d9e0a56c6133f7a0ff1dc1c8cf7a5b03381af2a26553ac9d"
+checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e"
dependencies = [
"async-trait",
- "axum-core 0.4.1",
+ "axum-core 0.4.3",
"bytes",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
"http-body-util",
- "hyper 1.0.1",
+ "hyper 1.1.0",
"hyper-util",
"itoa",
"matchit",
@@ -335,6 +335,7 @@ dependencies = [
"tower",
"tower-layer",
"tower-service",
+ "tracing",
]
[[package]]
@@ -343,7 +344,7 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f5ffe4637708b326c621d5494ab6c91dcf62ee440fa6ee967d289315a9c6f81"
dependencies = [
- "axum 0.7.2",
+ "axum 0.7.4",
"forwarded-header-value",
"serde",
]
@@ -358,7 +359,7 @@ dependencies = [
"bytes",
"futures-util",
"http 0.2.11",
- "http-body 0.4.5",
+ "http-body 0.4.6",
"mime",
"rustversion",
"tower-layer",
@@ -367,9 +368,9 @@ dependencies = [
[[package]]
name = "axum-core"
-version = "0.4.1"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77cb22c689c44d4c07b0ab44ebc25d69d8ae601a2f28fb8d672d344178fa17aa"
+checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3"
dependencies = [
"async-trait",
"bytes",
@@ -383,17 +384,19 @@ dependencies = [
"sync_wrapper",
"tower-layer",
"tower-service",
+ "tracing",
]
[[package]]
name = "axum-extra"
-version = "0.9.0"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "523ae92256049a3b02d3bb4df80152386cd97ddba0c8c5077619bdc8c4b1859b"
+checksum = "895ff42f72016617773af68fb90da2a9677d89c62338ec09162d4909d86fdd8f"
dependencies = [
- "axum 0.7.2",
- "axum-core 0.4.1",
+ "axum 0.7.4",
+ "axum-core 0.4.3",
"bytes",
+ "cookie 0.18.0",
"futures-util",
"headers",
"http 1.0.0",
@@ -442,9 +445,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
-version = "0.21.5"
+version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9"
+checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]]
name = "base64ct"
@@ -458,20 +461,11 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18b3d30abb74120a9d5267463b9e0045fdccc4dd152e7249d966612dc1721384"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"serde",
"serde_json",
]
-[[package]]
-name = "bincode"
-version = "1.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "bitflags"
version = "1.3.2"
@@ -519,9 +513,9 @@ dependencies = [
[[package]]
name = "bstr"
-version = "1.8.0"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c"
+checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc"
dependencies = [
"memchr",
"serde",
@@ -586,9 +580,9 @@ dependencies = [
[[package]]
name = "chrono-tz"
-version = "0.8.4"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e23185c0e21df6ed832a12e2bda87c7d1def6842881fb634a8511ced741b0d76"
+checksum = "91d7b79e99bfaa0d47da0687c43aa3b7381938a62ad3a6498599039321f660b7"
dependencies = [
"chrono",
"chrono-tz-build",
@@ -637,9 +631,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.4.11"
+version = "4.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2"
+checksum = "80932e03c33999b9235edb8655bc9df3204adc9887c2f95b50cb1deb9fd54253"
dependencies = [
"clap_builder",
"clap_derive",
@@ -647,9 +641,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.4.11"
+version = "4.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb"
+checksum = "d6c0db58c659eef1c73e444d298c27322a1b52f6927d2ad470c0c0f96fa7b8fa"
dependencies = [
"anstream",
"anstyle",
@@ -666,7 +660,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -713,9 +707,9 @@ dependencies = [
[[package]]
name = "const-oid"
-version = "0.9.5"
+version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f"
+checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]]
name = "const-random"
@@ -761,12 +755,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8"
dependencies = [
"aes-gcm",
- "base64 0.21.5",
- "hkdf",
- "hmac",
+ "base64 0.21.7",
"percent-encoding",
"rand",
- "sha2",
"subtle",
"time",
"version_check",
@@ -807,9 +798,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"
[[package]]
name = "cpufeatures"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
+checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
dependencies = [
"libc",
]
@@ -840,46 +831,37 @@ dependencies = [
[[package]]
name = "crossbeam-deque"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
+checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
dependencies = [
- "cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
-version = "0.9.15"
+version = "0.9.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
+checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
dependencies = [
- "autocfg",
- "cfg-if",
"crossbeam-utils",
- "memoffset",
- "scopeguard",
]
[[package]]
name = "crossbeam-queue"
-version = "0.3.8"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add"
+checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35"
dependencies = [
- "cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
-version = "0.8.16"
+version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
-dependencies = [
- "cfg-if",
-]
+checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
[[package]]
name = "crunchy"
@@ -944,7 +926,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -968,7 +950,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -979,7 +961,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5"
dependencies = [
"darling_core",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -994,11 +976,10 @@ version = "0.8.0"
dependencies = [
"anyhow",
"argon2",
- "axum 0.7.2",
+ "axum 0.7.4",
"axum-client-ip",
"axum-extra",
- "base64 0.21.5",
- "bincode",
+ "base64 0.21.7",
"bytes",
"chrono",
"claims",
@@ -1036,12 +1017,12 @@ dependencies = [
"struct-patch",
"tera",
"thiserror",
+ "time",
"tiny-keccak",
"tokio",
"tokio-stream",
"tonic",
"tonic-build",
- "tower-cookies",
"tower-http",
"tracing",
"tracing-subscriber",
@@ -1080,9 +1061,9 @@ dependencies = [
[[package]]
name = "deranged"
-version = "0.3.10"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [
"powerfmt",
"serde",
@@ -1103,9 +1084,9 @@ dependencies = [
[[package]]
name = "deunicode"
-version = "1.4.1"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a1abaf4d861455be59f64fd2b55606cb151fce304ede7165f410243ce96bde6"
+checksum = "3ae2a35373c5c74340b79ae6780b498b2b183915ec5dacf263aac5a099bf485a"
[[package]]
name = "digest"
@@ -1127,7 +1108,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -1225,7 +1206,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbfb21b9878cf7a348dcb8559109aabc0ec40d69924bd706fa5149846c4fef75"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"memchr",
]
@@ -1321,9 +1302,9 @@ dependencies = [
[[package]]
name = "ethers-core"
-version = "2.0.11"
+version = "2.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f03e0bdc216eeb9e355b90cf610ef6c5bb8aca631f97b5ae9980ce34ea7878d"
+checksum = "918b1a9ba585ea61022647def2f27c29ba19f6d2a4a4c8f68a9ae97fd5769737"
dependencies = [
"arrayvec",
"bytes",
@@ -1467,9 +1448,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c"
[[package]]
name = "futures"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335"
+checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
dependencies = [
"futures-channel",
"futures-core",
@@ -1482,9 +1463,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
+checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
dependencies = [
"futures-core",
"futures-sink",
@@ -1492,15 +1473,15 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
+checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-executor"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"
+checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
dependencies = [
"futures-core",
"futures-task",
@@ -1520,38 +1501,38 @@ dependencies = [
[[package]]
name = "futures-io"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
+checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-macro"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
+checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
name = "futures-sink"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"
+checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
[[package]]
name = "futures-task"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
+checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-util"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
+checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-channel",
"futures-core",
@@ -1587,9 +1568,9 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.11"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f"
+checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [
"cfg-if",
"js-sys",
@@ -1651,9 +1632,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.3.22"
+version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178"
+checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7"
dependencies = [
"bytes",
"fnv",
@@ -1670,9 +1651,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d308f63daf4181410c242d34c11f928dcb3aa105852019e043c9d1f4e4368a"
+checksum = "991910e35c615d8cab86b5ab04be67e6ad24d2bf5f4f11fdbbed26da999bbeab"
dependencies = [
"bytes",
"fnv",
@@ -1724,7 +1705,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"bytes",
"headers-core",
"http 1.0.0",
@@ -1765,9 +1746,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hkdf"
-version = "0.12.3"
+version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437"
+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"hmac",
]
@@ -1783,11 +1764,11 @@ dependencies = [
[[package]]
name = "home"
-version = "0.5.5"
+version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
+checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
dependencies = [
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -1825,9 +1806,9 @@ dependencies = [
[[package]]
name = "http-body"
-version = "0.4.5"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
+checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
dependencies = [
"bytes",
"http 0.2.11",
@@ -1892,22 +1873,22 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "hyper"
-version = "0.14.27"
+version = "0.14.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468"
+checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
dependencies = [
"bytes",
"futures-channel",
"futures-core",
"futures-util",
- "h2 0.3.22",
+ "h2 0.3.23",
"http 0.2.11",
- "http-body 0.4.5",
+ "http-body 0.4.6",
"httparse",
"httpdate",
"itoa",
"pin-project-lite",
- "socket2 0.4.10",
+ "socket2",
"tokio",
"tower-service",
"tracing",
@@ -1916,14 +1897,14 @@ dependencies = [
[[package]]
name = "hyper"
-version = "1.0.1"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "403f9214f3e703236b221f1a9cd88ec8b4adfa5296de01ab96216361f4692f56"
+checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
- "h2 0.4.0",
+ "h2 0.4.1",
"http 1.0.0",
"http-body 1.0.0",
"httparse",
@@ -1941,7 +1922,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
dependencies = [
"futures-util",
"http 0.2.11",
- "hyper 0.14.27",
+ "hyper 0.14.28",
"rustls",
"tokio",
"tokio-rustls",
@@ -1953,7 +1934,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
dependencies = [
- "hyper 0.14.27",
+ "hyper 0.14.28",
"pin-project-lite",
"tokio",
"tokio-io-timeout",
@@ -1966,7 +1947,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
"bytes",
- "hyper 0.14.27",
+ "hyper 0.14.28",
"native-tls",
"tokio",
"tokio-native-tls",
@@ -1974,29 +1955,27 @@ dependencies = [
[[package]]
name = "hyper-util"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ca339002caeb0d159cc6e023dff48e199f081e42fa039895c7c6f38b37f2e9d"
+checksum = "bdea9aac0dbe5a9240d68cfd9501e2db94222c6dc06843e06640b9e07f0fdc67"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http 1.0.0",
"http-body 1.0.0",
- "hyper 1.0.1",
+ "hyper 1.1.0",
"pin-project-lite",
- "socket2 0.5.5",
+ "socket2",
"tokio",
- "tower",
- "tower-service",
"tracing",
]
[[package]]
name = "iana-time-zone"
-version = "0.1.58"
+version = "0.1.59"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20"
+checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539"
dependencies = [
"android_system_properties",
"core-foundation-sys",
@@ -2054,9 +2033,9 @@ dependencies = [
[[package]]
name = "ignore"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060"
+checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1"
dependencies = [
"crossbeam-deque",
"globset",
@@ -2181,15 +2160,15 @@ dependencies = [
[[package]]
name = "itoa"
-version = "1.0.9"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
+checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
[[package]]
name = "js-sys"
-version = "0.3.66"
+version = "0.3.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca"
+checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1"
dependencies = [
"wasm-bindgen",
]
@@ -2200,7 +2179,7 @@ version = "9.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"js-sys",
"pem",
"ring 0.17.7",
@@ -2211,9 +2190,9 @@ dependencies = [
[[package]]
name = "k256"
-version = "0.13.2"
+version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b"
+checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b"
dependencies = [
"cfg-if",
"ecdsa",
@@ -2224,9 +2203,9 @@ dependencies = [
[[package]]
name = "keccak"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940"
+checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654"
dependencies = [
"cpufeatures",
]
@@ -2276,12 +2255,12 @@ dependencies = [
[[package]]
name = "lettre"
-version = "0.11.2"
+version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a48c2e9831b370bc2d7233c2620298c45f3a158ed6b4b8d7416b2ada5a268fd8"
+checksum = "f5aaf628956b6b0852e12ac3505d20d7a12ecc1e32d5ea921f002af4a74036a5"
dependencies = [
"async-trait",
- "base64 0.21.5",
+ "base64 0.21.7",
"chumsky",
"email-encoding",
"email_address",
@@ -2294,9 +2273,8 @@ dependencies = [
"mime",
"native-tls",
"nom",
- "once_cell",
"quoted_printable",
- "socket2 0.5.5",
+ "socket2",
"tokio",
"tokio-native-tls",
"url",
@@ -2304,9 +2282,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.150"
+version = "0.2.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
+checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
[[package]]
name = "libm"
@@ -2401,18 +2379,9 @@ dependencies = [
[[package]]
name = "memchr"
-version = "2.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
-
-[[package]]
-name = "memoffset"
-version = "0.9.0"
+version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
-dependencies = [
- "autocfg",
-]
+checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "mime"
@@ -2461,7 +2430,7 @@ name = "model_derive"
version = "0.1.2"
dependencies = [
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -2596,23 +2565,23 @@ dependencies = [
[[package]]
name = "num_enum"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0"
+checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e"
+checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
- "proc-macro-crate 2.0.1",
+ "proc-macro-crate 3.0.0",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -2636,9 +2605,9 @@ dependencies = [
[[package]]
name = "object"
-version = "0.32.1"
+version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
+checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
@@ -2654,9 +2623,9 @@ dependencies = [
[[package]]
name = "once_cell"
-version = "1.18.0"
+version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
+checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "opaque-debug"
@@ -2723,9 +2692,9 @@ dependencies = [
[[package]]
name = "openssl"
-version = "0.10.61"
+version = "0.10.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45"
+checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671"
dependencies = [
"bitflags 2.4.1",
"cfg-if",
@@ -2744,7 +2713,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -2755,9 +2724,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
-version = "0.9.97"
+version = "0.9.98"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b"
+checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7"
dependencies = [
"cc",
"libc",
@@ -2845,7 +2814,7 @@ version = "3.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b"
dependencies = [
- "proc-macro-crate 2.0.1",
+ "proc-macro-crate 2.0.0",
"proc-macro2",
"quote",
"syn 1.0.109",
@@ -2902,11 +2871,11 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
[[package]]
name = "pem"
-version = "3.0.2"
+version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923"
+checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"serde",
]
@@ -2927,9 +2896,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "pest"
-version = "2.7.5"
+version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5"
+checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06"
dependencies = [
"memchr",
"thiserror",
@@ -2938,9 +2907,9 @@ dependencies = [
[[package]]
name = "pest_derive"
-version = "2.7.5"
+version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2"
+checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde"
dependencies = [
"pest",
"pest_generator",
@@ -2948,22 +2917,22 @@ dependencies = [
[[package]]
name = "pest_generator"
-version = "2.7.5"
+version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227"
+checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275"
dependencies = [
"pest",
"pest_meta",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
name = "pest_meta"
-version = "2.7.5"
+version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6"
+checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d"
dependencies = [
"once_cell",
"pest",
@@ -3035,7 +3004,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -3073,15 +3042,15 @@ dependencies = [
[[package]]
name = "pkg-config"
-version = "0.3.27"
+version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
+checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a"
[[package]]
name = "platforms"
-version = "3.2.0"
+version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0"
+checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c"
[[package]]
name = "polyval"
@@ -3109,12 +3078,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
name = "prettyplease"
-version = "0.2.15"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
+checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5"
dependencies = [
"proc-macro2",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -3152,12 +3121,20 @@ dependencies = [
[[package]]
name = "proc-macro-crate"
-version = "2.0.1"
+version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a"
+checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8"
dependencies = [
- "toml_datetime",
- "toml_edit 0.20.2",
+ "toml_edit 0.20.7",
+]
+
+[[package]]
+name = "proc-macro-crate"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd"
+dependencies = [
+ "toml_edit 0.21.0",
]
[[package]]
@@ -3186,9 +3163,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.70"
+version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
+checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
dependencies = [
"unicode-ident",
]
@@ -3236,7 +3213,7 @@ dependencies = [
"prost",
"prost-types",
"regex",
- "syn 2.0.39",
+ "syn 2.0.48",
"tempfile",
"which",
]
@@ -3251,7 +3228,7 @@ dependencies = [
"itertools 0.11.0",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -3302,9 +3279,9 @@ dependencies = [
[[package]]
name = "quote"
-version = "1.0.33"
+version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@@ -3415,21 +3392,21 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "reqwest"
-version = "0.11.22"
+version = "0.11.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b"
+checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"bytes",
"cookie 0.16.2",
"cookie_store",
"encoding_rs",
"futures-core",
"futures-util",
- "h2 0.3.22",
+ "h2 0.3.23",
"http 0.2.11",
- "http-body 0.4.5",
- "hyper 0.14.27",
+ "http-body 0.4.6",
+ "hyper 0.14.28",
"hyper-rustls",
"hyper-tls",
"ipnet",
@@ -3594,9 +3571,9 @@ dependencies = [
[[package]]
name = "rustix"
-version = "0.38.26"
+version = "0.38.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a"
+checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
dependencies = [
"bitflags 2.4.1",
"errno",
@@ -3607,9 +3584,9 @@ dependencies = [
[[package]]
name = "rustls"
-version = "0.21.9"
+version = "0.21.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9"
+checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba"
dependencies = [
"log",
"ring 0.17.7",
@@ -3635,7 +3612,7 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
]
[[package]]
@@ -3656,9 +3633,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
[[package]]
name = "ryu"
-version = "1.0.15"
+version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
+checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
[[package]]
name = "same-file"
@@ -3695,11 +3672,11 @@ dependencies = [
[[package]]
name = "schannel"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88"
+checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534"
dependencies = [
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -3734,9 +3711,9 @@ dependencies = [
[[package]]
name = "secp256k1"
-version = "0.28.0"
+version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5"
+checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27"
dependencies = [
"rand",
"secp256k1-sys",
@@ -3744,9 +3721,9 @@ dependencies = [
[[package]]
name = "secp256k1-sys"
-version = "0.9.1"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4dd97a086ec737e30053fd5c46f097465d25bb81dd3608825f65298c4c98be83"
+checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb"
dependencies = [
"cc",
]
@@ -3786,15 +3763,15 @@ dependencies = [
[[package]]
name = "semver"
-version = "1.0.20"
+version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
+checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]]
name = "serde"
-version = "1.0.193"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
+checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [
"serde_derive",
]
@@ -3821,20 +3798,20 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.193"
+version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
+checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
name = "serde_json"
-version = "1.0.108"
+version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
+checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [
"itoa",
"ryu",
@@ -3843,9 +3820,9 @@ dependencies = [
[[package]]
name = "serde_path_to_error"
-version = "0.1.14"
+version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335"
+checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c"
dependencies = [
"itoa",
"serde",
@@ -3889,7 +3866,7 @@ version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23"
dependencies = [
- "base64 0.21.5",
+ "base64 0.21.7",
"chrono",
"hex",
"indexmap 1.9.3",
@@ -3909,7 +3886,7 @@ dependencies = [
"darling",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4025,19 +4002,9 @@ dependencies = [
[[package]]
name = "smallvec"
-version = "1.11.2"
+version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
-
-[[package]]
-name = "socket2"
-version = "0.4.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
-dependencies = [
- "libc",
- "winapi",
-]
+checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e"
[[package]]
name = "socket2"
@@ -4189,7 +4156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4"
dependencies = [
"atoi",
- "base64 0.21.5",
+ "base64 0.21.7",
"bitflags 2.4.1",
"byteorder",
"bytes",
@@ -4233,7 +4200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24"
dependencies = [
"atoi",
- "base64 0.21.5",
+ "base64 0.21.7",
"bitflags 2.4.1",
"byteorder",
"chrono",
@@ -4346,7 +4313,7 @@ checksum = "f14a349c27ebe59faba22f933c9c734d428da7231e88a247e9d8c61eea964ddb"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4368,7 +4335,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4390,9 +4357,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.39"
+version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
+checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [
"proc-macro2",
"quote",
@@ -4446,15 +4413,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "tempfile"
-version = "3.8.1"
+version = "3.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
+checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
dependencies = [
"cfg-if",
"fastrand",
"redox_syscall",
"rustix",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -4481,22 +4448,22 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4511,9 +4478,9 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
+checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
dependencies = [
"deranged",
"itoa",
@@ -4531,9 +4498,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
-version = "0.2.15"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
+checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f"
dependencies = [
"time-core",
]
@@ -4564,9 +4531,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.34.0"
+version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
+checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
dependencies = [
"backtrace",
"bytes",
@@ -4575,7 +4542,7 @@ dependencies = [
"num_cpus",
"parking_lot",
"pin-project-lite",
- "socket2 0.5.5",
+ "socket2",
"tokio-macros",
"windows-sys 0.48.0",
]
@@ -4598,7 +4565,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4648,9 +4615,9 @@ dependencies = [
[[package]]
name = "toml_datetime"
-version = "0.6.3"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
+checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1"
[[package]]
name = "toml_edit"
@@ -4665,9 +4632,20 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.20.2"
+version = "0.20.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338"
+checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81"
+dependencies = [
+ "indexmap 2.1.0",
+ "toml_datetime",
+ "winnow",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.21.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03"
dependencies = [
"indexmap 2.1.0",
"toml_datetime",
@@ -4683,13 +4661,13 @@ dependencies = [
"async-stream",
"async-trait",
"axum 0.6.20",
- "base64 0.21.5",
+ "base64 0.21.7",
"bytes",
"flate2",
- "h2 0.3.22",
+ "h2 0.3.23",
"http 0.2.11",
- "http-body 0.4.5",
- "hyper 0.14.27",
+ "http-body 0.4.6",
+ "hyper 0.14.28",
"hyper-timeout",
"percent-encoding",
"pin-project",
@@ -4716,7 +4694,7 @@ dependencies = [
"proc-macro2",
"prost-build",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4739,28 +4717,11 @@ dependencies = [
"tracing",
]
-[[package]]
-name = "tower-cookies"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fd0118512cf0b3768f7fcccf0bef1ae41d68f2b45edc1e77432b36c97c56c6d"
-dependencies = [
- "async-trait",
- "axum-core 0.4.1",
- "cookie 0.18.0",
- "futures-util",
- "http 1.0.0",
- "parking_lot",
- "pin-project-lite",
- "tower-layer",
- "tower-service",
-]
-
[[package]]
name = "tower-http"
-version = "0.5.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09e12e6351354851911bdf8c2b8f2ab15050c567d70a8b9a37ae7b8301a4080d"
+checksum = "0da193277a4e2c33e59e09b5861580c33dd0a637c3883d0fa74ba40c0374af2e"
dependencies = [
"bitflags 2.4.1",
"bytes",
@@ -4813,7 +4774,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -4857,9 +4818,9 @@ dependencies = [
[[package]]
name = "try-lock"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
+checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
@@ -5110,9 +5071,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.89"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e"
+checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -5120,24 +5081,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.89"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826"
+checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.39"
+version = "0.4.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12"
+checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461"
dependencies = [
"cfg-if",
"js-sys",
@@ -5147,9 +5108,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.89"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2"
+checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -5157,22 +5118,22 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.89"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
+checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.89"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f"
+checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"
[[package]]
name = "wasm-streams"
@@ -5189,9 +5150,9 @@ dependencies = [
[[package]]
name = "web-sys"
-version = "0.3.66"
+version = "0.3.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f"
+checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -5323,11 +5284,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-core"
-version = "0.51.1"
+version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
+checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
- "windows-targets 0.48.5",
+ "windows-targets 0.52.0",
]
[[package]]
@@ -5464,9 +5425,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]]
name = "winnow"
-version = "0.5.25"
+version = "0.5.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7e87b8dfbe3baffbe687eef2e164e32286eff31a5ee16463ce03d991643ec94"
+checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16"
dependencies = [
"memchr",
]
@@ -5531,22 +5492,22 @@ dependencies = [
[[package]]
name = "zerocopy"
-version = "0.7.29"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e"
+checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.7.29"
+version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2"
+checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -5566,5 +5527,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
diff --git a/Cargo.toml b/Cargo.toml
index 3be2b52cd..112b97668 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,9 @@
name = "defguard"
version = "0.8.0"
edition = "2021"
+license = "Apache-2.0"
+homepage = "https://defguard.net/"
+repository = "https://github.com/DefGuard/defguard"
[workspace]
@@ -11,9 +14,12 @@ anyhow = "1.0"
argon2 = { version = "0.5", features = ["std"] }
axum = { version = "0.7" }
axum-client-ip = "0.5"
-axum-extra = { version = "0.9", features = ["typed-header"] }
+axum-extra = { version = "0.9", features = [
+ "cookie",
+ "cookie-private",
+ "typed-header",
+] }
base64 = "0.21"
-bincode = "1.3"
chrono = { version = "0.4", default-features = false, features = [
"clock",
"serde",
@@ -26,7 +32,7 @@ humantime = "2.1"
# match ipnetwork version from sqlx
ipnetwork = { version = "0.20", features = ["serde"] }
jsonwebtoken = "9.2"
-ldap3 = "0.11"
+ldap3 = { version = "0.11", default-features = false, features = ["tls"] }
lettre = { version = "0.11", features = ["tokio1", "tokio1-native-tls"] }
md4 = "0.10"
otpauth = "0.4"
@@ -59,8 +65,11 @@ sqlx = { version = "0.7", features = [
"postgres",
"uuid",
] }
+struct-patch = "0.4"
tera = "1.19"
thiserror = "1.0"
+# match axum-extra -> cookies
+time = { version = "0.3", default-features = false }
tiny-keccak = { version = "2.0", features = ["keccak"] }
tokio = { version = "1", features = [
"macros",
@@ -72,7 +81,6 @@ tokio = { version = "1", features = [
] }
tokio-stream = "0.1"
tonic = { version = "0.10", features = ["gzip", "tls", "tls-roots"] }
-tower-cookies = { version = "0.10", features = ["private"] }
tower-http = { version = "0.5", features = ["fs", "trace"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
@@ -84,7 +92,6 @@ webauthn-rs = { version = "0.4", features = [
] }
webauthn-rs-proto = "0.4"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
-struct-patch = "0.4"
[dev-dependencies]
bytes = "1.5"
diff --git a/Dockerfile b/Dockerfile
index 574a987c0..cf8e819f6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM rust:1.74 as chef
+FROM rust:1.75 as chef
WORKDIR /build
diff --git a/README.md b/README.md
index 69619d9a9..3d35f8d24 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-defguard is an **SSO & VPN Server** based on **OpenID and Wireguard VPN** with unique secure&private architecture for **building secure and privacy-aware organizations**.
+defguard is an **SSO & VPN Server** based on **OpenID and WireGuard VPN** with unique secure&private architecture for **building secure and privacy-aware organizations**.
By design **defguard core is meant to be deployed in your secure network segments** (available only from an internal network or by VPN) and operations that require **public access** (like user onboarding, enrollment, password reset, etc.) are done using a **secure proxy**.
@@ -16,8 +16,8 @@ Read more about this in [our documentation](https://defguard.gitbook.io/defguard
- LDAP (tested on [OpenLDAP](https://www.openldap.org/)) synchronization
- [forward auth](https://defguard.gitbook.io/defguard/features/forward-auth) for reverse proxies (tested with Traefik and Caddy)
- nice UI to manage users
- - Users **self-service** (besides typical data management, users can revoke access to granted apps, MFA, Wireguard, etc.)
-* [Wireguard:tm:](https://www.wireguard.com/) VPN management with:
+ - Users **self-service** (besides typical data management, users can revoke access to granted apps, MFA, WireGuard, etc.)
+* [WireGuard:tm:](https://www.wireguard.com/) VPN management with:
- multiple VPN Locations (networks/sites) - with defined access (all users or only Admin group)
- multiple [Gateways](https://github.com/DefGuard/gateway) for each VPN Location (**high availability/failover**) - supported on a cluster of routers/firewalls for Linux, FreeBSD/PFSense/OPNSense
- **import your current WireGuard server configuration (with a wizard!)**
diff --git a/build.rs b/build.rs
index 51800307d..1fda0abc2 100644
--- a/build.rs
+++ b/build.rs
@@ -5,19 +5,12 @@ fn main() -> Result<(), Box> {
config,
&[
"proto/core/auth.proto",
+ "proto/core/proxy.proto",
"proto/core/vpn.proto",
"proto/worker/worker.proto",
"proto/wireguard/gateway.proto",
- "proto/enrollment/enrollment.proto",
- "proto/password_reset/password_reset.proto",
- ],
- &[
- "proto/core",
- "proto/worker",
- "proto/wireguard",
- "proto/enrollment",
- "proto/password_reset",
],
+ &["proto/core", "proto/worker", "proto/wireguard"],
)?;
println!("cargo:rerun-if-changed=proto");
println!("cargo:rerun-if-changed=migrations");
diff --git a/docker-compose.e2e.yaml b/docker-compose.e2e.yaml
index 739cb5069..49129382d 100644
--- a/docker-compose.e2e.yaml
+++ b/docker-compose.e2e.yaml
@@ -20,11 +20,12 @@ services:
DEFGUARD_DB_PASSWORD: defguard
DEFGUARD_DB_NAME: defguard
DEFGUARD_URL: http://localhost:8000
+ DEFGUARD_PROXY_URL: http://proxy:50052
RUST_BACKTRACE: 1
ports:
- # rest api
+ # REST API
- "8000:8000"
- # grpc
+ # gRPC
- "50055:50055"
depends_on:
- db
@@ -56,6 +57,9 @@ services:
proxy:
image: ghcr.io/defguard/defguard-proxy:current
ports:
+ # REST API
- "8080:8080"
+ # gRPC
+ - "50052:50052"
environment:
- DEFGUARD_PROXY_UPSTREAM_GRPC_URL: "http://core:50055/"
+ DEFGUARD_PROXY_GRPC_PORT: 50052
diff --git a/docker-compose.ldap.yaml b/docker-compose.ldap.yaml
index e89682e39..d078bfb2c 100644
--- a/docker-compose.ldap.yaml
+++ b/docker-compose.ldap.yaml
@@ -38,7 +38,7 @@ services:
DEFGUARD_TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJEZWZHdWFyZCIsInN1YiI6IlRlc3ROZXQiLCJjbGllbnRfaWQiOiIiLCJleHAiOjU5NjE3NDcwNzYsIm5iZiI6MTY2Njc3OTc4MSwicm9sZXMiOltdfQ.uEUMnw_gO23W0K2q3N1lToeP0D2zAY1swr8N-84sRHA
RUST_LOG: debug
ports:
- # wireguard endpoint
+ # WireGuard endpoint
- "50051:50051/udp"
depends_on:
- core
diff --git a/docker-compose.yaml b/docker-compose.yaml
index 233a98ac3..80f18a65a 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -35,7 +35,7 @@ services:
DEFGUARD_TOKEN: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJEZWZHdWFyZCIsInN1YiI6IlRlc3ROZXQiLCJjbGllbnRfaWQiOiIiLCJleHAiOjU5NjE3NDcwNzYsIm5iZiI6MTY2Njc3OTc4MSwicm9sZXMiOltdfQ.uEUMnw_gO23W0K2q3N1lToeP0D2zAY1swr8N-84sRHA
RUST_LOG: debug
ports:
- # wireguard endpoint
+ # WireGuard endpoint
- "50051:50051/udp"
depends_on:
- core
diff --git a/e2e/README.md b/e2e/README.md
new file mode 100644
index 000000000..4b8df1932
--- /dev/null
+++ b/e2e/README.md
@@ -0,0 +1,26 @@
+# Defguard E2E tests powered by Playwright
+
+## Prerequisites
+
+- Docker
+- Docker compose
+- Node
+- pnpm
+
+## How to run
+Pull docker images:
+```bash
+docker-compose --file ../docker-compose.e2e.yaml pull
+```
+Install packages:
+```bash
+pnpm install
+```
+Install playwright chromium driver:
+```bash
+npx playwright install --with-deps chromium
+```
+Run tests:
+```bash
+pnpm test
+```
diff --git a/migrations/20231220103051_add_preshared_key.down.sql b/migrations/20231220103051_add_preshared_key.down.sql
new file mode 100644
index 000000000..8466e6f04
--- /dev/null
+++ b/migrations/20231220103051_add_preshared_key.down.sql
@@ -0,0 +1 @@
+ALTER TABLE device DROP COLUMN preshared_key;
diff --git a/migrations/20231220103051_add_preshared_key.up.sql b/migrations/20231220103051_add_preshared_key.up.sql
new file mode 100644
index 000000000..d12c2c1c2
--- /dev/null
+++ b/migrations/20231220103051_add_preshared_key.up.sql
@@ -0,0 +1 @@
+ALTER TABLE device ADD COLUMN preshared_key text NULL;
diff --git a/migrations/20231220112404_update_location_settings.down.sql b/migrations/20231220112404_update_location_settings.down.sql
new file mode 100644
index 000000000..899287ebd
--- /dev/null
+++ b/migrations/20231220112404_update_location_settings.down.sql
@@ -0,0 +1,3 @@
+ALTER TABLE wireguard_network DROP COLUMN mfa_enabled;
+ALTER TABLE wireguard_network DROP COLUMN keepalive_interval;
+ALTER TABLE wireguard_network DROP COLUMN peer_disconnect_threshold;
diff --git a/migrations/20231220112404_update_location_settings.up.sql b/migrations/20231220112404_update_location_settings.up.sql
new file mode 100644
index 000000000..a0210bfdb
--- /dev/null
+++ b/migrations/20231220112404_update_location_settings.up.sql
@@ -0,0 +1,3 @@
+ALTER TABLE wireguard_network ADD COLUMN mfa_enabled bool NOT NULL DEFAULT false;
+ALTER TABLE wireguard_network ADD COLUMN keepalive_interval int4 NOT NULL DEFAULT 25;
+ALTER TABLE wireguard_network ADD COLUMN peer_disconnect_threshold int4 NOT NULL DEFAULT 75;
diff --git a/migrations/20231222094917_support_gateway_disconnect.down.sql b/migrations/20231222094917_support_gateway_disconnect.down.sql
new file mode 100644
index 000000000..3381636e3
--- /dev/null
+++ b/migrations/20231222094917_support_gateway_disconnect.down.sql
@@ -0,0 +1 @@
+ALTER TABLE wireguard_network_device DROP COLUMN is_authorized;
diff --git a/migrations/20231222094917_support_gateway_disconnect.up.sql b/migrations/20231222094917_support_gateway_disconnect.up.sql
new file mode 100644
index 000000000..45c49cd96
--- /dev/null
+++ b/migrations/20231222094917_support_gateway_disconnect.up.sql
@@ -0,0 +1 @@
+ALTER TABLE wireguard_network_device ADD COLUMN is_authorized bool NOT NULL DEFAULT false;
diff --git a/migrations/20231227091628_fix_preshared_key.down.sql b/migrations/20231227091628_fix_preshared_key.down.sql
new file mode 100644
index 000000000..f3574d87d
--- /dev/null
+++ b/migrations/20231227091628_fix_preshared_key.down.sql
@@ -0,0 +1,4 @@
+ALTER TABLE device ADD COLUMN preshared_key text NULL;
+
+-- remove previous column
+ALTER TABLE wireguard_network_device DROP COLUMN preshared_key;
diff --git a/migrations/20231227091628_fix_preshared_key.up.sql b/migrations/20231227091628_fix_preshared_key.up.sql
new file mode 100644
index 000000000..41e5db5e0
--- /dev/null
+++ b/migrations/20231227091628_fix_preshared_key.up.sql
@@ -0,0 +1,4 @@
+ALTER TABLE wireguard_network_device ADD COLUMN preshared_key text NULL;
+
+-- remove previous column
+ALTER TABLE device DROP COLUMN preshared_key;
diff --git a/model-derive/src/lib.rs b/model-derive/src/lib.rs
index 238120dac..acff2d332 100644
--- a/model-derive/src/lib.rs
+++ b/model-derive/src/lib.rs
@@ -177,7 +177,7 @@ pub fn derive(input: TokenStream) -> TokenStream {
impl #name {
pub async fn find_by_id<'e, E>(executor: E, id: i64) -> Result