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

[Capabilities] Expiration date for public links inconsistent #4445

Closed
michaelstingl opened this issue Aug 23, 2022 · 12 comments · Fixed by #4475
Closed

[Capabilities] Expiration date for public links inconsistent #4445

michaelstingl opened this issue Aug 23, 2022 · 12 comments · Fixed by #4475
Labels

Comments

@michaelstingl
Copy link
Contributor

michaelstingl commented Aug 23, 2022

Describe the bug

oCIS capabilities have "expire_date" > "enabled": true, but no "days": "7", are set. This confuses the 2.11 desktop sync clients.

oCIS

  "expire_date": {
    "enabled": true
  },
curl request + response
% curl 'https://ocis.owncloud.com/ocs/v1.php/cloud/capabilities?format=json' \
-H 'Authorization: Bearer eyJhbGciOiJQUzI1NiIsImtpZCI6InByaXZhdGUta2V5IiwidHlwIjoiSldUIn0.eyJhdWQiOiJ3ZWIiLCJleHAiOjE2NjEzNDk4OTEsImp0aSI6IjQxMEZDdlgyT2JRUWo5VFpKel9DUndJOG0tbHFaZnA4IiwiaWF0IjoxNjYxMjYzNDkxLCJpc3MiOiJodHRwczovL29jaXMub3duY2xvdWQuY29tIiwic3ViIjoiQnpiXzY5Q1hUam9oR1JPTkBYaVlGZ2NITmR1dlFxejA1bXJOUllXdHRzNmJWYWRVM3U1bWZscTBxLUtQbzRRVmlTakJtNHYxeUlpcnE4dWJKNlVvZGdRIiwibGcudCI6IjEiLCJzY3AiOiJvcGVuaWQgcHJvZmlsZSBlbWFpbCIsImxnLmkiOnsiZG4iOiJLYXRoZXJpbmUgSm9obnNvbiIsImlkIjoidWlkPWthdGhlcmluZSxvdT11c2VycyxvPWxpYnJlZ3JhcGgtaWRtIiwidW4iOiJrYXRoZXJpbmUifSwibGcucCI6ImlkZW50aWZpZXItbGRhcCJ9.Lpy5HLmq4K60440EB2b_GCVacSsDfoVuoEGWNWIUkuU0wa59INoKbD-_PjpolXRKGylWjdp16oApnf-6jVhZ289h8dTPBLkO7cHDaEvWwKBBhZ9k8K7m2pKxMJrdNdv5zn2uZP8HsoBtGhjMDeD5zQBnqCDg8aDtIHWYUqOd02xVLEfmfXd1_DN__8ptXEfIiEKrfz4izib12yujQGG1DNJ4oUL6GVXnBTKz3Q_MZP4xf0tge3DsVgz0Wh866MpnsCNMYJU7YcCUdA73mZBbGIlujkAzXfhZUl0F8oN_WunM8jNIWb7iYIyy5SvqaiPCemHxJPb-xJPaVermEVggaCrTHCfPzHq09Hgsg51gpLrnbH1JiQOgOcPj1yAaMGRqZF3jwQGAhNwBPKRqOXpQZ2zSb0vFKGLVZBmCS4e3v850OpfTt9_XJvl1pZPybeHNyfKdKT-pzW8I1KH0twaIGItWyZqeQid3qTxWFmYuTR5CCM0U267oD-23O8Zl0MIvRk4BuYut1Bg4-BaDfVwBs6ax0wNJoQRtMQCq5WNJmXEPmMoZ8tOPxMH1tJfvRVGbEoKe8X8yFUZyK1uNEAW7LSzOTrDE32RHpdThoeAQ37HNxpD9CROIWiBEb-xf5HnmqPZsfg0HClK1ju4Bo7HJqYsccrtc9OUQTjImFkS2_3w' | jq '.ocs.data.capabilities.files_sharing.public'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2088    0  2088    0     0   5913      0 --:--:-- --:--:-- --:--:--  6052
{
  "enabled": true,
  "send_mail": true,
  "social_share": true,
  "upload": true,
  "multiple": true,
  "supports_upload_only": true,
  "password": {
    "enforced_for": {
      "read_only": false,
      "read_write": false,
      "upload_only": false
    },
    "enforced": false
  },
  "expire_date": {
    "enabled": true
  },
  "can_edit": true,
  "alias": false
}

oC10 with expiration date disabled

  "expire_date": {
    "enabled": false
  },
curl request + response
% curl "https://demo.owncloud.org/ocs/v1.php/cloud/capabilities?format=json" -H 'Authorization: Basic dGVzdDp0ZXN0' | jq '.ocs.data.capabilities.files_sharing.public'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2167  100  2167    0     0   3257      0 --:--:-- --:--:-- --:--:--  3273
{
  "enabled": true,
  "password": {
    "enforced_for": {
      "read_only": false,
      "read_write": false,
      "upload_only": false,
      "read_write_delete": false
    },
    "enforced": false
  },
  "roles_api": true,
  "can_create_public_link": true,
  "expire_date": {
    "enabled": false
  },
  "send_mail": false,
  "social_share": true,
  "upload": true,
  "multiple": true,
  "supports_upload_only": true,
  "defaultPublicLinkShareName": "Public link"
}

oC10 with expiration date enabled

  "expire_date": {
    "enabled": true,
    "days": "7",
    "enforced": false
  },
curl request + response
% curl "https://demo.owncloud.org/ocs/v1.php/cloud/capabilities?format=json" -H 'Authorization: Basic dGVzdDp0ZXN0' | jq '.ocs.data.capabilities.files_sharing.public'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2194  100  2194    0     0   6421      0 --:--:-- --:--:-- --:--:--  6529
{
  "enabled": true,
  "password": {
    "enforced_for": {
      "read_only": false,
      "read_write": false,
      "upload_only": false,
      "read_write_delete": false
    },
    "enforced": false
  },
  "roles_api": true,
  "can_create_public_link": true,
  "expire_date": {
    "enabled": true,
    "days": "7",
    "enforced": false
  },
  "send_mail": false,
  "social_share": true,
  "upload": true,
  "multiple": true,
  "supports_upload_only": true,
  "defaultPublicLinkShareName": "Public link"
}

CleanShot 2022-08-23 at 16 26 30

Setup

https://ocis.owncloud.com

ownCloud Web UI 5.7.0-rc.9
Infinite Scale 2.0.0-beta.6 Community

@dragotin FYI

@michl19
Copy link
Contributor

michl19 commented Aug 29, 2022

Missing feature, non relevant for GA. @michaelstingl what#s the impact for the desktop client?

@michaelstingl
Copy link
Contributor Author

@michaelstingl what#s the impact for the desktop client?

It's causing #4380 . I assume it's really minimal effort to improve things for the desktop client.

@kulmann
Copy link
Member

kulmann commented Aug 29, 2022

IMO it would be easier and cleaner to add the expiration to the capabilities instead of building a workaround in the client... isn't it just a matter of adding a hardcoded value to the capabilities?

@michaelstingl
Copy link
Contributor Author

I assume it's hardcoded in the capabilities, but it shouldn't be there. Just remove "expire_date" > "enabled": true for now. Then the desktop client behaves well.

@michl19
Copy link
Contributor

michl19 commented Aug 30, 2022

@pmaier1 could you have another look into it. Looks like a one liner. Thanks

@pmaier1
Copy link
Contributor

pmaier1 commented Aug 30, 2022

Ahh, so this is not about the default expiration date feature but only about capabilities. Then this is good to go, of course.

@kulmann
Copy link
Member

kulmann commented Aug 30, 2022

Ahh, so this is not about the default expiration date feature but only about capabilities. Then this is good to go, of course.

To my understanding the default expiration date handling only ever happens in the clients anyway. The backend always expects either no expiration or an actual expiration date.

@kulmann
Copy link
Member

kulmann commented Aug 30, 2022

  • public link expiration in ocis is already implemented since forever. No issues with that.

@pmaier1
Copy link
Contributor

pmaier1 commented Aug 30, 2022

public link expiration in ocis is already implemented since forever. No issues with that.

In oC10, as an admin you can set a default expiration date and you can enforce that, so that users cannot exceed it and have to set it. That's not available in oCIS currently. I thought the question here is about those.

@kulmann
Copy link
Member

kulmann commented Aug 30, 2022

Ah ok. Indeed, the issue was never about enforcing the expiration. Only about the default amount of days (for clients to determine the default expiration date upon creation of the public link).

@pmaier1
Copy link
Contributor

pmaier1 commented Aug 30, 2022

Yeah, and there is no default for that in oCIS currently afaik.

@kulmann
Copy link
Member

kulmann commented Aug 30, 2022

Providing a default for clients in the capabilities should have been sufficient for that. As far as I understood there is no handling of default expiration days needed in the backend (might be wrong). But disabling the default expiration is the safe bet. That's being done in #4475 now

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

Successfully merging a pull request may close this issue.

4 participants