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

Support did_dht_resolution in C #390

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

Conversation

andresuribe87
Copy link
Contributor

What type of PR is this? (check all applicable)

  • ♻️ Refactor
  • ✨ New Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 👷 Example Application
  • 🧑‍💻 Code Snippet
  • 🎨 Design
  • 📖 Content
  • 🧪 Tests
  • 🔖 Release
  • 🚩 Other

Description

Adds support for did_dht_resolution in a C ABI.

Let me know if it's cool to include the tokio runtime web5_c library that's being built by the bindc recipe.

Related Tickets & Documents

N/A - couldn't find any. I wanted to add this because I'm aiming to extend curl so that it can handle did protocols. This is critical in order to promote interop. Since curl is written in C, this is a simple first step to use the rust-core to power the curl fork I'll be working on.

Mobile & Desktop Screenshots/Recordings

N/A

Added code snippets?

  • 👍 yes
  • 🙅 no, because they aren't needed

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

No tests? Add a note

The provided example code is the test itself. There is a README with the explanation.

Added to documentation?

  • 📜 readme
  • 📜 contributing.md
  • 📓 general documentation
  • 🙅 no documentation needed

No docs? Add a note

Added a README that explains how to run the given code.

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Copy link

github-actions bot commented Oct 9, 2024

TBD Spec Test Vectors Report (web5-core-kt)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
183300
ℹ️ 3 out of 18 test vectors passed successfully.

❌ Missing Vectors (15)

These are test vectors without any test cases.
FeatureName
Credentialscreate
Credentialsverify
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidDhtresolve
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-09T19:35:22.533Z

Copy link

github-actions bot commented Oct 9, 2024

TBD Spec Test Vectors Report (web5-rs)

Total Test VectorsTotal Test Cases✅ Passed❌ Failed⚠️ Skipped
185500
ℹ️ 5 out of 18 test vectors passed successfully.

❌ Missing Vectors (13)

These are test vectors without any test cases.
FeatureName
Credentialscreate
CryptoEs256ksign
CryptoEs256kverify
DidDhtcreate
DidWebresolve
PortableDidparse
PresentationExchangecreate_presentation_from_credentials
PresentationExchangeevaluate_presentation
PresentationExchangeselect_credentials
PresentationExchangevalidate_definition
PresentationExchangevalidate_submission
VcJwtdecode
VcJwtverify

Automatically generated at: 2024-10-09T19:40:48.585Z

} else {
match unsafe { CStr::from_ptr(gateway_url).to_str() } {
Ok(s) => Some(s.to_string()),
Err(_) => return ptr::null_mut(),
Copy link
Contributor

Choose a reason for hiding this comment

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

at some point we should introduce better error handling over the C FFI, but it's not necessary at this moment


To run this C example:

1. Ensure you have a C compiler installed (e.g. GCC) and [Just](https://github.com/casey/just) command runner.
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw we already have just included in the hermit dependencies, though I'd be curious if hermit has a gcc dependency available b/c if not then the developer will have to bring-their own which would be the first of it's kind in this repo

Copy link
Contributor

@KendallWeihe KendallWeihe left a comment

Choose a reason for hiding this comment

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

well done 👏

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