I'm looking for a notation that is familiar to modern developers and can supersede s-Notation. (additional insight into Rivest's proposal of s-Expression is here)
Is there any Swagger, JSON or other notation that is very intuitive for ACL control?
I'm looking for a notation that is familiar to modern developers and can supersede s-Notation. (additional insight into Rivest's proposal of s-Expression is here)
Is there any Swagger, JSON or other notation that is very intuitive for ACL control?
There is a JSON schema for state machines in the SJOT project:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/0",
"definitions": {
"0": {
"type": "object",
"properties": {
"a": { "$ref": "#/definitions/1" },
"x": { "type": "boolean" }
},
"additionalProperties": false
},
"<DEF>": {
"type": "object",
"properties": {
"a": { "$ref": "#/definitions/<DEF>+1" },
"b": {
"anyOf": [
{ "$ref": "#/definitions/0" },
{ "$ref": "#/definitions/<DEF>" }
]
}
},
"additionalProperties": false
},
The JSON Schema has
N
definitions. The "words" we validate with the schema are defined by the regular expression(a{N}|a(a|b+){0,N-1}b)*x
that describes a sequence ofa
andb
ending inx
. The wordabbx
is represented by the JSON pointera/b/b/x
which is{"a":{"b":{"b":{"x":true}}}}
.Then we add
N-1
definitions<DEF>
to the schema enumerated"1", "2", "3", ... "N-1"
where"<DEF>+1"
wraps back to"0"
when<DEF>
is equal toN-1
.This
"NFA"
on a two-letter alphabet hasN
states, only one initial and one final state. Its equivalent minimal DFA has2^N
(2 to the power N) states.In the worst case, a validator that uses this JSON schema either takes
2^N
time or uses2^N
memory "cells" to validate the input.
References