Add a system-level plugin-auth.js#468
Open
reynoldsalec wants to merge 4 commits into
Open
Conversation
Lando now reads and merges a system-level plugin-auth.json in addition to the user-level ~/.lando/plugin-auth.json. The system file acts as a base that user config overrides, enabling IT/MDM-managed machines to deploy registry credentials once for all users. System paths: /Library/Application Support/Lando/ (macOS), /srv/lando/ (Linux), %PROGRAMDATA%\Lando\ (Windows).
Wrap system file read in try/catch so a permission-denied error doesn't crash Lando at startup. Also note in plugin-logout docs that the command only clears user-level credentials, not system-level ones.
Verifies that a private plugin can be installed using only credentials in /srv/lando/plugin-auth.json (no user-level ~/.lando/plugin-auth.json), exercising the new system-level auth merge. Test runs before plugin-login so there is no user-level file present to mask a failure.
❌ Deploy Preview for lando-core failed. Why did it fail? →
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: this includes/supersedes #467
Lando currently only reads plugin registry credentials from
~/.lando/plugin-auth.json, which requires every user on a machine to set up their own auth. This makes it awkward for IT/MDM-managed environmentswhere credentials should be deployed once for all users.
This PR adds a system-level
plugin-auth.jsonthat Lando merges as a base before the user-level file. System paths are/Library/Application Support/Lando/plugin-auth.jsonon macOS,/srv/lando/plugin-auth.jsonon Linux, and%PROGRAMDATA%\Lando\plugin-auth.jsonon Windows.User-level credentials always win over system-level ones.
lando plugin-loginandlando plugin-logoutcontinue to operate on the user-level file only — the docs now call this out explicitly.Robustness: if the system file exists but isn't readable (e.g. wrong permissions), Lando skips it silently rather than crashing at startup.
Docs: the new hosting-and-distributing-a-private-plugin guide gains an "Option D" with platform-specific snippets for deploying system-level credentials via MDM or configuration management.