forked from shuttle-hq/shuttle
-
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.
fix: revert addition of apikey to auth (shuttle-hq#886)
* fix: revert addition of apikey to auth * fix: display impl is needed for key.to_string()
- Loading branch information
1 parent
ab12fdd
commit f5f407b
Showing
10 changed files
with
133 additions
and
37 deletions.
There are no files selected for viewing
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
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,12 @@ | ||
[package] | ||
name = "sqlite" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
async-trait = "0.1.68" | ||
serde = "1.0.163" | ||
shuttle-service = "0.16.0" | ||
shuttle-common = { version = "0.16.0", path = "../../common" } |
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,49 @@ | ||
use async_trait::async_trait; | ||
use serde::{Deserialize, Serialize}; | ||
use shuttle_service::{database, Factory, ResourceBuilder, Type}; | ||
|
||
// Builder struct | ||
#[derive(Serialize)] | ||
pub struct SQLite {} | ||
|
||
// Resource struct | ||
#[derive(Deserialize, Serialize, Clone)] | ||
pub struct SQLiteInstance {} | ||
|
||
#[async_trait] | ||
impl ResourceBuilder<SQLiteInstance> for SQLite { | ||
const TYPE: Type = Type::Database(database::Type::Local); | ||
|
||
type Config = Self; | ||
|
||
type Output = SQLiteInstance; | ||
|
||
fn new() -> Self { | ||
Self {} | ||
} | ||
|
||
fn config(&self) -> &Self::Config { | ||
&self | ||
} | ||
|
||
async fn output( | ||
self, | ||
factory: &mut dyn Factory, | ||
) -> Result<Self::Output, shuttle_service::Error> { | ||
Ok(SQLiteInstance {}) | ||
} | ||
|
||
async fn build(build_data: &Self::Output) -> Result<SQLiteInstance, shuttle_service::Error> { | ||
Ok(build_data.clone()) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
// | ||
} | ||
} |