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 extensibility to Credential Response #391

Merged
merged 11 commits into from
Sep 30, 2024

Conversation

c2bo
Copy link
Member

@c2bo c2bo commented Sep 13, 2024

Option 2 as introduced by @paulbastian and discussed in #386:

  • Credential Response always returns an array
  • This array holds an object with the credential and additional (optional) metadata
  • notification_id is also moved into this new object
  • deferred Endpoint re-uses this array for its response

Closes #386
Closes #58

* `transaction_id`: OPTIONAL. String identifying a Deferred Issuance transaction. This claim is contained in the response if the Credential Issuer cannot immediately issue the Credential. The value is subsequently used to obtain the respective Credential with the Deferred Credential Endpoint (see (#deferred-credential-issuance)). It MUST not be used if `credential` or `credentials` is present. It MUST be invalidated after the Credential for which it was meant has been obtained by the Wallet.
* `credentials`: OPTIONAL. Contains an array of one or more issued Credentials. It MUST NOT be used if the `transaction_id` parameter is present. The elements of the array MUST be objects. The following parameters are used inside this object (other parameters MAY also be included):
* `credential`: REQUIRED. Contains one issued Credential. It MAY be a string or an object, depending on the Credential Format. See Appendix A for the Credential Format-specific encoding requirements.
* `notification_id`: OPTIONAL. String identifying an issued Credential that the Wallet includes in the Notification Request as defined in (#notification).
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a single notification_id for the whole response?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've been struggling with the same question for a few days:

A notification_id for each credential in the batch is cleaner/simpler, as we don't need to worry about partial states (i.e. the question of what notification to make if you receive 10 credentials and only manage to store 5 of them).

However it's kindof sucky to make 10 notification http calls for a batch of 10 credentials.

I'm probably veering towards cleaner/simpler and ignoring the 'kind of sucky' part.

Copy link
Contributor

Choose a reason for hiding this comment

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

We may change the notification request to an array as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that could make a lot of sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I think that notification_id should point to a single credential not in a batch.

For instance, an Issuer can react to a notification event carrying a credential_deleted or credential_failure to invalidate the credential from a status list.

We can avoid multiple posts for notifications by using an array of notification_id per possible event.

{
  "credential_accepted" : [ "notId#1"],
  "credential_failure" : ["notid#4"],
  "credential_deteled": [ ]
}

Something like a summary notification

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also okay with moving notification_id in

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might be useful to move it in because of credential_deleted which is specific to one issued credential although when I think about it, notification_id overlaps a bit with the concept of credential version IDs or data set IDs but this is out of scope of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why would a wallet delete a single instance rather than the whole batch or the same Credential Dataset?

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe because the user has used that one instance? but not sure that information needs to be communicated to the issuer real-time, since that would allow the issuer to get more information about when credential is used

Copy link
Contributor

Choose a reason for hiding this comment

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

Communicating this to the issuer seems like a privacy violation, in most ecosystems issuers should not get knowledge about the usage of their credentials, so I don't think this is a valid use case for notification_id in the array. As was discussed in the last DCP call, I would favor leaving it out

Copy link
Contributor

@paulbastian paulbastian left a comment

Choose a reason for hiding this comment

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

I'm not entirely sure about notification_id, but apart from that, looks good to me! We also figured out that there may be cases around revocation that may benefit from this in the future.

@c2bo
Copy link
Member Author

c2bo commented Sep 16, 2024

How should we proceed with the notification endpoint? If we want to change that one to expect an array, should this happen in this PR or should we create another issue/PR?

@paulbastian
Copy link
Contributor

I would say it makes sense in this PR, as this one also changes that the behavior of notification_id in the credential response

Copy link
Contributor

@awoie awoie left a comment

Choose a reason for hiding this comment

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

I'm ok with the direction of this PR. I believe it is useful that notification_id is moved in too. Although I believe that notification_id should be potentially renamed in the future to credential version ID or credential data set ID.

@jogu jogu added this to the Final 1.0 milestone Sep 17, 2024
Copy link
Contributor

@awoie awoie left a comment

Choose a reason for hiding this comment

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

When I think about this another time, I also that a single notification id would be more logical When I approved, I thought it would also allow for different data sets. If the use case is really just different keys, not data sets such as math-exam vs science-exam, I think it should be a top-level notification id instead of individual notification ids.

@c2bo
Copy link
Member Author

c2bo commented Sep 17, 2024

discussed on the DCP WG call (17/09):
People seem to prefer notification_id as a top level parameter and convey only the overall issuance process (batch or not)

  • notification endpoint can remain unchanged
  • we need a bit more language on how to deal with partial failures
    I'll adjust the PR accordingly and mark it as ready for review

@babisRoutis
Copy link
Contributor

discussed on the DCP WG call (17/09): People seem to prefer notification_id as a top level parameter and convey only the overall issuance process (batch or not)

* notification endpoint can remain unchanged

* we need a bit more language on how to deal with partial failures
  I'll adjust the PR accordingly and mark it as ready for review

The notification_id represents a notification (event) that can be send from the wallet.

Currently (d13,d14), such a notification event is related to a single - issued - credential, hence the event types names: credential_accepted, credential_failed, credential_deleted.

Should we change notification_id to be applicable for the credentials array, I think we should also change the names of the events and their description, to be consistent.

For instance , credentials_accepted, credentials_failed, credentials_deleted.

BTW, I don't understand very well what's the difference between failed & deleted credentials.

@babisRoutis babisRoutis self-requested a review September 18, 2024 11:58
Copy link
Contributor

@babisRoutis babisRoutis left a comment

Choose a reason for hiding this comment

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

Please consider keeping consistent the granularity of notification (event) names with the notification_id scope.

Keeping notification_id as a top-level item of credential response, means that a notification is related to the whole array of credentials.

Perhaps the names credential_accepted, credential_failed and credential_deleted should be in plural.

@babisRoutis
Copy link
Contributor

discussed on the DCP WG call (17/09): People seem to prefer notification_id as a top level parameter and convey only the overall issuance process (batch or not)

It is not very clear (to me) what the rules for this top-level attributes would be.
I guess there are two options:
a) notification_id can be provided only if there is the credentials array
b) notification_id can be provided in any case (either when credentials or transaction_id is present.)

I think (a) is more clear because you get the notification_id together with your credentials both in the simple and deferred cases.

(Sorry for the multiple comments)

@jogu
Copy link
Contributor

jogu commented Sep 19, 2024

@babisRoutis

For instance , credentials_accepted, credentials_failed, credentials_deleted.

BTW, I don't understand very well what's the difference between failed & deleted credentials.

From memory, "failed" is "a technical failure somewhere, e.g. wallet thinks the credential is invalid" and "deleted" is more along the lines of an operation explicitly performed by the user (so e.g. the wallet shows the user the issued credential, and the user decides they don't want to actually store it). If this needs to be clarified in the spec I'd suggest a new issue is opened for that.

@c2bo c2bo force-pushed the 386-extensibility-to-credential-response branch from e063e63 to c6018ff Compare September 19, 2024 12:07
@c2bo c2bo marked this pull request as ready for review September 19, 2024 12:08
@c2bo
Copy link
Member Author

c2bo commented Sep 19, 2024

I've tried to add all of the discussed changes. Two points that I am uncertain about:

  • I agree that the naming of the events is not a 100% fit now, but am not sure if we should change them at this state. I decided to keep them as is and explain the meaning in the description
  • Partial Issuance Errors seem weird and I am not sure if the current language is sufficient

Copy link
Collaborator

@Sakurann Sakurann left a comment

Choose a reason for hiding this comment

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

not sure why this PR modifies deferred endpoint to accept notification_id? was it meant to say transaction_id?

also would like to see some descriptions to be more precise

@c2bo
Copy link
Member Author

c2bo commented Sep 19, 2024

not sure why this PR modifies deferred endpoint to accept notification_id? was it meant to say transaction_id?

It is modifying the Deferred Credential Response not the Request. The idea would be that notification_id is always returned when the wallet receives credentials.

In the case of deferred issuance that means that the credential endpoint returns a transaction_id and the deferred credential endpoint then returns credentials and notification_id

@Sakurann
Copy link
Collaborator

good to merge once @awoie approves

The Wallet sends an HTTP POST request to the Notification Endpoint with the following parameters in the entity-body and using the `application/json` media type. If the Wallet supports the Notification Endpoint, the Wallet MAY send one or more Notification Requests per Credential issued.
The Wallet sends an HTTP POST request to the Notification Endpoint with the following parameters in the entity-body and using the `application/json` media type. If the Wallet supports the Notification Endpoint, the Wallet MAY send one or more Notification Requests per `notification_id` value received.
* `notification_id`: REQUIRED. String received in the Credential Response or Deferred Credential Response identifying an issuance flow that contained one or more Credentials with the same Credential Configuration and Credential Dataset.
* `event`: REQUIRED. Type of the notification event. It MUST be a case sensitive string whose value is either `credential_accepted`, `credential_failure`, or `credential_deleted`. `credential_accepted` is to be used when the Credentials were successfully stored in the Wallet, with or without user action. `credential_deleted` is to be used when the unsuccessful Credential issuance was caused by a user action. In all other unsuccessful cases, `credential_failure` is to be used. Partial errors during batch credential issuance (e.g., one of the Credentials in the batch could not be stored) MUST be treated as the overall issuance flow failing.
Copy link
Contributor

@nemqe nemqe Sep 26, 2024

Choose a reason for hiding this comment

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

if the response is always a list containing a credentials key, does it make sense to rename these event to use the plural form like credentials_accepted...

Maybe you had this discussion already somewhere so please feel free just to disregard this comment

@bc-pi bc-pi self-requested a review September 30, 2024 14:56
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.

Add extensibility to Credential Response Issuance of transaction_ids
10 participants