-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
429 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
|
||
export const OPENFGA_YAML_SCHEMA = { | ||
type: "object", | ||
oneOf: [ | ||
{ required: ["model_file"] }, | ||
{ required: ["model"] } | ||
], | ||
properties: { | ||
name: { | ||
type: "string", | ||
description: "The store name" | ||
}, | ||
model_file: { | ||
type: "string", | ||
description: "The Authorization Model" | ||
}, | ||
model: { | ||
type: "string", | ||
description: "The Authorization Model" | ||
}, | ||
tuples: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
user: { | ||
type: "string", | ||
description: "The user" | ||
}, | ||
relation: { | ||
type: "string", | ||
description: "The relation" | ||
}, | ||
object: { | ||
type: "string", | ||
description: "The object" | ||
}, | ||
condition: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
name: { | ||
type: "string", | ||
}, | ||
context: { | ||
type: "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
tests: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
name: { | ||
type: "string", | ||
description: "The test name" | ||
}, | ||
description: { | ||
type: "string", | ||
description: "The test description" | ||
}, | ||
tuples: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
user: { | ||
type: "string", | ||
description: "The user" | ||
}, | ||
relation: { | ||
type: "string", | ||
description: "The relation" | ||
}, | ||
object: { | ||
type: "string", | ||
description: "The object" | ||
}, | ||
context: { | ||
type: "object" | ||
} | ||
} | ||
} | ||
}, | ||
check: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
user: { | ||
type: "string", | ||
description: "The user" | ||
}, | ||
object: { | ||
type: "string", | ||
description: "The object" | ||
}, | ||
assertions: { | ||
type: "object", | ||
patternProperties: { | ||
".*": { | ||
type: "boolean" | ||
} | ||
} | ||
}, | ||
context: { | ||
type: "object" | ||
} | ||
} | ||
} | ||
}, | ||
list_objects: { | ||
type: "array", | ||
items: { | ||
type: "object", | ||
additionalProperties: false, | ||
properties: { | ||
user: { | ||
type: "string", | ||
description: "The user" | ||
}, | ||
relation: { | ||
type: "string", | ||
description: "The relation" | ||
}, | ||
type: { | ||
type: "string", | ||
description: "The object type" | ||
}, | ||
assertions: { | ||
type: "object", | ||
patternProperties: { | ||
".*": { | ||
type: "array", | ||
items: { | ||
type: "string" | ||
} | ||
} | ||
} | ||
}, | ||
context: { | ||
type: "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
required: ["tests"], | ||
additionalProperties: false, | ||
}; |
Oops, something went wrong.