mirror of
https://github.com/imjasonh/krust
synced 2026-07-13 08:57:22 +00:00
feat: Add credential helper support to oci-distribution
- Move Docker config parsing and credential helper execution from krust - Add automatic auth resolution methods (*_auto) to the client - Support standard Docker config locations and environment variables - Add comprehensive tests and examples - Simplify krust to use the new credential helper functionality
This commit is contained in:
parent
4af701e617
commit
a6ae83c3b2
12 changed files with 887 additions and 15 deletions
|
|
@ -9,8 +9,10 @@ use serde::{Deserialize, Serialize};
|
|||
use std::collections::HashMap;
|
||||
|
||||
mod keychain;
|
||||
mod simple;
|
||||
|
||||
pub use keychain::{DefaultKeychain, Keychain};
|
||||
pub use simple::resolve_auth;
|
||||
|
||||
/// Authentication configuration containing credentials
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
|
|
|
|||
11
src/auth/simple.rs
Normal file
11
src/auth/simple.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//! Simple authentication wrapper using oci-distribution's credential helper
|
||||
|
||||
use anyhow::Result;
|
||||
use oci_distribution::credential_helper::resolve_docker_auth;
|
||||
use oci_distribution::secrets::RegistryAuth;
|
||||
|
||||
/// Resolve authentication for a given resource using Docker config and credential helpers
|
||||
pub fn resolve_auth(resource: &str) -> Result<RegistryAuth> {
|
||||
resolve_docker_auth(resource)
|
||||
.map_err(|e| anyhow::anyhow!("Failed to resolve auth: {}", e))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue