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

Prompted passwords are not properly persisted into sessions #1098

Closed
blyxxyz opened this issue Jun 28, 2021 · 1 comment
Closed

Prompted passwords are not properly persisted into sessions #1098

blyxxyz opened this issue Jun 28, 2021 · 1 comment
Labels
enhancement New feature or enhancement needs product design We like the idea, but we want to explore the problem deeper, and consider the solution holistically
Milestone

Comments

@blyxxyz
Copy link
Contributor

blyxxyz commented Jun 28, 2021

What are the steps to reproduce the problem?

  1. While using a session, supply only a username to --auth so the password is prompted. e.g. http --offline --session ./sess.json --auth user :
  2. Send a new request using the session without explicit authentication, e.g. http --offline --session ./sess.json :

What is the expected result?

One of the following:

  • The password I entered last time is sent
  • I have to enter my password again

(Which of these would be desirable? We're implementing sessions in ducaale/xh#125 and would like to stay compatible)

What happens instead?

In the new request, the password is sent as None.

Example

$ http --offline --session ./sess.json --auth user :
http: password for user@localhost: pass
GET / HTTP/1.1
[...]
Authorization: Basic dXNlcjpwYXNz
[...]

$ echo dXNlcjpwYXNz | base64 -d
user:pass

$ http --offline --session ./sess.json :
GET / HTTP/1.1
[...]
Authorization: Basic dXNlcjpOb25l
[...]

$ echo dXNlcjpOb25l | base64 -d
user:None

$ cat sess.json
[...]
    "auth": {
        "raw_auth": "user",
        "type": "basic"
    },
[...]
@blyxxyz blyxxyz added bug Something isn't working new Needs triage. Comments are welcome! labels Jun 28, 2021
@blyxxyz blyxxyz changed the title Prompted passwords are not persisted into sessions Prompted passwords are not properly persisted into sessions Jun 28, 2021
@isidentical isidentical added needs product design We like the idea, but we want to explore the problem deeper, and consider the solution holistically enhancement New feature or enhancement and removed new Needs triage. Comments are welcome! bug Something isn't working labels Dec 28, 2021
@isidentical
Copy link
Contributor

Fixed by #1239

@isidentical isidentical added this to the HTTPie 3.0 milestone Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement needs product design We like the idea, but we want to explore the problem deeper, and consider the solution holistically
Projects
None yet
Development

No branches or pull requests

2 participants