Skip to content

Conversation

jepio
Copy link
Member

@jepio jepio commented Jul 31, 2024

This PR adds support for running ado-npm-auth on Linux natively (not in WSL). This has two parts:

  • support installing azureauth on Linux by unpacking the deb file that is published for every release
  • add support for device code flow, which is needed on headless Linux systems.

jepio added 4 commits July 29, 2024 13:09
Add support for `-h` or `--help` cli flag and print the supported options.

Signed-off-by: Jeremi Piotrowski <[email protected]>
azureauth publishes linux deb files since v0.8.2. Add linux/x64 and linux/arm64
to the supported configuration list so that ado-npm-auth can be used there.
Scripts/install.js relies on dpkg-deb to unpack the deb file, which is fine
since the binaries are built for/on Ubuntu where dpkg-deb is guaranteed to be
available. The linux binaries might run on other distros.
When running headless on linux we can't rely on web flow for authentication.
Add a cli argument that forces azureauth into devicecode flow to support that
scenario. Move from running azureauth with `exec` to `spawn` to make this work.

We need to use spawn so that stderr can be inherited from the calling process.
The device code is displayed to the user on stderr.

Signed-off-by: Jeremi Piotrowski <[email protected]>
deviceCode: boolean;
}

export function printHelp() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on a change #31 to add a config file support.
I'm planning to leverage yargs to do the argument parsing.
Just sharing we'll likely hit a merge conflict. If you happen to be the one you'll know what PR to look at :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the heads up, i have no problem with rebasing and reworking this to rely on yargs.

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