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

fix(api/unstable): make all api methods visible #4015

Merged
merged 17 commits into from
May 25, 2023

Conversation

jmayclin
Copy link
Contributor

@jmayclin jmayclin commented May 19, 2023

Resolved issues:

resolves #4012

Description of changes:

  • include api headers to fix accidentally hidden public methods
  • auto-generate all bindings for unstable features
  • add "test" for api visibility
  • delete autogenerated internal.rs that doesn't need to be checked into git
  • use cargo test --all-features to avoid the multiple builds incurred by different feature flags

The "external build" test for the Rust bindings CI is a very effective test for api visibility, so I

  1. added bindings for all unstable APIs
  2. added functions that make it easy to do so
  3. added documentation that describes how easy it is to do

This gives us coverage over all of the unstable functions, and as such we can conclude that all of the functions in unstable headers will be visible after this commit.

Since the bindings are now autogenerated for ever header in the unstable folder, this will hopefully prevent the problem from occuring in the future.

The methods that weren't actually visible were

  • s2n_client_hello_free
  • s2n_client_hello_parse_message
  • s2n_config_set_npn

Testing:

Passing CI should be sufficient, but I also rebased my JA-3 PR #4009 on top of this PR and made sure that everything built and all tests passed.

I also confirmed that the same number of tests ran (because of the changed type allowlisting thing) and there is actually one test that apparently we were accidentally denylisting, because now 221 tests run instead of 220.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

jmayclin added 2 commits May 19, 2023 05:39
the simplify part is using the headers copied from s2n-tls to the lib
directory.
I really just need to add this as a commit hook
@jmayclin jmayclin marked this pull request as ready for review May 19, 2023 16:41
@jmayclin jmayclin requested review from toidiu and removed request for maddeleine May 22, 2023 23:43
Comment on lines 26 to 29
crl = []
fingerprint = []
internal = []
npn = []
Copy link
Contributor

Choose a reason for hiding this comment

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

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 added the unstable prefix, but are we sure that we want to add the unstable flag requirement? I've personally always found it very irritating to work with, and think that the unstable prefix should do a sufficient job of warning customers?

@jmayclin jmayclin requested a review from camshaft May 23, 2023 22:55
@jmayclin jmayclin requested a review from toidiu May 23, 2023 23:12
jmayclin added 3 commits May 24, 2023 16:33
* regex dependency unused
* constants have static lifetime by default
@jmayclin jmayclin requested a review from camshaft May 24, 2023 23:53
@jmayclin jmayclin enabled auto-merge (squash) May 25, 2023 00:06
@jmayclin jmayclin merged commit 1f03ba5 into aws:main May 25, 2023
dougch pushed a commit to dougch/s2n-tls that referenced this pull request May 31, 2023
* add appropriate includes so that all api methods are visible when s2n-tls is compiled as a shared object
* autogenerate bindings for all api methods and test the visibility to prevent a regression
@jmayclin jmayclin deleted the api-visibility branch June 15, 2024 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

api visibility: some public functions are not visible in libs2n.so
3 participants