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

x509 Verification: Extension policies documentation. #11800

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

deivse
Copy link
Contributor

@deivse deivse commented Oct 19, 2024

Finally coming back with another PR. The idea is that this one will serve to confirm the user-facing API for custom extension policy support, and the next one will have the first parts of the implementation.

@deivse deivse changed the title Add documentation related to custom x509 verification extension policies. x509 Verification: Extension policies documentation. Oct 19, 2024
@deivse deivse force-pushed the x509_verification_extension_policy_builder_docs branch from d7c5ebd to 649dd50 Compare October 19, 2024 10:00
docs/x509/verification.rst Outdated Show resolved Hide resolved
Comment on lines 341 to 357
.. staticmethod:: webpki_defaults_ca()

Creates an ExtensionPolicyBuilder initialized with a
CA extension policy based on CA/B Forum guidelines.

This is the CA extension policy used by :class:`PolicyBuilder`.

:returns: An instance of :class:`ExtensionPolicyBuilder`

.. staticmethod:: webpki_defaults_ee()

Creates an ExtensionPolicyBuilder initialized with an
EE extension policy based on CA/B Forum guidelines.

This is the EE extension policy used by :class:`PolicyBuilder`.

:returns: An instance of :class:`ExtensionPolicyBuilder`
Copy link
Member

Choose a reason for hiding this comment

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

@woodruffw right now our extension policies are basically "CABF, but with some things loosened where necessary in practice", is there a good way of articulating that for users?

Copy link
Contributor

Choose a reason for hiding this comment

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

@woodruffw right now our extension policies are basically "CABF, but with some things loosened where necessary in practice", is there a good way of articulating that for users?

Sorry, missed this ping originally!

Maybe something like "these extension policies are intended to be strictly consistent with CABF, which dictates the requirements for certificates on the public web. However, we make limited exceptions to CABF where necessary in practice, i.e. behaviors that CABF forbids but are nonetheless present in the current Web PKI."

But maybe that's too much of a mouthful.

Copy link
Member

Choose a reason for hiding this comment

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

We can put it in a glossary entry or something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not quite sure how to formulate this as a glossary entry. What would be the entry name? I would appreciate if someone could write out the full text of the entry here (or just made a separate PR for this).

docs/x509/verification.rst Outdated Show resolved Hide resolved
docs/x509/verification.rst Show resolved Hide resolved
@deivse
Copy link
Contributor Author

deivse commented Oct 25, 2024

Hey, @alex, friendly ping 😄

@alex
Copy link
Member

alex commented Oct 25, 2024

Not forgotten! On my TODO list, hopefully this evening.

Thanks so much for your patience, and sorry I've been so slow. Don't feel bad about pinging me.

@deivse
Copy link
Contributor Author

deivse commented Oct 25, 2024

No worries at all, my plate is also very full right now, so I wouldn't have gotten to doing any actual changes before this weekend at the earliest anyways.

@deivse deivse requested a review from alex November 11, 2024 09:55
Copy link
Member

@alex alex left a comment

Choose a reason for hiding this comment

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

A few tiny notes, but overall I think this design works.

Not going to merge until we have an implementation of course.

Comment on lines +136 to +139
.. versionchanged:: 44.0.0
``verification_time`` and ``max_chain_depth`` were replaced by the
``policy`` property that provides access to these values.

Copy link
Member

Choose a reason for hiding this comment

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

We may want to keep these around as proxies, but this isn't terrible important.

Comment on lines +315 to +316
Creates an ExtensionPolicy initialized with a policy that does
not put any constraints on a certificate's extensions.
Copy link
Member

Choose a reason for hiding this comment

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

I'd maybe add a sentence that expresses that this is what you call if you're trying to do something custom.


:returns: An instance of :class:`ExtensionPolicy`

.. method:: require_not_present(oid)
Copy link
Member

Choose a reason for hiding this comment

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

Do these methods raise an exception if you call them with the same OID multiple times?

Copy link
Contributor Author

@deivse deivse Nov 12, 2024

Choose a reason for hiding this comment

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

No, not currently. Good catch since this is inconsistent with PolicyBuilder behaviour. It won't be too pretty in code but I would guess API consistency takes precedence here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants