Skip to main content

Crate inferadb_ledger_types

Crate inferadb_ledger_types 

Source
Expand description

Core types, errors, and cryptographic primitives for InferaDB Ledger.

Provides the foundational types used throughout the ledger:

  • Newtype identifiers for organizations, vaults, users, teams, apps, invitations, and signing keys (both internal i64 IDs and external Snowflake u64 slugs), plus geographic region enum (Region)
  • Data structures for blocks, transactions, and operations
  • Configuration types with validated builders
  • Cryptographic hashing functions (SHA-256, seahash)
  • Merkle tree implementation
  • Error types using snafu

Re-exports§

pub use codec::CodecError;
pub use codec::decode;
pub use codec::encode;
pub use email_hash::EmailBlindingKey;
pub use email_hash::EmailBlindingKeyParseError;
pub use email_hash::bytes_to_hex;
pub use email_hash::compute_email_hmac;
pub use email_hash::normalize_email;
pub use error::DiagnosticCode;
pub use error::LedgerError;
pub use error::Result;
pub use hash::BucketHasher;
pub use hash::EMPTY_HASH;
pub use hash::Hash;
pub use hash::ZERO_HASH;
pub use hash::bucket_id;
pub use hash::compute_chain_commitment;
pub use hash::compute_tx_merkle_root;
pub use hash::hash_eq;
pub use hash::sha256;
pub use hash::sha256_concat;
pub use hash::tx_hash;
pub use hash::vault_entry_hash;
pub use invitation::InvitationStatus;
pub use invitation::InviteEmailEntry;
pub use invitation::InviteIndexEntry;
pub use invitation::OrganizationInvitation;
pub use invitation::effective_invitation_status;
pub use token::SESSION_AUDIENCE;
pub use token::SIGNING_KEY_ENVELOPE_SIZE;
pub use token::SigningKeyEnvelope;
pub use token::TokenError;
pub use token::TokenSubject;
pub use token::TokenType;
pub use token::UserSessionClaims;
pub use token::VAULT_AUDIENCE;
pub use token::ValidatedToken;
pub use token::VaultTokenClaims;
pub use types::ALL_REGIONS;
pub use types::AppCredentialType;
pub use types::AppId;
pub use types::AppSlug;
pub use types::BlockHeader;
pub use types::BlockRetentionMode;
pub use types::BlockRetentionPolicy;
pub use types::ChainCommitment;
pub use types::ClientAssertionId;
pub use types::ClientId;
pub use types::CredentialData;
pub use types::CredentialType;
pub use types::EmailVerifyTokenId;
pub use types::Entity;
pub use types::InviteId;
pub use types::InviteSlug;
pub use types::LedgerNodeId;
pub use types::NodeId;
pub use types::Operation;
pub use types::OrganizationId;
pub use types::OrganizationMemberRole;
pub use types::OrganizationSlug;
pub use types::OrganizationUsage;
pub use types::PasskeyCredential;
pub use types::PendingTotpChallenge;
pub use types::PrimaryAuthMethod;
pub use types::RecoveryCodeCredential;
pub use types::RefreshTokenId;
pub use types::Region;
pub use types::RegionBlock;
pub use types::RegionParseError;
pub use types::Relationship;
pub use types::SetCondition;
pub use types::SigningKeyId;
pub use types::SigningKeyScope;
pub use types::SigningKeyStatus;
pub use types::TeamId;
pub use types::TeamSlug;
pub use types::TokenVersion;
pub use types::TotpAlgorithm;
pub use types::TotpCredential;
pub use types::Transaction;
pub use types::TransactionValidationError;
pub use types::TxId;
pub use types::UserCredential;
pub use types::UserCredentialId;
pub use types::UserEmailId;
pub use types::UserId;
pub use types::UserRole;
pub use types::UserSlug;
pub use types::UserStatus;
pub use types::VaultBlock;
pub use types::VaultEntry;
pub use types::VaultHealth;
pub use types::VaultId;
pub use types::VaultSlug;
pub use types::WriteResult;
pub use types::WriteStatus;

Modules§

codec
Serialization and deserialization via postcard. Centralized serialization and deserialization functions.
config
Configuration types with validated builders. Configuration types for InferaDB Ledger.
email_hash
Email blinding key and HMAC-based email hashing for global uniqueness. Email blinding key and HMAC-based email hashing for global uniqueness.
error
Error types using snafu with structured error codes. Error types for InferaDB Ledger using snafu.
events
Event logging domain types for organization-scoped audit trails. Event logging domain types for organization-scoped audit trails.
hash
Cryptographic hashing (SHA-256, seahash) and block/transaction hashing. Cryptographic hashing functions for InferaDB Ledger.
invitation
Organization invitation types: status, records, and index entries. Organization invitation types.
merkle
Merkle tree construction and verification. Merkle tree implementation for InferaDB Ledger.
onboarding
Constants for user onboarding (email verification + account creation). Constants for the user onboarding flow (email verification + account creation).
snowflake
Snowflake-style globally unique ID generation. Snowflake-style globally unique ID generation.
token
JWT token types for user sessions and vault access. JWT token types for user sessions and vault access.
types
Core domain types: identifiers, blocks, transactions, operations. Core type definitions for InferaDB Ledger.
validation
Input validation for gRPC request fields. Input validation for gRPC request fields.

Enums§

ErrorCode
Error code returned by the Raft state machine in LedgerResponse::Error.