From 022900be5a125feee92880d7334c9c21422df149 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 8 Nov 2022 11:48:24 +0100 Subject: [PATCH] fixed #456 - postgres field type mismatch --- .gitignore | 2 ++ warpgate-db-entities/src/KnownHost.rs | 2 +- warpgate-db-entities/src/Ticket.rs | 2 +- warpgate-db-migrations/src/m00001_create_ticket.rs | 2 +- warpgate-db-migrations/src/m00004_create_known_host.rs | 2 +- warpgate-protocol-ssh/src/known_hosts.rs | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 829960b..98c0dab 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,9 @@ host_key* # --- data +data-* config.*.yaml config.yaml __pycache__ .pytest_cache +dhat-heap.json diff --git a/warpgate-db-entities/src/KnownHost.rs b/warpgate-db-entities/src/KnownHost.rs index 1a57376..3ebbbfa 100644 --- a/warpgate-db-entities/src/KnownHost.rs +++ b/warpgate-db-entities/src/KnownHost.rs @@ -10,7 +10,7 @@ pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub host: String, - pub port: u16, + pub port: i32, pub key_type: String, pub key_base64: String, } diff --git a/warpgate-db-entities/src/Ticket.rs b/warpgate-db-entities/src/Ticket.rs index da4d482..64eb1e0 100644 --- a/warpgate-db-entities/src/Ticket.rs +++ b/warpgate-db-entities/src/Ticket.rs @@ -14,7 +14,7 @@ pub struct Model { pub secret: String, pub username: String, pub target: String, - pub uses_left: Option, + pub uses_left: Option, pub expiry: Option>, pub created: DateTime, } diff --git a/warpgate-db-migrations/src/m00001_create_ticket.rs b/warpgate-db-migrations/src/m00001_create_ticket.rs index 2beac1a..c085a79 100644 --- a/warpgate-db-migrations/src/m00001_create_ticket.rs +++ b/warpgate-db-migrations/src/m00001_create_ticket.rs @@ -13,7 +13,7 @@ pub mod ticket { pub secret: String, pub username: String, pub target: String, - pub uses_left: Option, + pub uses_left: Option, pub expiry: Option, pub created: DateTimeUtc, } diff --git a/warpgate-db-migrations/src/m00004_create_known_host.rs b/warpgate-db-migrations/src/m00004_create_known_host.rs index 0eccb76..36672d6 100644 --- a/warpgate-db-migrations/src/m00004_create_known_host.rs +++ b/warpgate-db-migrations/src/m00004_create_known_host.rs @@ -11,7 +11,7 @@ pub mod known_host { #[sea_orm(primary_key, auto_increment = false)] pub id: Uuid, pub host: String, - pub port: u16, + pub port: i32, pub key_type: String, pub key_base64: String, } diff --git a/warpgate-protocol-ssh/src/known_hosts.rs b/warpgate-protocol-ssh/src/known_hosts.rs index 129143a..24bfe8f 100644 --- a/warpgate-protocol-ssh/src/known_hosts.rs +++ b/warpgate-protocol-ssh/src/known_hosts.rs @@ -63,7 +63,7 @@ impl KnownHosts { let values = KnownHost::ActiveModel { id: Set(Uuid::new_v4()), host: Set(host.to_owned()), - port: Set(port), + port: Set(port.into()), key_type: Set(key.name().to_owned()), key_base64: Set(key.public_key_base64()), };