Skip to content

refactor: move basic auth credentials out of Request #2164

Merged
mre merged 6 commits into
lycheeverse:masterfrom
rina-forks:basic-auth-refactor-2
May 9, 2026
Merged

refactor: move basic auth credentials out of Request #2164
mre merged 6 commits into
lycheeverse:masterfrom
rina-forks:basic-auth-refactor-2

Conversation

@katrinafyi

@katrinafyi katrinafyi commented Apr 24, 2026

Copy link
Copy Markdown
Member

the basic auth extractor is now held by WebsiteChecker which makes sense because it's only applicable to website checks.

previously, the basic auth credentials were attached to the Request during the collecting phase, which is unnecessarily early i think. this change also avoids the need to repeatedly pass the "basic auth extractor" into helper functions.

i should add that i find the basic auth extractor and basic auth selector names to be very confusing. to me, "basic auth extractor" sounds like it parses basic auth strings from URLs when it's actually just a known database of basic auth credentials. "basic auth selector" sounds like it should do what basic auth extract actually does - select from a list of known basic auths. i haven't changed it in this PR but just something to think about.

One goal of this refactor is to make it more palatable to store Request inside Response (for #2097), since it no longer has sensitive information.

the basic auth extractor is now held by WebsiteChecker which makes sense
because it's only applicable to website checks.

previously, the basic auth credentials were attached to the Request
during the collecting phase, which is unnecessarily early i think.

@thomas-zahner thomas-zahner left a comment

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.

Looks like a nice little improvement!

@mre any objections?

@mre mre left a comment

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.

Looks fine. If we like, we can rename it, but we can do that in a follow-up PR. ✌️

@mre mre merged commit b990100 into lycheeverse:master May 9, 2026
7 checks passed
@mre mre mentioned this pull request May 9, 2026
This was referenced May 30, 2026
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.

3 participants