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

feat: enable vc service apikey #91

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

ashleythedeveloper
Copy link
Collaborator

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

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Description

This PR adds support for API key authentication in the VC service. It includes the following changes:

  1. Updates the issueVC function in vckit.service.ts to accept an optional vcKitAPIKey parameter.
  2. Modifies the API request in issueVC to include the API key in the Authorization header when provided.
  3. Updates the interfaces to include the optional vcKitAPIKey parameter.
  4. Propagates the vcKitAPIKey parameter through the relevant service functions.

Mobile & Desktop Screenshots/Recordings

Screenshot 2024-08-06 at 7 53 30β€―PM Screenshot 2024-08-06 at 7 52 39β€―PM

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed...
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ“• storybook
  • πŸ™… no documentation needed

Comment on lines +52 to +56
const response = await publicAPI.post<VerifiableCredential>(`${vcKitAPIUrl}/credentials/issue`, body, {
headers: {
...vcKitAPIKey && { "Authorization": `Bearer ${vcKitAPIKey}` }
}
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Currently, the issuing VC is using the public API, eg: http://localhost:3332/v1/credentials/issue, so it doesn't need to add the API key

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, we do if we want to use a VC service with an API key.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Parking this PR for now.

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