From 78100ed43f4e446c4effd89fe165db92913d631f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Schie=C3=9Fl?= Date: Thu, 9 Aug 2018 11:19:19 +0200 Subject: [PATCH] add `contains, not_contains` --- bsip-0040.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bsip-0040.md b/bsip-0040.md index 8fb7a07..77ba3cc 100644 --- a/bsip-0040.md +++ b/bsip-0040.md @@ -103,6 +103,7 @@ List of possible restrictions are: | `any` | [`list`, `of`, `allowed`, `values`] | stateless | | `none` | [`none`, `of`, `these`, `values`] | stateless | | `lt, le, gt, ge, eq` | `comparative` | stateless | +| `contains, not_contains` | [`list`, `of`, `values`] | stateless | | `limit` | [`max_cumsum`, `interval_in_sec`] | [`current_cumsum`, `interval_began`] | | `limit_monthly` | [`max_cumsum`, `interval_in_months`] | [`current_cumsum`, `interval_began`] | | `attribute_assert` | list of restrictions | stateless | @@ -140,6 +141,11 @@ The different asserts read as: - `ge`: `Argument value` must be greater than or equal to `comparative` - `eq`: `Argument value` must equal to `comparative` +#### `contains, not_contains` +Stateless assert, for `list` type arguments. +- `contains`: The `argument value` must contain all items specified by `data`, but can contain more +- `not_contains`: The `argument value` must NOT contain any of the items specified by `data`, but can contain others + #### `limit` Stateful assert, only `int` type arguments. When the authority is created, `interval_began` is set to `valid_from` from its custom active authority and `max_cumsum` to `0`. Incoming operations are first tried to match all stateless asserts, and if all passes continue with stateful asserts. If `now > interval_began + interval_in_sec`, then set `max_cumsum = 0` and set `interval_began = now`.