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

#11626 fix twist conch --auth=sshkey #11810

Merged
merged 15 commits into from
Feb 15, 2023
Merged

#11626 fix twist conch --auth=sshkey #11810

merged 15 commits into from
Feb 15, 2023

Conversation

glyph
Copy link
Member

@glyph glyph commented Feb 14, 2023

Scope and purpose

Fixes #11626

Contributor Checklist:

This process applies to all pull requests - no matter how small.
Have a look at our developer documentation before submitting your Pull Request.

Below is a non-exhaustive list (as a reminder):

  • The title of the PR should describe the changes and starts with the associated issue number, like “#9782 Remove twisted.news. #1234 Brief description”.
  • A release notes news fragment file was create in src/twisted/newsfragments/ (see: Release notes fragments docs.)
  • The automated tests were updated.
  • Once all checks are green, request a review by leaving a comment that contains exactly the string please review.
    Our bot will trigger the review process, by applying the pending review label
    and requesting a review from the Twisted dev team.

@glyph
Copy link
Member Author

glyph commented Feb 14, 2023

please review

@chevah-robot chevah-robot requested a review from a team February 14, 2023 06:58
@glyph
Copy link
Member Author

glyph commented Feb 14, 2023

It would be nice to address the coverage gap here, but the types are sufficient in this case (I've tested this interactively, and ssh clients can indeed authenticate to conch again)

@adiroiban
Copy link
Member

@glyph is it ok to merge a change without a test?
In the past we were rejecting PR is they don't have tests for the changes done in that particular PR.

Regards

@glyph
Copy link
Member Author

glyph commented Feb 14, 2023

@adiroiban I suppose it's up to you, as the reviewer, if you want to say "no, we must have test coverage" ;-).

As a matter of policy we require tests. As a matter of principle I'd say "I just added type annotations, no behavior was changed" is an acceptable reason to that requirement. But of course, this change doesn't adhere to that principle; I do encoding where there wasn't any encoding before, to address the bug.

My reasoning for this fairly unprincipled exception is:

  • a real test of this behavior would be exceedingly expensive, and require like… an entire docker container with a twist running as root since pwd is otherwise inaccessible, not to mention the ability to create an arbitrary home directory, so the best we could do would be a fairly unconvincing fake, which strikes me as not worth it
  • this code was previously changed (and regressed) somehow, since pubkey auth used to work on python3 in this configuration; I know because I run a server whose SSH access broke
  • the code just obviously doesn't work at all right now and this is a quick fix

but, you could make a similar case for any other too-long-regressed bug, so 🤷 I'll have to leave it up to a reviewer

@glyph
Copy link
Member Author

glyph commented Feb 14, 2023

  • a real test of this behavior would be exceedingly expensive, and require like… an entire docker container with a twist running as root since pwd is otherwise inaccessible, not to mention the ability to create an arbitrary home directory, so the best we could do would be a fairly unconvincing fake, which strikes me as not worth it

well I guess the fake version is okay if everything is typechecked everywhere, so I added a bunch more types

@glyph
Copy link
Member Author

glyph commented Feb 14, 2023

OK, tests cover it. @adiroiban I think this might be more of a rubber stamp now :)

Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Many thanks for this great update.
Should be ready to merge.

@glyph
Copy link
Member Author

glyph commented Feb 15, 2023

Thanks for the prompting on the test!

@glyph glyph merged commit 7f421f9 into trunk Feb 15, 2023
@glyph glyph deleted the 11626-auth-sshkey branch February 15, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twist conch --auth=sshkey doesn't work due to passing bytes to getpwnampwd.
3 participants