Skip to content

network: add DetachedSignatureAvailableCheck#771

Open
parona-source wants to merge 3 commits intopkgcore:masterfrom
parona-source:detached-signature-check
Open

network: add DetachedSignatureAvailableCheck#771
parona-source wants to merge 3 commits intopkgcore:masterfrom
parona-source:detached-signature-check

Conversation

@parona-source
Copy link
Contributor

@thesamesam was interested in this

I couldn't fully follow precedent with the network tests. The check deals with multiple network requests in one go so just a mocking of the returnvalue wasn't enough.

@parona-source parona-source force-pushed the detached-signature-check branch from 8697f61 to 694a268 Compare February 14, 2026 15:50
Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this. It works well for me as well.

Copy link
Member

@arthurzam arthurzam left a comment

Choose a reason for hiding this comment

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

Some small changes I want, but looks really good.

I even want to run it global wise to know if it finds something

for url in f.uri:
for extension in self.detached_signature_extensions:
yield (f.filename, f"{url}{extension}")
return []
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return []

no need for this return

Copy link
Contributor Author

@parona-source parona-source Feb 18, 2026

Choose a reason for hiding this comment

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

This is also done this way in PyPIAttestationAvailableCheck. Should that be changed as well?

I mostly copied that check.

Copy link
Contributor Author

@parona-source parona-source Feb 18, 2026

Choose a reason for hiding this comment

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

Applied suggestion. Didn't touch PyPIAttestationAvailableCheck

Edit: Touched it by minimising it as well.

Comment on lines 535 to 536
result = future.result()
if result is not None:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
result = future.result()
if result is not None:
if (result := future.result()):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_UrlCheck and PypiAttestationAvailableCheck do this as well. Should I touch these?

Copy link
Contributor Author

@parona-source parona-source Feb 18, 2026

Choose a reason for hiding this comment

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

Realised I could minimise duplicated code by using _UrlCheck. Didn't touch them but I removed this from the new check.

PypiAttestationAvailableCheck looks like it could get minimised as well.

Edit: Touched them.

@parona-source parona-source force-pushed the detached-signature-check branch from 694a268 to 4269370 Compare February 18, 2026 11:53
Signed-off-by: Alfred Wingate <parona@protonmail.com>
@parona-source parona-source force-pushed the detached-signature-check branch from 4269370 to 9f22eac Compare February 18, 2026 11:55
Signed-off-by: Alfred Wingate <parona@protonmail.com>
Signed-off-by: Alfred Wingate <parona@protonmail.com>
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