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

fix: remove excluded user field from list_users #258

Merged
merged 1 commit into from
Jun 18, 2024
Merged
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
15 changes: 0 additions & 15 deletions server/src/openfga-yaml-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@

type CheckTest = Omit<CheckRequestTupleKey, "relation"> & {
assertions: Record<string, boolean>;
context: Record<string, any>;

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

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
};

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

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

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
};

type ListUsersTest = Omit<ListUsersRequest, "relation" | "user_filters"> & {
object: string;
user_filter: Record<string, any>;

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

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
assertions: Record<string, any>;

Check warning on line 43 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 };
Expand Down Expand Up @@ -108,7 +108,7 @@
const nonMatchingRelationType = (relation: string, user: string, values: string[], instancePath: string) => {
if (values.length) {
return invalidStore(
`\`${relation}\` is not a relation on \`${user}\`, and does not exist in model - valid relations are [${values}].`,

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

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 121. Maximum allowed is 120
instancePath,
);
}
Expand All @@ -129,7 +129,7 @@
const undefinedTypeTuple = (user: string, instancePath: string) => {
return {
keyword: "valid_store_warning",
message: `${user} does not match any existing tuples; the check is still valid - but double check to ensure this is intended.`,

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

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 131. Maximum allowed is 120
instancePath,
};
};
Expand Down Expand Up @@ -412,7 +412,7 @@
function validateAssertionField(
model: AuthorizationModel,
typeField: string,
assertions: Record<string, any>,

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

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
instancePath: string,
) {
const errors = [];
Expand Down Expand Up @@ -601,14 +601,6 @@
}
}
}

if (listUsers.assertions[assertion].excluded_users) {
for (const excludedUser of listUsers.assertions[assertion].excluded_users) {
if (!tuples.some((tuple) => tuple.user === excludedUser)) {
errors.push(undefinedTypeTuple(excludedUser, instancePath + `/assertions/${assertion}/excluded_users`));
}
}
}
}
}
}
Expand Down Expand Up @@ -993,13 +985,6 @@
format: "user",
},
},
excluded_users: {
type: "array",
items: {
type: "string",
format: "user",
},
},
},
},
},
Expand Down
Loading