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

feat(CloudFederationApi): Start implementation of 1.1.0 of OCM spec #47199

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mickenordin
Copy link
Contributor

@mickenordin mickenordin commented Aug 13, 2024

Summary

This is a VIP implementation of OCM 1.1.0

https://cs3org.github.io/OCM-API/docs.html?branch=v1.1.0&repo=OCM-API&user=cs3org

Notes

TODO

@mickenordin mickenordin marked this pull request as draft August 13, 2024 13:47
@mickenordin
Copy link
Contributor Author

mickenordin commented Aug 13, 2024

If someone wants to join the fun, I can add them to the SUNET repo on request.

Ping @ArtificialOwl and @provokateurin 😄

@provokateurin
Copy link
Member

Nice to see someone starting to implement it. Given the PR cs3org/OCM-API#89 it seems like a v1.2 implementation will be necessary too in the near future. Do you think it makes sense to tackle them both at once or at least in series? Otherwise Nextcloud will continue to lack support for the latest version :/

@provokateurin
Copy link
Member

The openapi.json is generated from our source code and should not be overwritten by the real specification (CI will fail). In this case though it's a nice tool to verify that the specs match.

@mickenordin
Copy link
Contributor Author

The openapi.json is generated from our source code and should not be overwritten by the real specification (CI will fail). In this case though it's a nice tool to verify that the specs match.

Ooops. will revert that.

@mickenordin
Copy link
Contributor Author

Nice to see someone starting to implement it. Given the PR cs3org/OCM-API#89 it seems like a v1.2 implementation will be necessary too in the near future. Do you think it makes sense to tackle them both at once or at least in series? Otherwise Nextcloud will continue to lack support for the latest version :/

I think it makes sense to do 1.1 first. It will be easier to do 1.2 in direct succession to that.

@mickenordin
Copy link
Contributor Author

mickenordin commented Aug 14, 2024

By diffing the 1.0.0 version of the spec and the 1.1.0 version, this is what we can find:

/ocm-provider endpoint is new (nextcloud has that)
/shares has sender as a new required property
/shares shareType now have a defined enum of types, user, group and federation
/shares has expiration as new optional property
/shares protocol now enumerates the supported choices webdav, webapp and datatx
/shares protocol also  has a new format:
(note: the keys 'singleProtocolLegacy, singleProtocolNew and multiProtocol' are not actual keys, but different examples)
"protocol": {

    "singleProtocolLegacy": 

{

    "name": "webdav",
    "options": 

    {
        "sharedSecret": "hfiuhworzwnur98d3wjiwhr",
        "permissions": "some permissions scheme"
    }

},
"singleProtocolNew": 
{

    "name": "webdav",
    "options": 

{

    "sharedSecret": "hfiuhworzwnur98d3wjiwhr"

},
"webdav": 
{

    "sharedSecret": "hfiuhworzwnur98d3wjiwhr",
    "permissions": 

        [
            "read"
        ],
        "uri": "https://open-cloud-mesh.org/remote.php/webdav/share-secret/path/to/resource.txt"
    }

},
"multipleProtocols": 
{

    "name": "multi",
    "options": null,
    "webdav": 

{

    "permissions": 

    [
        "read"
    ],
    "uri": "https://open-cloud-mesh.org/remote.php/webdav/share-secret/path/to/resource.txt"

},
"webapp": 
{

    "uriTemplate": "[https://open-cloud-mesh.org/s/share-hash/{relative-path-to-shared-resource}](https://open-cloud-mesh.org/s/share-hash/%7Brelative-path-to-shared-resource%7D)",
    "viewMode": "read"

},
"datatx": 

    {
        "srcUri": "https://open-cloud-mesh.org/remote.php/webdav/share-secret/path/to/resource.txt",
        "size": 100000
    }

}

vs the old:

"protocol": {

    "name": "webdav",
    "options": 

    {
        "sharedSecret": "hfiuhworzwnur98d3wjiwhr",
        "permissions": "{http://open-cloud-mesh.org/ns}share-permissions"
    }

}

/invite-accepted is added to support the invitation workflow

@mickenordin
Copy link
Contributor Author

@provokateurin do you think we can ha a ocm room/chat at cloud.nextcloud.com's talk instance?

It would be good if we could chat about things, as there comes up questions when you start to look at the code :)

@provokateurin
Copy link
Member

I think https://cloud.nextcloud.com/call/4606076295 already fits, then others can easily join the conversation as well.

@mickenordin
Copy link
Contributor Author

I think https://cloud.nextcloud.com/call/4606076295 already fits, then others can easily join the conversation as well.

Also, we have a Matrix room for the OCM working group at: https://matrix.to/#/%23cs3org_OCM%3Agitter.im?via=gitter.im&via=matrix.org&via=matrix.datenschmutz.space&via=hu-berlin.de

This patchset also updates ICloudFederationFactory and ICloudFedarationShare
to accomdate the new format of a share. This should be backwards compatible.

Signed-off-by: Micke Nordin <[email protected]>
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@mickenordin
Copy link
Contributor Author

Seems to me notifications were allready compliant with 1.1, development version of the spec is more strict on notification types, but it is not released yet.

@michielbdejong
Copy link
Contributor

Deprecate access to shares using token in url

Unlike Reva which used to put the shareSecret in the url path or query, I think what the WebDAV API currently does is accept the sharedSecret as the username in http basic auth. So in a sense it's in the url, but on the wire it will look like an Authorization: Basic ... header, right?

@mickenordin
Copy link
Contributor Author

Deprecate access to shares using token in url

Unlike Reva which used to put the shareSecret in the url path or query, I think what the WebDAV API currently does is accept the sharedSecret as the username in http basic auth. So in a sense it's in the url, but on the wire it will look like an Authorization: Basic ... header, right?

Do you know @ArtificialOwl ? If that is the case, it should be ok for 1.1 and we switch to shortlived bearer token in 1.2 then.

@michielbdejong
Copy link
Contributor

Should we merge #45979 into this so that @MahdiBaghbani and @shokri-navid can start working on the tests for the use of http signatures in OCM?

@mickenordin
Copy link
Contributor Author

mickenordin commented Sep 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement OCM v1.1
3 participants