-
Notifications
You must be signed in to change notification settings - Fork 302
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
Support creating a Container using PUT #1465
Comments
This is the new spec. Does it support also creation of missing containers with PUT ? |
If you mean "would the workaround of creating a dummy file inside the Container and then deleting it again" still work, then yes:
And yes, that's what I'm currently doing for NSS specifically. This issue is linked from a comment there so I know when I can remove that code :) |
No, I was meaning : if the container URI contains missing container do you create the container and all missing ones or do you return an error. |
@Vinnl The requirement you've originally quoted in this issue is in context of NSS doesn't currently support PUT to create a container - only as side-effect when creating a non-container resource. Background/proposal to support creating containers with PUT: #1108 and #513 Spec going forward clarifies slash semantics and hierarchical containment, PUT /path/to/container/ will create all required intermediate containers. Client doesn't need include the Link header with a valid LDP container type for PUT. Server is not expected to observe it. |
@csarven So if I read correctly your comment : Why the new spec does not state that PUT to a container URI (ending with /) is not allowed and should return error (405 or 400) ? |
@bourgeoa Can you please rephrase your question or comment? It would be great if NSS can accept requests with PUT to create a container, as well as intermediate containers if they don't exist. Note slash semantics requirement:
NSS may also do the following:
|
Unfortunately it does not support the spec-supported method of creating a Container: nodeSolidServer/node-solid-server#1465 As a workaround, we create a dummy file within the Container we want to create, which should lead to the server creating the Container on the fly. The dummy file is then immediately deleted again. Although this method theoretically works for other servers as well, it is a bit cumbersome and more error-prone due to the multiple consecutive requests. Therefore I decided to use it specifically when we detect NSS's message about not supporting the spec-prescribed method of creating a Container, so that it can be easily removed wholesale once NSS is no longer a problem, and the implementation does not surprise other contributors.
@csarven I know and understand building spec is difficult. |
Unfortunately it does not support the spec-supported method of creating a Container: nodeSolidServer/node-solid-server#1465 As a workaround, we create a dummy file within the Container we want to create, which should lead to the server creating the Container on the fly. The dummy file is then immediately deleted again. Although this method theoretically works for other servers as well, it is a bit cumbersome and more error-prone due to the multiple consecutive requests. Therefore I decided to use it specifically when we detect NSS's message about not supporting the spec-prescribed method of creating a Container, so that it can be easily removed wholesale once NSS is no longer a problem, and the implementation does not surprise other contributors.
Unfortunately it does not support the spec-supported method of creating a Container: nodeSolidServer/node-solid-server#1465 As a workaround, we create a dummy file within the Container we want to create, which should lead to the server creating the Container on the fly. The dummy file is then immediately deleted again. Although this method theoretically works for other servers as well, it is a bit cumbersome and more error-prone due to the multiple consecutive requests. Therefore I decided to use it specifically when we detect NSS's message about not supporting the spec-prescribed method of creating a Container, so that it can be easily removed wholesale once NSS is no longer a problem, and the implementation does not surprise other contributors.
@bourgeoa Why would I rephrase your comment? I asked you to rephrase what you wrote because it is not at all clear if you are asking a question or making a comment. What I wrote was entirely about the state of NSS and the direction it can take based on the upcoming spec. If there is anything that's unclear in the spec, please quote the part that we can clarify or help with with respect to NSS. Like I said: NSS should support PUT to create container - we've known for years that it doesn't - however, going forward, if it can't or even for any specific container (for any reason), it is within its right. |
@csarven
Sorry if I miss something. Reading spec are really difficult because container is a resource. May I suggest to clarify with |
Unfortunately it does not support the spec-supported method of creating a Container: nodeSolidServer/node-solid-server#1465 As a workaround, we create a dummy file within the Container we want to create, which should lead to the server creating the Container on the fly. The dummy file is then immediately deleted again. Although this method theoretically works for other servers as well, it is a bit cumbersome and more error-prone due to the multiple consecutive requests. Therefore I decided to use it specifically when we detect NSS's message about not supporting the spec-prescribed method of creating a Container, so that it can be easily removed wholesale once NSS is no longer a problem, and the implementation does not surprise other contributors.
@bourgeoa I think the spec is now very clear on all matters talked about above: https://solidproject.org/TR/protocol#writing-resources
Might be worth looking into whether we can make NSS support PUT for Containers, that way we can clean up some code that's only used when talking with NSS instances (I'm assuming it'd be as simple as adding a (note: this isn't a high priority from the DevTools Team side at Inrupt, I just was going through our code, noticed the comment and was curious as to if it still held true, hence now commenting. |
But maybe this was actually closed by the work in #1557 — I'm not sure? |
Yes it was closed with #1557 |
Wonderful! |
According to the Solid spec:
However, when I send a
PUT
request to a Container URL with a Link header<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
, NSS responds with:The text was updated successfully, but these errors were encountered: