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

docs: Add asserts for example responses #240

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
[![Node GitHub Action](https://github.com/nextcloud/files_downloadlimit/workflows/Node/badge.svg)](https://github.com/nextcloud/files_downloadlimit/actions?query=workflow%3ANode)
[![Lint GitHub Action](https://github.com/nextcloud/files_downloadlimit/workflows/Lint/badge.svg)](https://github.com/nextcloud/files_downloadlimit/actions?query=workflow%3ALint)

This app allows limitng the number of downloads for external link shares.
This app allows limiting the number of downloads for external link shares.

---

## API

The examples below can be run using [hurl](https://github.com/Orange-OpenSource/hurl).

> [!TIP]
> To ignore assertions pass the `--ignore-asserts` flag.

### External share limit

An external share limit may be queried by its token.
Expand All @@ -30,6 +33,11 @@ Accept: application/json

[BasicAuth]
alice: alice

HTTP 200
[Asserts]
jsonpath "$.ocs.data.limit" exists
jsonpath "$.ocs.data.count" exists
```

#### Set
Expand All @@ -51,6 +59,10 @@ alice: alice
{
"limit": {{limit}}
}

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
```

#### Remove
Expand All @@ -68,6 +80,10 @@ Accept: application/json

[BasicAuth]
alice: alice

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
```

### Default limit
Expand All @@ -91,4 +107,8 @@ admin: admin
{
"limit": {{limit}}
}

HTTP 200
[Asserts]
jsonpath "$.ocs.data" isEmpty
```
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Files download limit</name>
<summary>File link share download limit</summary>

<description>This app allows limitng the number of downloads for external link shares.</description>
<description>This app allows limiting the number of downloads for external link shares.</description>
<version>2.0.0</version>
<licence>agpl</licence>
<author mail="skjnldsv@protonmail.com">John Molakvoæ</author>
Expand Down
Loading