Skip to content

Utilize batchCheck within listRelations #336

@evanmay

Description

@evanmay

Please do not report security vulnerabilities here. See the Responsible Disclosure Program.

Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible.

By submitting an issue to this repository, you agree to the terms within the OpenFGA Code of Conduct.

Describe the problem you'd like to have solved

listRelations uses clientBatchCheck to evaluate the relations passed in. With the addition of batchCheck, this is not the most efficient way to query the OpenFGA server.

Describe the ideal solution

Follow the pattern established with clientBatchCheck and batchCheck

  • Rename the existing listRelations to clientListRelations
  • Add new listRelations method that uses batchCheck

Alternatives and current workarounds

Alternative:

  • add a boolean flag to listRelations for useServerBatchCheck defaulted to false. Nonbreaking change, but does not follow precedent and boolean parameters for functions is generally an anti-pattern.

Workaround: Do not use listRelations and instead call batchCheck directly from code, then map the results to return the same format.

Additional context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions