-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
462 additions
and
250 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
backend/migrations/20231124135844_create_connection_packages_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- SPDX-FileCopyrightText: 2023 Phoenix R&D GmbH <[email protected]> | ||
-- | ||
-- SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
-- migrations/{timestamp}_create_connection_packages_table.sql | ||
-- Create ConnectionPackages Table | ||
CREATE TABLE connection_packages( | ||
id uuid NOT NULL, | ||
PRIMARY KEY (id), | ||
client_id uuid NOT NULL, | ||
connection_package BYTEA NOT NULL, | ||
FOREIGN KEY (client_id) REFERENCES as_client_records(client_id) ON DELETE CASCADE | ||
); | ||
|
||
CREATE INDEX idx_connection_package_client_id ON connection_packages(client_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-FileCopyrightText: 2023 Phoenix R&D GmbH <[email protected]> | ||
// | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
use phnxtypes::messages::client_as::ConnectionPackage; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
mod persistence; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub(in crate::auth_service) enum StorableConnectionPackage { | ||
V1(ConnectionPackage), | ||
} | ||
|
||
impl From<StorableConnectionPackage> for ConnectionPackage { | ||
fn from(connection_package: StorableConnectionPackage) -> Self { | ||
match connection_package { | ||
StorableConnectionPackage::V1(connection_package) => connection_package, | ||
} | ||
} | ||
} | ||
|
||
impl From<ConnectionPackage> for StorableConnectionPackage { | ||
fn from(connection_package: ConnectionPackage) -> Self { | ||
StorableConnectionPackage::V1(connection_package) | ||
} | ||
} |
Oops, something went wrong.