Skip to content

[WIP] Don't merge - these are for discussion #1

Draft
timhughes wants to merge 11 commits intotomtastic:mainfrom
timhughes:main
Draft

[WIP] Don't merge - these are for discussion #1
timhughes wants to merge 11 commits intotomtastic:mainfrom
timhughes:main

Conversation

@timhughes
Copy link
Copy Markdown

No description provided.

the module source code is all contained in the src directory
which makes for easier testing and keep it separate from the rest of the
cruft that a project needs
they are bulshit ones from gemini so you will need to
check over them all with a fine toothed comb
Copy link
Copy Markdown
Owner

@tomtastic tomtastic left a comment

Choose a reason for hiding this comment

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

Thanks, I had experimented with a few directory structures with varying levels of success, especially when it came to getting things like mypy to pick up imports correctly.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I didn't know about this, nice!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

No idea why I failed to run black against these, but yeah, good stuff.

@timhughes timhughes marked this pull request as draft November 19, 2024 19:38
@property
def issuer(self) -> list[str]:
"""Issuer."""
return [
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice, this nested list comp solves a lot of ugliness, thanks

ext_key_usage_object = self.cert.extensions.get_extension_for_oid(
ExtensionOID.EXTENDED_KEY_USAGE
).value
for usage in ext_key_usage_object.__dict__["_usages"]:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Is there a way I can avoid this calling of dunder methods with private sounding key names?

authorityInfoAccess = self.cert.extensions.get_extension_for_oid(
ExtensionOID.AUTHORITY_INFORMATION_ACCESS
)
for access in authorityInfoAccess.value:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This inspection of object values seemed clunky, but I didn't know another way to do it, is there a better way?

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I did not know you could do this, sweet!

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.

2 participants