- From: Michael Jones <michael_b_jones@hotmail.com>
- Date: Thu, 9 Jan 2025 16:42:27 +0000
- To: Rahul Gupta <cxres=40protonmail.com@dmarc.ietf.org>, "media-types@ietf.org" <media-types@ietf.org>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
- Message-ID: <PH7PR02MB929213E6C3DBA3C03E7EDC3EB7132@PH7PR02MB9292.namprd02.prod.outlook.com>
For the record, I find Media Types as they exist extremely useful. They enhance the usability and security of the Internet by providing a widely-deployed typing mechanism for data structures. Note that media types are used in many contexts, including: * HTTP Content-Type Headers * JWT "typ" and "cty" values * CWT "typ" and "cty" values They increase the security of JWTs by preventing cross-JWT confusion, as described at https://datatracker.ietf.org/doc/html/rfc8725#name-use-explicit-typing. Yes, they declare that the content is of a specific type. I view that as a feature - not a bug. For what it's worth... -- Mike From: Rahul Gupta <cxres=40protonmail.com@dmarc.ietf.org> Sent: Tuesday, January 7, 2025 3:22 AM To: media-types@ietf.org; ietf-http-wg@w3.org Subject: [media-types] Rethinking Media Types Fellow Media Type Enthusiasts, As someone working on malleable software, I have felt for sometime that the monolithic nature of media-types makes them a cumbersome and possibly inadequate mechanism for communicating data formats. The "animated" discussions and the "consensus by exhaustion" on the suffixes draft, I find, are mere symptoms of this fundamental issue. At the very least, I find media-types are inadequate along two dimensions: * Composability: A complex format might be constructed from simpler formats. (This is separate from composite media-types like multipart which are intended for enclosing multiple representations in a single message, although composite media-types can be a possible mechanism for composition of a single representation that built out of multiple media-types). * Specificity: The contained data is described by progression in specificity of formats intended for some specific purpose. There is certainly interplay between the dimensions. Case in point is the recent intention of W3C Verifiable Credentials WG to register, for example, `application/vc+sd-jwt` where a Verified Credential is augmented with Selective Disclosures, which are together packaged in a JSON Web Token format. The use of "+" and "-", even if standardized by convention, seems a really strange way to communicate this information. Or the recent request by 3GPP for 32 media-type registrations...yikes! Media-types were designed with the expectation that clients already have applications installed (or are able to download them) to read a specific (set of) media-types. Malleable software defy this expectation, with the "application" is constructed on the fly, with the ability to compose components that might process data in different formats. Conceivably, during content-negotiation a client can advertise its capabilities/intent (instead of requesting a specific content-type), and the server can construct a representation with metadata about its composition/specificity or even a recipe to deconstruct it. This should preserve REST constraints. There are perhaps other ways to solve this problem with the existing infrastructure, but none I know of are satisfactory. One method might be to split up the resource across multiple URLs (with link relations or similar), but the integrity of data is lost, and it also creates an unnecessarily chatty API. The ways in which representations might be combined is still limited. The proposed QUERY method might be another way, but the response is still constrained to one format. A few years ago, Filippos Vasilakis had proposed a solution for composable media-types, which he calls Introspective REST. + <https://github.com/vasilakisfil/Introspected-REST> (Read Section 9 onwards) + <https://www.youtube.com/watch?v=pc8ZyFjJY4A> This thesis introduces the concept of micro-types, partial descriptions of formats that can be combined to construct the media-type of a resource. I even contacted Filippos (about the same period last year), but his (unreasonable) expectation was that IETF would approach him instead. While the proposal does not adequately resolve all the deficiencies of media-types, I think micro-types is certainly an interesting starting point for discussion. I believe that solving for composability and specificity with actually lead to fewer and simpler media-type being registered going forward. It will also be a better story for evolvability. Media-types can be progressively enhanced without breaking existing clients. Vendors will be able to introduce changes to formats most of the time without re-registration. I am not prejudiced to a solution. But thinking of ways we can move away from the status-quo of monolithic media-types is worth consideration. Looking forward to your feedback, BR/Rahul
Received on Thursday, 9 January 2025 16:42:33 UTC