Skip to content
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

Use authentication when running a package #4300

Merged

Conversation

Michael-F-Bryan
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan commented Nov 8, 2023

As part of private packages and #4247, we want to make sure API tokens are sent to the backend when doing wasmer run some/private-package.

We'd like the CLI to automatically figure out which token to use while not sending API tokens to random endpoints, so updated WapmSource (the component that queries the Wasmer registry when looking up packages) to accept an API token for its registry and modified BuiltinPackageLoader (the component for downloading those packages) so it has a hashmap of hostnames to API tokens that it will consult when downloading a *.webc file.

@Michael-F-Bryan Michael-F-Bryan force-pushed the michael/run-2-use-authentication-when-running-a-package branch from bca53d2 to cbef0c4 Compare November 8, 2023 09:26
Copy link
Contributor

@theduke theduke left a comment

Choose a reason for hiding this comment

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

A dyn Trait should be a last resort, IMO.

It makes code more obtuse an harder to debug.

In this case, all it does it provide a token... why not just pass in the auth token as a setting?

Copy link
Contributor

@theduke theduke left a comment

Choose a reason for hiding this comment

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

LGTM now.

@Michael-F-Bryan Michael-F-Bryan force-pushed the michael/run-2-use-authentication-when-running-a-package branch from e279970 to a63e75c Compare November 14, 2023 17:14
@Michael-F-Bryan Michael-F-Bryan force-pushed the michael/run-2-use-authentication-when-running-a-package branch 2 times, most recently from a63e75c to 2fec91a Compare November 21, 2023 10:08
@Michael-F-Bryan Michael-F-Bryan merged commit 5afcc59 into master Nov 21, 2023
51 of 53 checks passed
@Michael-F-Bryan Michael-F-Bryan deleted the michael/run-2-use-authentication-when-running-a-package branch November 21, 2023 10:40
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