opencred icon indicating copy to clipboard operation
opencred copied to clipboard

Feat/dc api workflow

Open Ryanmtate opened this issue 3 months ago • 5 comments

This pull request adds support for a new "DC API" workflow type to the OpenCred platform, enabling Digital Credential API-based verification flows. It introduces a new relying party configuration for DC API, updates the JWT generation logic to handle DC API responses, and adds related configuration, validation, and localization changes.

DC API Workflow Support

  • Added support for a new dc-api workflow type in the configuration (WorkflowType.DcApi) and included it in the list of available exchange protocols. [1] [2]
  • Added a sample relying party configuration for DC API, including workflow details and claim mappings, to combined.example.yaml.
  • Updated workflow validation logic to recognize and handle the new DC API type.

JWT Generation Enhancements

  • Enhanced jwtFromExchange in common/jwt.js to generate JWTs for DC API workflows, extracting relevant fields from the DC API response and including verification status and errors as claims.

Localization and UI

  • Added DC API-specific translation strings for UI prompts and error messages in the configuration.

General Configuration

Added an example config for dc api workflow.

Ryanmtate avatar Sep 30 '25 00:09 Ryanmtate

Updated ESLint configuration to enforce single quotes and improve code style consistency across the project (.eslintrc.cjs).

@Ryanmtate seems like some of the files in the PR have a bunch of formatting changes to use double quotes and changed spacing. Generally preferable to split linting/formatting changes out into their own PRs but sometimes it's not practical, so I'm willing to consider it here, but maybe you could relint the config.js file and a couple others to ensure that the eslint config changes are working against the current "DB style" approach.

Our team is using MacOS or Unix systems generally, so it wouldn't be a surprise if there is a little formatting consistency work to do to enable clean collaboration with windows user developers.

ottonomy avatar Oct 02 '25 16:10 ottonomy

  • Also commenting on the formatting/style churn. I assume that was from some editor automation?
  • Looks like maybe a couple lines do a useful change from errant tabs to spaces, but otherwise it all seems an unnecessary change.
  • PRs from remote branches are not running actions, but if they did, there would be 1638 lint problems here.
  • The added eslint quotes rule maybe isn't needed. That is already in the digitalbazaar config, but without the avoidEscape option. In either case, there are now 310 double quote errors.

davidlehn avatar Oct 03 '25 03:10 davidlehn

  • Also commenting on the formatting/style churn. I assume that was from some editor automation?
  • Looks like maybe a couple lines do a useful change from errant tabs to spaces, but otherwise it all seems an unnecessary change.
  • PRs from remote branches are not running actions, but if they did, there would be 1638 lint problems here.
  • The added eslint quotes rule maybe isn't needed. That is already in the digitalbazaar config, but without the avoidEscape option. In either case, there are now 310 double quote errors.

Yes, thank you, this was an IDE configuration, which doesn't seem to be pulling in the eslint config. I will see if I can revert these formatting changes.

Ryanmtate avatar Oct 03 '25 14:10 Ryanmtate

@ottonomy @davidlehn

I ran eslint against the project and resolved the linting errors. I still see formatting changes to the .vue exchange layout file, maybe there is another linter for vue being used?

Ryanmtate avatar Oct 07 '25 03:10 Ryanmtate

@ottonomy @davidlehn

I ran eslint against the project and resolved the linting errors. I still see formatting changes to the .vue exchange layout file, maybe there is another linter for vue being used?

The eslint setup does lint .vue files via the eslint-config-digitalbazaar/vue3 rules. It's going to enforce the same js style there and and check for other vue issues. Looks like those files were changed to another style with different quotes, indents, and so on.

A future opinionated style issue is that the next version of digitalbazaar eslint config checks for no trailing commas. I notice many being added here. Configurable of course, but that's the direction we went for consistency vs no rule and mixed syntax.

davidlehn avatar Oct 07 '25 17:10 davidlehn