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

add authentication subcommand #120

Merged
merged 3 commits into from
Jun 23, 2023
Merged

add authentication subcommand #120

merged 3 commits into from
Jun 23, 2023

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented Jun 20, 2023

So far this is just a simple subcommand to store login information

@ruben-arts
Copy link
Contributor

Not sure how to test this. I tried a private channel on prefix.dev but that does not seems to work, either because of prefix.dev or pixi. Error I get:

ERROR rattler_repodata_gateway::fetch: error=HTTP status client error (403 Forbidden) for url (https://repo.prefix.dev/ruben-arts/noarch/repodata.json)
ERROR rattler_repodata_gateway::fetch: error=HTTP status client error (403 Forbidden) for url (https://repo.prefix.dev/ruben-arts/linux-64/repodata.json)
error: failed to fetch repodata from channels

Caused by:
    HTTP status client error (403 Forbidden) for url (https://repo.prefix.dev/ruben-arts/noarch/repodata.json)

Those repodata jsons are indeed not available for me, even in the browser.

I added @wolfv @baszalmstra @tdejager to the channel so you should be able to test it.

@wolfv
Copy link
Member Author

wolfv commented Jun 21, 2023

Did you use https://repo.prefix.dev for the host?

E.g. pixi auth login https://repo.prefix.dev --token $API_KEY

@ruben-arts
Copy link
Contributor

The issue was that I was adding the https:// in front of the host parameter. Also found a confusing error when i specify a platform that is not in the channel i specify on prefix.dev:

ERROR rattler_repodata_gateway::fetch: error=HTTP status client error (404 Not Found) for url (https://e1a7cde76f1780ec06bac859036dbaf7.r2.cloudflarestorage.com/prefix-production-package-store/ruben-arts/osx-64/repodata.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=95b7c2b4d2b3edfd85ab35305a823505%2F20230621%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20230621T143505Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=54ab504f40068c8b2ab8aa4e3165326b36a8624f325dc09ec657319b52d9c051)
ERROR rattler_repodata_gateway::fetch: error=HTTP status client error (404 Not Found) for url (https://e1a7cde76f1780ec06bac859036dbaf7.r2.cloudflarestorage.com/prefix-production-package-store/ruben-arts/osx-arm64/repodata.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=95b7c2b4d2b3edfd85ab35305a823505%2F20230621%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20230621T143505Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=316ba6792da9aecdaf6e0630ed7b53e6791d919c5c7e8f465debc864a15cc888)
ERROR rattler_repodata_gateway::fetch: error=HTTP status client error (404 Not Found) for url (https://e1a7cde76f1780ec06bac859036dbaf7.r2.cloudflarestorage.com/prefix-production-package-store/ruben-arts/win-64/repodata.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=95b7c2b4d2b3edfd85ab35305a823505%2F20230621%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20230621T143505Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=0496735526a3356155fd22d5c46147822314f7d2d76fa60c61115f3ea6eff46d)
error: failed to fetch repodata from channels

Caused by:
    HTTP status client error (404 Not Found) for url (https://e1a7cde76f1780ec06bac859036dbaf7.r2.cloudflarestorage.com/prefix-production-package-store/ruben-arts/osx-64/repodata.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=95b7c2b4d2b3edfd85ab35305a823505%2F20230621%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20230621T143505Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=54ab504f40068c8b2ab8aa4e3165326b36a8624f325dc09ec657319b52d9c051)

src/cli/auth.rs Outdated Show resolved Hide resolved
src/cli/auth.rs Outdated Show resolved Hide resolved
src/cli/auth.rs Outdated Show resolved Hide resolved
@ruben-arts
Copy link
Contributor

I'm okay with merging this but I see some low-hanging fruit to improve the UX some more:

  • pixi auth login should check if the login actually works by pinging the host or something.
  • pixi auth login x2 should tell its overwriting existing credentials
  • pixi auth logout bla should tell me if it doesn't do anything as I might have a typo in which case it didn't do anything.
  • pixi auth check would be very nice to have to check if you can still access all your hosts.

@wolfv
Copy link
Member Author

wolfv commented Jun 22, 2023

Maybe let's merge and iterate? I think we should also fix what we store (eg. host or host + subdomain) but that might be better to fix in rattler vs. here).

@ruben-arts ruben-arts merged commit 7f1a928 into prefix-dev:main Jun 23, 2023
9 checks passed
@wolfv wolfv mentioned this pull request Jun 23, 2023
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.

None yet

2 participants