-
-
Notifications
You must be signed in to change notification settings - Fork 125
Add Atmos auth integration to Geodesic #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Mount Atmos-specific directories (.cache/atmos, .local/share/atmos) for auth support - Configure Atmos XDG environment variables for proper credential/cache storage - Add use-identity helper function for seamless Atmos auth workflow This enables users to authenticate via Atmos using `use-identity` command, with support for both interactive identity selection (no args) and direct identity specification (with identity name). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Updates use-identity function to pass identity using --identity=value format instead of --identity value for consistency with atmos CLI conventions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
📝 WalkthroughWalkthroughAdds the atmos package, sets XDG environment defaults and a use-identity() auth helper in the shell profile, and mounts Atmos cache/data host directories into containers when present. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds Atmos to the default package list to enable Atmos auth functionality out of the box. Pins to version 1.197.0 for stability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
rootfs/templates/wrapper-body.sh (1)
534-541: Consider adding Atmos mounts to tracking variable for consistency.Unlike
HOMEDIR_MOUNTS(which updatesGEODESIC_HOMEDIR_MOUNTSfor container visibility), the Atmos mounts do not update any tracking variable. If container-side code or logging needs to know which Atmos directories are mounted, consider updating a tracking variable here.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
packages.txt(1 hunks)rootfs/etc/profile.d/atmos.sh(1 hunks)rootfs/templates/wrapper-body.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-12-31T04:41:45.788Z
Learnt from: Nuru
Repo: cloudposse/geodesic PR: 961
File: rootfs/templates/wrapper-body.sh:1-1
Timestamp: 2024-12-31T04:41:45.788Z
Learning: The file `rootfs/templates/wrapper-body.sh` is a partial template fragment that merges with a shebang from an earlier template, so no separate shebang is required here. Also, `homedir_default_mounts` must remain a string in order to be properly exported to a subshell.
Applied to files:
rootfs/templates/wrapper-body.sh
📚 Learning: 2025-01-20T04:29:55.469Z
Learnt from: Nuru
Repo: cloudposse/geodesic PR: 961
File: rootfs/templates/wrapper-body.sh:312-312
Timestamp: 2025-01-20T04:29:55.469Z
Learning: The Geodesic wrapper script is split into two parts: a header template (`wrapper-header.sh.tmpl`) that defines variables and a body (`wrapper-body.sh`) that contains the main logic. These files are concatenated during the build process to create the final wrapper script.
Applied to files:
rootfs/templates/wrapper-body.sh
🧬 Code graph analysis (1)
rootfs/etc/profile.d/atmos.sh (1)
rootfs/etc/profile.d/aws.sh (1)
export_current_aws_role(112-249)
🔇 Additional comments (4)
rootfs/templates/wrapper-body.sh (1)
534-541: Mount implementation follows established patterns correctly.The Atmos directory mounts are conditionally applied, follow the same structure as
HOMEDIR_MOUNTS, and include proper debug logging. The inline comment justifying why these small directories are mounted is helpful.rootfs/etc/profile.d/atmos.sh (3)
3-7: XDG path exports are correct and align with mounted directories.The parameter expansion patterns are correct, defaults follow XDG Base Directory spec, and the paths correspond to the mounted Atmos directories from
wrapper-body.sh. This enables Atmos to locate cached credentials and config within the container's home.
9-42:use-identityfunction is well-structured with good error handling.The function correctly splits into two modes (no-args for selector, with-args for direct identity), properly checks for the atmos command, and captures/validates command output before processing. The optional AWS role refresh integration improves UX by updating the prompt after credential changes.
36-36: Theevalusage here is acceptable given atmos is a trusted tool.Line 36 evaluates output from
atmos auth env, which is designed to produce shell variable exports. Sinceatmosis a controlled Cloud Posse tool and the output has already been validated by the command's exit status check (lines 23, 29), the security risk is low. The stderr is captured (lines 23, 29 use2>&1), so any errors prevent eval from executing.Please confirm in your test plan that
use-identityinteractions (both no-args and with-args) have been validated as part of the PR test items.
Summary
This PR integrates Atmos authentication support into Geodesic by:
.cache/atmosand.local/share/atmos) when they exist on the hostuse-identityhelper function for seamless Atmos auth workflowChanges
1. Wrapper Script (wrapper-body.sh)
.cache/atmosand.local/share/atmosdirectories2. Atmos Configuration (atmos.sh)
ATMOS_XDG_CONFIG_HOME,ATMOS_XDG_DATA_HOME, andATMOS_XDG_CACHE_HOMEenvironment variables3. New
use-identityFunctionuse-identity [identity-name]use-identityalone brings up the interactive identity selectoruse-identity my-identitydirectly authenticates with that identity using--identity=my-identitysyntaxexport_current_aws_role)Test Plan
use-identitywith no arguments (should show selector)use-identity my-identity(should authenticate directly)assume-roleworkflows still work