Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 section describing use of media types #1055
Add section describing use of media types #1055
Changes from 6 commits
3c6b8b5
b1e0616
3bab618
7c81bc2
59532a5
76b1200
bda384a
fee2e8c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes to this... I might defer this language to a separate PR to avoid blocking this valuable other changes.
proof
is NOT required to make aVerifiableCredential
... asserting thatproof
makes aVerifiableCredential
implies data integrity proofs as a defacto standard representation / serialization for the core data model.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah - this is one reason why i wanted this as a draft first - we do i think want to note that some cryptographic proof is there, not necessarily that it is in the credential as an embedded proof (as it often is not) but that it should be present according to the securing method in use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this paragraph on "proof" ? and move it to an issue to discuss?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1060 opened, paragraph removed to refine language
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OR13 note that i linked directly to the section that calls out both embedded AND external proofs intentionally here. perhaps some additional language as in this suggestion would help
edit: to quote spec text i linked to
At least one proof mechanism, and the details necessary to evaluate that proof, MUST be expressed for a credential or presentation to be a verifiable credential or verifiable presentation; that is, to be verifiable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this spec text is being disputed by @iherman @TallTed @dlongley @msporny and possibly others.
(🔥 let us not register 2 media types that can be used for the "same bytes").
(🔥 let us make sure things are actually verifiable or credentials).
Based on this comment: #1044 (comment)
VerifiableCredential
might containproof
(modified sinceproof
is actually optional inVerifiableCredential
.)VerifiableCredential
is a subtype ofCredential
processing from right to left...
credential
...json
?credential
...ld+json
?credential
...verifiable+ld+json
? (does this violate the MUST NOT or SHOULD NOT from the RFC?)Compared to...
verifiable
...json
?verifiable
...ld+json
?verifiable
...credential+ld+json
? (does this violate the MUST NOT or SHOULD NOT from the RFC?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a strange feeling... as I am not disputing that sentence at all.
I cannot make heads or tails of the remainder of your comment. Maybe try writing full sentences, including what brought you to quote the chunks of draft and ratified RFCs?
A reminder: "Classes" and "Types" do not require Media Types to be defined and useful. A "tiger" is a subtype of "cat", which is a subtype of "mammal", etc. None of these have Media Types, but they are all useful descriptors. A "CompactDisc" is disjoint from "CassetteTape" and both are disjoint from "VinylLP", but all are subtypes of "Audio Recording Media", so all might be considered Media Types ... but this typing is not handled by RFC nor IANA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TallTed The line of argument you have here: #1055 (comment)
Regarding
proof
, is what leads me to believe that you do not see a difference in information betweencredential
andverifiable credential
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OR13,
This is literally what the
+
syntax does in media types. You can describe the string{}
using eitherapplication/json
ORapplication/ld+json
today. There are numerous other examples with+xml
suffixes and others. This subclassing is done on purpose to enable many different use cases.@TallTed has done an excellent job in various threads explaining these rules -- but I fear there continue to be some misunderstandings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the comment from @TallTed #1055 (comment) , then I would suggest we amend the proposals to be the following:
PROPOSAL: The 1 media type for vc proposal, the working group will register
verifiable-credential+ld+json
and the working group will not registercredential+ld+json
.PROPOSAL: The 2 media type for vc proposal, the working group will register
verifiable+credential+ld+json
and the working group will registercredential+ld+json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OR13 wrote:
The notion that you can't have two media types used for exactly the same set of bytes is provably wrong.
For example:
application/octet-stream
can be used for any binary data that the server can't determine a more specific media type for, such asapplication/efi
.application/xml
can be used for any of the roughly 400+ media types that use XML as their serialization mechanism.In addition, we have the whole concept of structured syntax suffixes. I didn't understand how they worked until just a few years ago, and I can see that others in these threads on media types still don't understand how they work, which is resulting in some unworkable proposals/statements being put forward. Structured Syntax Suffixes are one of those rarely talked about/understood things about media types. They say for EXACTLY THE SAME SET OF BYTES, you can serve and interpret those bytes as:
application/verifiable+credential+ld+json
application/credential+ld+json
application/ld+json
application/json
So, four media types can be used for exactly the same set of bytes. This was established at IETF/IANA long ago, and is now being further documented because people are still confused about the point above.
@OR13 wrote:
Yeah, I'm not disputing that either. You need a external/embedded proof of some kind for the thing to be a
verifiable credential
.I would be a +1 for the first proposal directly above this comment (initially proposed by @OR13 and then refined outlined by @andresuribe87), with the caveat that the name of the media type is
vc+ld+json
(where the bikeshedding thereof doesn't need to hold up the decision).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msporny I'm not arguing you can't have different media types for the same bytes.... I am arguing against registered multiple media types for the same bytes with indistinguishable definitions in our spec.
+1 to
vc+ld+json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first question should be whether there's value in having the second media type, whether or not it is a supertype of the type we're primarily focused on. If there is such value (as I believe there is), then if it is a supertype (as I believe it is), I think we should register both, or only the supertype. (If it were a subtype, we might not register it, but there would be good reason to speak of it and to suggest a media type for it.)
Remember that media types are not actively restrictive nor actively prescriptive in most applications, but are primarily hints about how to process the bytes within the resource labeled with that media type. In the world of the web, they're helpful for various tools to make known to a web server what form of resource those tools prefer such that the server can provide that, if available. (See RFC2295, among others.) It's perfectly valid for my super app to process resources of every media type in exactly the same way, if users of my super app find value in what my app outputs based on those inputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TallTed does this 3rd proposal capture your alternate single registration proposal? :
PROPOSAL: The 1 media type for
credential
proposal, the working group will registercredential+ld+json
and the working group will not registerverifiable+credential+ld+json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the intention here, but I don't think
verifiable
is correct... I thinkverifiable-credential
is correct.It would be nice to straw poll on
verifiable
vsverifiable-credential
registration options. Just to see the preferences.I think there are several folks in favor of registering
verifiable+credential+ld+json
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - if we register
credential
then the+
syntax would make likely the most senseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The registrations have to be complete and independent....
If we register
verifiable+credential+ld+json
we would have to registercredential+ld+json
if we wanted to be able to distinguish between bytes.If WG members persist in asserting that
proof
is allowed incredential+ld+json
I suggest we only registerverifiable+credential+ld+json
, and that we NOT attempt to definecredential+ld+json
... sinceproof
will always be allowed (but not required) inverifiable+credential+ld+json
....There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're to register
application/verifiable+credential+ld+json
, we would have to registerapplication/credential+ld+json
because it's required by the RFC which enables multiple+
in registered Media Types, whether or not we want to be able to distinguish between bytes.If we're to register
application/verifiable-credential+ld+json
, we would not have to registerapplication/credential+ld+json
because this is permitted by the RFC which enables multiple+
in registered Media Types.Regardless of whether
proof
is allowed inapplication/credential+ld+json
, if we registerapplication/verifiable+credential+ld+json
we must register (which means we must define)application/credential+ld+json
because it's required by the RFC which enables multiple+
in registered Media Types.If we "persist" in permitting
proof
incredential+ld+json
, we'll have no need forapplication/verifiable+credential+ld+json
(norapplication/verifiable-credential+ld+json
) because the questions of whether there's aproof
and whether it "proves" the credential comes down to business logic (which may include the application of various cryptomath).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is exactly why putting proof in the credential and leaving a decision whether to validate a signature or not to a technical layer but to a business layer does not make sense to me.
entity receiving a thing needs to know whether it is required to verify a signature or not. "I will not validate a signature because i don't need to do so for my business, regardless of whether the thing is signed or not" sounds pretty dangerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sakurann,
Whether to check a signature or not is always a business/application rules decision -- and one that you need to configure ahead of time in your software, before you receive anything from a party that might be an attacker. An attacker will just tell you not to check the signature. Media types don't solve this problem.
Also, there are also plenty of applications that don't need to check signatures -- like simple JSON viewers. It would be a pretty significant annoyance to a developer if they weren't able to even see some JSON to do some debugging because a signature checker had to be run ahead of time and it was failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sakurann wrote:
Allowing the attacker to pick when/how the receiver checks the signature, such as by triggering off of media type, is what is dangerous.
The approach being described in the "trigger certain types of checking based on media type" approach is analogous to the
alg=none
and HMAC flaws in the JOSE stack (that enable the attacker to decide how and what the server checks):This isn't about technical layer vs. business layer... this is all "security layer" stuff, and the more you enable an attacker to pick the parameters for checking (such as via media type), the greater the attack surface.
This PR is a better direction than the previous media type PRs because it allows us to spell out those rules/expectations regardless of media type... which is the right thing to do, IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notably, we haven't actually defined the latter one yet, but this is just an informative thing that can be changed as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly - especially given the discussion on #1034 re
verifiable-credential
vsverifiable+credential
this gives us a good way to get alignedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msporny has requested to use
vc+ld+json
elsewhere, which I agree with, but we can leave it like this for now I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support this change.