sherpack_repo/lib.rs
1//! Sherpack Repository Management
2//!
3//! This crate provides repository management for Sherpack, including:
4//!
5//! - **HTTP repositories**: Traditional Helm-style repos with index.yaml
6//! - **OCI registries**: Push/pull from Docker Hub, GHCR, ECR, etc.
7//! - **Local file repositories**: For development and testing
8//!
9//! ## Key Features
10//!
11//! - **Unified interface**: Same commands work for HTTP and OCI
12//! - **Secure credentials**: Scoped credentials with redirect protection
13//! - **SQLite cache**: Fast local search with FTS5
14//! - **Lock files**: Reproducible builds with integrity verification
15//! - **Diamond detection**: Catch version conflicts before they cause problems
16//!
17//! ## Example
18//!
19//! ```rust,no_run
20//! use sherpack_repo::{RepositoryConfig, Repository, RepositoryBackend, create_backend};
21//!
22//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
23//! // Add a repository
24//! let repo = Repository::new("bitnami", "https://charts.bitnami.com/bitnami")?;
25//!
26//! // Create backend (works for HTTP, OCI, or file repos)
27//! let mut backend = create_backend(repo, None).await?;
28//!
29//! // Search for packs
30//! let results = backend.search("nginx").await?;
31//!
32//! // Download a pack
33//! let data = backend.download("nginx", "15.0.0").await?;
34//! # Ok(())
35//! # }
36//! ```
37//!
38//! ## Security Notes
39//!
40//! - Credentials are NEVER sent after cross-origin redirects
41//! - Lock files verify SHA256 integrity by default
42//! - Diamond dependencies cause errors, not silent conflicts
43
44pub mod backend;
45pub mod cache;
46pub mod config;
47pub mod credentials;
48pub mod dependency;
49pub mod error;
50pub mod http;
51pub mod index;
52pub mod lock;
53pub mod oci;
54
55// Re-exports for convenience
56pub use backend::{RepositoryBackend, create_backend, create_backend_by_name};
57pub use cache::{CacheStats, CachedPack, IndexCache};
58pub use config::{Repository, RepositoryConfig, RepositoryType};
59pub use credentials::{
60 CredentialStore, Credentials, ResolvedCredentials, ScopedCredentials, SecureHttpClient,
61};
62pub use dependency::{
63 DependencyGraph, DependencyResolver, DependencySpec, FilterResult, ResolvedDependency,
64 SkipReason, SkippedDependency, filter_dependencies,
65};
66pub use error::{RepoError, Result};
67pub use http::HttpRepository;
68pub use index::{PackEntry, RepositoryIndex};
69pub use lock::{LockFile, LockPolicy, LockedDependency, VerifyResult};
70pub use oci::{OciReference, OciRegistry};