Crate sherpack_repo

Crate sherpack_repo 

Source
Expand description

Sherpack Repository Management

This crate provides repository management for Sherpack, including:

  • HTTP repositories: Traditional Helm-style repos with index.yaml
  • OCI registries: Push/pull from Docker Hub, GHCR, ECR, etc.
  • Local file repositories: For development and testing

§Key Features

  • Unified interface: Same commands work for HTTP and OCI
  • Secure credentials: Scoped credentials with redirect protection
  • SQLite cache: Fast local search with FTS5
  • Lock files: Reproducible builds with integrity verification
  • Diamond detection: Catch version conflicts before they cause problems

§Example

use sherpack_repo::{RepositoryConfig, Repository, RepositoryBackend, create_backend};

// Add a repository
let repo = Repository::new("bitnami", "https://charts.bitnami.com/bitnami")?;

// Create backend (works for HTTP, OCI, or file repos)
let mut backend = create_backend(repo, None).await?;

// Search for packs
let results = backend.search("nginx").await?;

// Download a pack
let data = backend.download("nginx", "15.0.0").await?;

§Security Notes

  • Credentials are NEVER sent after cross-origin redirects
  • Lock files verify SHA256 integrity by default
  • Diamond dependencies cause errors, not silent conflicts

Re-exports§

pub use backend::RepositoryBackend;
pub use backend::create_backend;
pub use backend::create_backend_by_name;
pub use cache::CacheStats;
pub use cache::CachedPack;
pub use cache::IndexCache;
pub use config::Repository;
pub use config::RepositoryConfig;
pub use config::RepositoryType;
pub use credentials::CredentialStore;
pub use credentials::Credentials;
pub use credentials::ResolvedCredentials;
pub use credentials::ScopedCredentials;
pub use credentials::SecureHttpClient;
pub use dependency::DependencyGraph;
pub use dependency::DependencyResolver;
pub use dependency::DependencySpec;
pub use dependency::FilterResult;
pub use dependency::ResolvedDependency;
pub use dependency::SkipReason;
pub use dependency::SkippedDependency;
pub use dependency::filter_dependencies;
pub use error::RepoError;
pub use error::Result;
pub use http::HttpRepository;
pub use index::PackEntry;
pub use index::RepositoryIndex;
pub use lock::LockFile;
pub use lock::LockPolicy;
pub use lock::LockedDependency;
pub use lock::VerifyResult;
pub use oci::OciReference;
pub use oci::OciRegistry;

Modules§

backend
Unified repository backend trait
cache
SQLite-based cache with FTS5 for fast search
config
Repository configuration management
credentials
Secure credential management with redirect protection
dependency
Dependency resolution with diamond detection and conditional filtering
error
Error types for repository operations
http
HTTP repository implementation
index
Repository index types
lock
Lock file format for reproducible builds
oci
OCI Registry client