Skip to content

Commit

Permalink
feat: list_users
Browse files Browse the repository at this point in the history
  • Loading branch information
d-jeffery committed Apr 30, 2024
1 parent db4cdb7 commit cf0540d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
10 changes: 5 additions & 5 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/openfga/vscode-ext"
},
"dependencies": {
"@openfga/sdk": "^0.3.5",
"@openfga/sdk": "^0.4.0",
"@openfga/syntax-transformer": "^0.2.0-beta.17",
"ajv": "^8.12.0",
"vscode-languageserver": "^9.0.1",
Expand Down
44 changes: 44 additions & 0 deletions server/src/openfga-yaml-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
CheckRequestTupleKey,
Condition,
ListObjectsRequest,
ListUsersRequest,
RelationReference,
TupleKey,
TypeDefinition,
Expand All @@ -24,6 +25,7 @@ type Test = {
tuples: TupleKey[];
check: CheckTest[];
list_objects: ListObjectTest[];
list_users: ListUsersTest[];
};

type CheckTest = Omit<CheckRequestTupleKey, "relation"> & {
Expand All @@ -35,6 +37,10 @@ type ListObjectTest = Omit<ListObjectsRequest, "relation"> & {
assertions: Record<string, boolean>;
};

type ListUsersTest = Omit<ListUsersRequest, "relation"> & {
assertions: Record<string, any>;

Check warning on line 41 in server/src/openfga-yaml-schema.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
};

type BaseError = { keyword: string; message: string; instancePath: string };

// Errors for tuples validation
Expand Down Expand Up @@ -835,6 +841,44 @@ const OPENFGA_YAML_SCHEMA: Schema = {
},
},
},
list_users: {
type: "array",
items: {
type: "object",
additionalProperties: false,
properties: {
object: {
type: "string",
format: "object",
},
user_filter: {
type: "array",
items: {
type: "object",
},
},
context: {
type: "object",
},
assertions: {
type: "object",
patternProperties: {
".*": {
type: "object",
patternProperties: {
".*": {
type: "array",
items: {
type: "string",
},
},
},
},
},
},
},
},
},
},
},
},
Expand Down

0 comments on commit cf0540d

Please sign in to comment.