Skip to content

Commit

Permalink
feat: mostly reducing scope of public interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sstelfox committed Jul 2, 2024
1 parent 3ca27f1 commit 4a2f9a8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/api/platform/snapshots/get_all_request.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use async_trait::async_trait;
use serde::Serialize;

use crate::api::client::{ApiRequest, PlatformApiRequest};
use crate::api::platform::{ApiDriveId, ApiSnapshot};

#[derive(Serialize)]
pub(crate) struct GetAllRequest {
drive_id: ApiDriveId,
}
Expand Down
14 changes: 7 additions & 7 deletions src/codec/crypto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ mod verifying_key;

pub(crate) use encrypted_buffer::EncryptedBuffer;

pub use access_key::{AccessKey, AccessKeyError};
pub use asym_locked_access_key::{AsymLockedAccessKey, AsymLockedAccessKeyError};
pub use authentication_tag::AuthenticationTag;
pub(crate) use access_key::AccessKey;
pub(crate) use asym_locked_access_key::{AsymLockedAccessKey, AsymLockedAccessKeyError};
pub(crate) use authentication_tag::AuthenticationTag;
pub use fingerprint::Fingerprint;
pub use hash::Hash;
pub use key_id::KeyId;
pub use nonce::Nonce;
pub(crate) use hash::Hash;
pub(crate) use key_id::KeyId;
pub(crate) use nonce::Nonce;
pub use signature::Signature;
pub use signing_key::SigningKey;
pub use sym_locked_access_key::SymLockedAccessKey;
pub(crate) use sym_locked_access_key::SymLockedAccessKey;
pub use verifying_key::VerifyingKey;
4 changes: 3 additions & 1 deletion src/codec/header/identity_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use winnow::Parser;
use crate::codec::header::BANYAN_FS_MAGIC;
use crate::codec::{ParserResult, Stream};

const FORMAT_VERSION: u8 = 0x01;

#[derive(Debug, PartialEq)]
pub struct IdentityHeader;

Expand All @@ -14,7 +16,7 @@ impl IdentityHeader {
writer: &mut W,
) -> std::io::Result<usize> {
writer.write_all(BANYAN_FS_MAGIC).await?;
writer.write_all(&[0x01]).await?;
writer.write_all(&[FORMAT_VERSION]).await?;

Ok(BANYAN_FS_MAGIC.len() + 1)
}
Expand Down
12 changes: 7 additions & 5 deletions src/codec/header/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ mod public_settings;

pub use access_mask::{AccessMask, AccessMaskBuilder, AccessMaskError};
pub use content_options::ContentOptions;
pub use format_header::FormatHeader;
pub use identity_header::IdentityHeader;
pub use key_count::KeyCount;
pub(crate) use identity_header::IdentityHeader;
pub(crate) use key_count::KeyCount;
pub use public_settings::PublicSettings;

pub(super) const BANYAN_FS_MAGIC: &[u8] = b"BYFS";
pub const BANYAN_FS_MAGIC: &[u8] = b"BYFS";

pub(super) const BANYAN_DATA_MAGIC: &[u8] = b"BYFD";
pub const BANYAN_DATA_MAGIC: &[u8] = b"BYFD";

#[allow(dead_code)]
pub const BANYAN_JOURNAL_MAGIC: &[u8] = b"BYFJ";

0 comments on commit 4a2f9a8

Please sign in to comment.