Skip to content

Feat/registries auth mecanism#368

Closed
Leay15 wants to merge 28 commits intosuperradcompany:toks/fix-image-pullingfrom
AurIAL-Rocks:feat/registries-auth-mecanism
Closed

Feat/registries auth mecanism#368
Leay15 wants to merge 28 commits intosuperradcompany:toks/fix-image-pullingfrom
AurIAL-Rocks:feat/registries-auth-mecanism

Conversation

@Leay15
Copy link
Copy Markdown

@Leay15 Leay15 commented Feb 9, 2026

This pull request rebases on #351, it introduces robust registry authentication support for image pulling and pushing in the microsandbox CLI and core library.
It adds:

  • environment variable and persistent credential management
  • new CLI commands for login/logout
  • a unified resolution logic for registry authentication.

These improvements make private registry access easier, safer, and more consistent for users and developers.

Registry authentication and credential management

  • Added new CLI commands: msb login and msb logout for storing and removing registry credentials locally, with detailed documentation and security notes in docs/references/cli.md.
  • Introduced environment variable support for registry credentials (MSB_REGISTRY_TOKEN, MSB_REGISTRY_USERNAME, MSB_REGISTRY_PASSWORD, etc.), which take priority over stored credentials. [1] [2]
  • Credentials are now stored in ~/.microsandbox/registry_auth.json with guidance to restrict file permissions.

Core authentication resolution logic

  • Implemented resolve_registry_auth, normalize_registry_host, and registry_host_for_reference functions in microsandbox-core/lib/oci/auth.rs, providing unified logic for resolving registry authentication based on environment, stored credentials, and fallback to anonymous access.
  • Added comprehensive unit tests for authentication resolution, including precedence and error handling. [1] [2]

Integration into image pull/push workflow

  • Updated Registry::new and image pull logic to accept and use resolved registry authentication, ensuring all image operations use correct credentials. [1] [2] [3] [4] [5]
  • Exposed registry auth resolution via compatibility re-exports for management code. [1] [2] [3] [4]

CLI argument and option enhancements

  • Extended MicrosandboxSubcommand enum to support login and logout commands with registry, username, password, token, and --all options.

Utility and dependency updates

  • Added new dependencies (serde, serde_json, base64) for credential serialization and management in microsandbox-utils.

These changes collectively enable secure, flexible, and user-friendly registry authentication for microsandbox image workflows.

Leay15 added 28 commits February 9, 2026 15:03
@Leay15
Copy link
Copy Markdown
Author

Leay15 commented Feb 9, 2026

This PR was open by request on #364

@toksdotdev toksdotdev deleted the branch superradcompany:toks/fix-image-pulling February 9, 2026 23:42
@toksdotdev toksdotdev closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants