ipfs / pinning-services-api-spec

Standalone, vendor-agnostic Pinning Service API for IPFS ecosystem
https://ipfs.github.io/pinning-services-api-spec/
Creative Commons Zero v1.0 Universal
100 stars 27 forks source link

Pin.name #45

Closed obo20 closed 3 years ago

obo20 commented 3 years ago

Something we realized early on is that many users wanted a custom "name" associated with their CIDs. While we could have accomplished this by reading through the metadata that users passed to us (and this is something we initially did), users were finding themselves confused by how this behavior worked. Once we switched name to being its own custom parameter that was separate from keyvalues we started seeing users pass in this attribute with nearly every request.

Is there interest in possibly adding a name parameter that users can pass in with their CIDs?

lidel commented 3 years ago

The proposal here is to promote Pin.meta[name] to Pin.name AND add name filter.

While one can use Pin.meta[name] and query via ?meta={name:foo}, I see how this could improve devexp and even UX by introducing more strict standard for petnaming pins. I'm mildly in favor of this, but would like to hear opinion from @ipfs/wg-pinning-services and other stakeholders.

Qs:

obo20 commented 3 years ago

Should name filter work as exact or partial match?

Our strategy here is to do a partial match since it simply gives the user more flexibility when querying

jacobheun commented 3 years ago

This change seems reasonable to me.

What would be the sensible length limit for Pin.name string?

Do we have any prior art for the cap here on the pinning services today? Promoting this makes it reasonable to cap, but we should avoid issues with preexisting names.

Should we apply same limit to keys/values in meta fields?

I think we should avoid this and allow the services to set these. If we prematurely cap these lengths it could create issues if larger max values are later needed.

obo20 commented 3 years ago

If it helps, our max length for the name is 255 characters (chosen primarily for performance optimizations)

andrew commented 3 years ago

@obo20 out of interest, is your partial matching case sensitive?

obo20 commented 3 years ago

@andrew ours is not

lidel commented 3 years ago

@obo20 @andrew Is this something we should include in the spec, under description of name filter?

obo20 commented 3 years ago

@lidel it's probably best to have an opinion in the spec one way or the other here. Just so behavior is consistent across implementers