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

Add ability to pass in additional-properties in vc create #399

Merged

Conversation

w3irdrobot
Copy link
Contributor

@w3irdrobot w3irdrobot commented Oct 19, 2024

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

This PR adds ability to pass in additional-properties in vc create.

I changed the command's method to take ownership of self since it simplified my handling of the values being passed in. This change required updating of a few other parts of the code to act on the values directly instead of through references.

Related Tickets & Documents

Resolves #326

Mobile & Desktop Screenshots/Recordings

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

Added to documentation?

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

No docs? Add a note

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

No

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

image

@blackgirlbytes
Copy link
Contributor

let's gooo

Copy link
Contributor

@nitro-neal nitro-neal left a comment

Choose a reason for hiding this comment

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

can you post some example output?

@w3irdrobot
Copy link
Contributor Author

₿ cargo run -p web5_cli -- vc create did:dht:36xw3konj1pdd93axsn9p3a58a83uatcgx1nsjud97d91dtr56ry \
    --issuer did:dht:36xw3konj1pdd93axsn9p3a58a83uatcgx1nsjud97d91dtr56ry \
    --no-indent \
    --additional-property "role:engineer" \
    --additional-property "clearance:level5" \
    | jq .
{
  "@context": [
    "https://www.w3.org/2018/credentials/v1"
  ],
  "id": "urn:uuid:6e4bb08c-cd40-4981-ab7a-d5d7b4d8ba5d",
  "type": [
    "VerifiableCredential"
  ],
  "issuer": "did:dht:36xw3konj1pdd93axsn9p3a58a83uatcgx1nsjud97d91dtr56ry",
  "credentialSubject": {
    "id": "did:dht:36xw3konj1pdd93axsn9p3a58a83uatcgx1nsjud97d91dtr56ry",
    "role": "engineer",
    "clearance": "level5"
  },
  "issuanceDate": "2024-10-21T23:49:57Z"
}

@w3irdrobot
Copy link
Contributor Author

@nitro-neal is there anything else that you need?

@taniashiba
Copy link
Contributor

taniashiba commented Oct 28, 2024

Following up on this - @nitro-neal @KendallWeihe - is there anything else needed here to close out this PR? Given that this is the final week of Hacktoberfest, I want to make sure our contributors get their PRs accepted, and contributions count ahead of that deadline! Please review, accept and merge the task, then label it hacktoberfest-accepted once approved. Thank you so much. 🙏

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!

@blackgirlbytes
Copy link
Contributor

oh wait..could we resolve the merge conflicts? @w3irdrobot so that we can get this merged.

@w3irdrobot w3irdrobot force-pushed the issue-326-extra-props-vc-create branch from 97e8c7d to d51459b Compare October 28, 2024 20:12
@w3irdrobot
Copy link
Contributor Author

@blackgirlbytes i cleaned it up

@w3irdrobot w3irdrobot force-pushed the issue-326-extra-props-vc-create branch from d51459b to 70d803f Compare October 28, 2024 20:30
@KendallWeihe KendallWeihe merged commit 0cbc57e into TBD54566975:main Oct 29, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Feature): Add ability to pass in additional-properties in Web5 CLI to web5 vc create
5 participants