1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-07 22:35:25 +00:00
Commit graph

7 commits

Author SHA1 Message Date
Jason Hall
5d730a36da implement auth
Signed-off-by: Jason Hall <jason@chainguard.dev>
2025-10-15 08:51:46 -04:00
Jason Hall
9dc786c3f1
feat: replace vendor/oci-distribution with direct OCI Distribution Spec implementation
Replace the vendor/oci-distribution dependency with a custom implementation
that directly follows the OCI Distribution Specification using hyper for HTTP.

Key improvements:
- Direct HTTP implementation using hyper, hyper-util, and hyper-tls
- Support for Bearer token, Basic auth, and Anonymous authentication
- Cross-registry blob copying for layered images
- Multi-platform manifest list support
- Better error handling and redirect support
- Reduced dependency footprint

Technical changes:
- Remove vendor/oci-distribution dependency
- Add hyper ecosystem dependencies for HTTP client
- Implement OCI types: OciDescriptor, OciImageManifest, OciImageIndex
- Add ImageReference parsing with registry/repository/tag/digest support
- Implement registry authentication flows (Bearer token requests)
- Add blob upload/download with redirect handling
- Support manifest pulling with image index resolution
- Fix manifest size validation for Docker compatibility
- Update integration tests to use new registry auth types
- Handle docker.io redirect to registry-1.docker.io correctly

This enables more flexible authentication handling and reduces external
dependencies while maintaining full OCI compliance.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 22:25:10 -04:00
Jason Hall
739a80fe1e
fix: Apply rustfmt formatting
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 11:56:22 -04:00
Jason Hall
618525b7ed
fix: Clear all Docker config paths in tests to fix CI
- Clear HOME env var to avoid ~/.docker/config.json
- Clear XDG_RUNTIME_DIR to avoid containers/auth.json
- Add debug output for failed auth resolution
- Tests should now pass in CI environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 11:02:06 -04:00
Jason Hall
332f47b73b
fix: Fix test environment variable pollution and formatting
- Clear REGISTRY_AUTH_FILE in all credential helper tests to avoid conflicts
- Apply rustfmt formatting
- Tests pass reliably when run sequentially (cargo test -- --test-threads=1)
- Note: Tests may fail when run in parallel due to env var mutations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 10:53:29 -04:00
Jason Hall
672ada3dd2
feat: Add RegistryAuth::from_default() convenience methods
- Add from_default() and from_default_str() methods to RegistryAuth
- These methods automatically resolve auth from Docker config and credential helpers
- Update example to demonstrate both explicit and auto auth approaches
- Simplify krust's auth wrapper to use the new convenience method
- Fix test environment variable pollution

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 10:49:28 -04:00
Jason Hall
a6ae83c3b2
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
2025-06-08 10:30:41 -04:00