Skip to content

Remove userinfo support from URL - #154

Open
inanpy wants to merge 3 commits into
mainfrom
refactor/remove-url-userinfo
Open

inanpy wants to merge 3 commits into
mainfrom
refactor/remove-url-userinfo

Conversation

@inanpy

@inanpy inanpy commented Nov 21, 2026 •

Copy link
Copy Markdown
  • Removed username, password, userinfo attributes and keyword arguments from URL, including copy_with().

  • Userinfo URLs are still supported, but the credentials are dropped on parse and excluded from the resulting URL:

url = hip.URL("https://user:password@example.com/path") 
print(url)
# https://example.com/path
  • Removed code that was encoding usernames and passwords.

  • Updated the docstrings and the related examples.

  • Added tests that userinfo is ignored and removed properties and arguments are not accepted.

Tests include =>

  • Copying and joining URLs
  • IPv6 Addressing
  • Ignoring URL encoded user names and passwords.
  • Rejecting the removed keyword arguments.
  • Verify the deleted properties are no longer accessible.

221 tests passed, plus ruff and mypy checks.

Closes #122

@inanpy
inanpy requested review from cgl and lovelydinosaur November 21, 2026 22:32
Comment thread tests/test_urls.py Resolved
Comment thread tests/test_urls.py Resolved
Comment thread tests/test_urls.py
assert url.username == "jo@email.com"
assert url.password == "a secret"
assert url.userinfo == b"jo%40email.com:a%20secret"
assert str(url) == "https://muller.de:1234/pa%20th?search=ab#anchorlink"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This behavior. 👍🏼

Comment thread tests/test_urls.py Resolved
@lovelydinosaur

lovelydinosaur commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Righty. First up, thank you! Really appreciating seeing this neat, well considered, and properly scoped PR.
This looks properly decent. There's a couple of tests we don't really need, or actually, more strongly... that we shouldn't have. Those I'd consider blockers.

I've also added a more note around decorators/parameterize. That's a bit more of an individual preference really. Not a blocker though an overall style consideration.

A personal note... I am still finding it challenging to see us moving forward with the project unless we've properly addressed team balance. We've had a couple of comment contributions and they've been from dudes, that's okay an' all, simply that I'm not going to be able to continue working on this unless we absolutely prioritise gender representation right from the start.

I realise this is obvious and boorish to have to say so explicitly, though it is how it is. I don't know how we'll deal with this exactly, though clearly ties in with whatever we choose to do with respect to funding etc. Short version is simply... let's not merge anything from new team members until/unless we're 100% confident we can ensure we're not about to fall into the same ol' dynamics.

with thanks 🙂

@inanpy

inanpy commented Nov 25, 2026

Copy link
Copy Markdown
Author

Righty. First up, thank you! Really appreciating seeing this neat, well considered, and properly scoped PR. This looks properly decent. There's a couple of tests we don't really need, or actually, more strongly... that we shouldn't have. Those I'd consider blockers.

I've also added a more note around decorators/parameterize. That's a bit more of an individual preference really. Not a blocker though an overall style consideration.

A personal note... I am still finding it challenging to see us moving forward with the project unless we've properly addressed team balance. We've had a couple of comment contributions and they've been from dudes, that's okay an' all, simply that I'm not going to be able to continue working on this unless we absolutely prioritise gender representation right from the start.

I realise this is obvious and boorish to have to say so explicitly, though it is how it is. I don't know how we'll deal with this exactly, though clearly ties in with whatever we choose to do with respect to funding etc. Short version is simply... let's not merge anything from new team members until/unless we're 100% confident we can ensure we're not about to fall into the same ol' dynamics.

with thanks 🙂

Thanks, Kim, for the comments. I completely get your concerns. Thanks for being transparent about them. I do think it’s important to think about how the team grows.

This branch has not been deployed

No deployments
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.

🛑 Deprecate username/password support in URL.

2 participants