mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
Keep retired Slate helpers test-only
This commit is contained in:
parent
f3ff7f27a4
commit
dc1f235c48
5 changed files with 6 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ use fabro_server::jwt_auth::resolve_auth_mode_with_lookup;
|
|||
use fabro_server::server::{AppState, RouterOptions, build_router_with_options};
|
||||
use fabro_server::test_support::test_app_state_with_store_and_runtime_settings;
|
||||
use fabro_store::auth_session_store::{AuthSessionRecord, InitialRefreshToken};
|
||||
use fabro_store::{ArtifactStore, Database, PendingCliAuthorization};
|
||||
use fabro_store::{ArtifactStore, PendingCliAuthorization};
|
||||
use object_store::memory::InMemory;
|
||||
use sha2::{Digest, Sha256};
|
||||
use tower::ServiceExt;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ impl Record for Blob {
|
|||
|
||||
const PREFIX: &'static str = "blobs/sha256";
|
||||
|
||||
#[cfg(test)]
|
||||
fn id(&self) -> Self::Id {
|
||||
BlobHash::new(&self.0)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ pub(crate) trait Record: Sized + Send + Sync + 'static {
|
|||
|
||||
const PREFIX: &'static str;
|
||||
|
||||
#[cfg(test)]
|
||||
fn id(&self) -> Self::Id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ impl<R: Record> Repository<R> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) async fn get(&self, id: &R::Id) -> Result<Option<R>> {
|
||||
self.db
|
||||
.get(key_for_id::<R>(id)?)
|
||||
|
|
@ -101,6 +102,7 @@ impl<R: Record> Repository<R> {
|
|||
.transpose()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) async fn put(&self, record: &R) -> Result<()> {
|
||||
let id = record.id();
|
||||
self.put_at(&id, record).await
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ impl Record for RunCatalogEntry {
|
|||
|
||||
const PREFIX: &'static str = "runs/_index/by-start";
|
||||
|
||||
#[cfg(test)]
|
||||
fn id(&self) -> Self::Id {
|
||||
unreachable!("marker records must use put_at")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue