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

ApiTest. new tests #5413

Closed
24 tasks done
ScharfViktor opened this issue Jan 16, 2023 · 7 comments
Closed
24 tasks done

ApiTest. new tests #5413

ScharfViktor opened this issue Jan 16, 2023 · 7 comments
Assignees
Labels

Comments

@ScharfViktor
Copy link
Contributor

ScharfViktor commented Jan 16, 2023

Tags:

method PUT /tag

  • add a tag for incoming resources if the user has permission
  • create tag in the incoming share
  • create tag as space member if you have permisiions

method GET /tag

  • user has tag and can find by tag if

  • he created tag

  • he has accepted share with tag

  • he is member of the project space where tag uses

  • he restores resource with tag from trash bin

  • user hasn't tag and cannot find by tag if

  • last tag was deleted from resource

  • last resource with tag was deleted

  • share was declined or removed

method DELETE /tag

  • user can delete tag if
  • he is creator
  • he has share with edit permission
  • he is member of the space with edit permissions

#5391 and #5417

Sharing space to group. Add more corner cases

Expiration date for share

Re-share resource with expiration date

  • [ ]

Expiration date for share space

@SwikritiT
Copy link
Contributor

SwikritiT commented Mar 13, 2023

In the case of checking the end of the expiry date doing it as we did in core with the testing app might not be possible for us in ocis. Previously I completely overlooked the fact that in testing app administrator internally changes the expiration date of a share of the respective user and set the expiration to yesterday.

https://github.com/owncloud/testing/blob/6965caa176d83df8f5111aa64e91c1de34ce48e0/lib/ExpireShare.php#L43
https://github.com/owncloud/testing/blob/6965caa176d83df8f5111aa64e91c1de34ce48e0/lib/ExpireShare.php#L53
https://github.com/owncloud/testing/blob/6965caa176d83df8f5111aa64e91c1de34ce48e0/lib/ExpireShare.php#L76

@ScharfViktor should we go with what you initially mentioned setting the expiration date of 1min and letting that time pass and then checking if the share has expired?

@SwikritiT
Copy link
Contributor

Also, I couldn't determine what should be the format of the expiration date. When I send the curl request with expiration date format 2023-03-23T23:59:59.999+05:45 like sent from the UI
I get

{"ocs":{"meta":{"status":"error","statuscode":400,"message":"could not parse expireDate"}}}

If I just send the date it also gives me

{"ocs":{"meta":{"status":"error","statuscode":400,"message":"could not parse expireDate"}}}

This format works on the tests 2042-01-01T23:59:59+0100 but not with curl or postman.
So what exactly should the format be like?

cc @ScharfViktor

@ScharfViktor
Copy link
Contributor Author

ScharfViktor commented Mar 13, 2023

@ScharfViktor should we go with what you initially mentioned setting the expiration date of 1min and letting that time pass and then checking if the share has expired?

We can, but timing is not good solution. Probably we can create method-helper which will change date to yesterday.

I checked and it works in ocis:

curl --location --request PUT 'https://host.docker.internal:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/shareId' \
--form 'expireDate="2023-02-10T23:59:59.999+01:00"' \
--form 'role="viewer"'

@ScharfViktor
Copy link
Contributor Author

This format works on the tests 2042-01-01T23:59:59+0100 but not with curl or postman. So what exactly should the format be like?

I don't have an answer to that question either. see #5452

@SwikritiT
Copy link
Contributor

@ScharfViktor should we go with what you initially mentioned setting the expiration date of 1min and letting that time pass and then checking if the share has expired?

We can, but timing is not good solution. Probably we can create method-helper which will change date to yesterday.

I checked and it works in ocis:

curl --location --request PUT 'https://host.docker.internal:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/shareId' \
--form 'expireDate="2023-02-10T23:59:59.999+01:00"' \
--form 'role="viewer"'

when I tried to set the date time to yesterday (through tests) , the status code was 200 but the date wasn't changed. but i tried it with the space , I'll try it again and see how it goes.

@SwikritiT
Copy link
Contributor

@ScharfViktor should we go with what you initially mentioned setting the expiration date of 1min and letting that time pass and then checking if the share has expired?

We can, but timing is not good solution. Probably we can create method-helper which will change date to yesterday.

I checked and it works in ocis:

curl --location --request PUT 'https://host.docker.internal:9200/ocs/v1.php/apps/files_sharing/api/v1/shares/shareId' \
--form 'expireDate="2023-02-10T23:59:59.999+01:00"' \
--form 'role="viewer"'

Hi @ScharfViktor yes it works for both resource and space. Maybe I did something wrong previously

@ScharfViktor
Copy link
Contributor Author

closed as complited

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

No branches or pull requests

3 participants