Skip to content

Provide client service through interfaces to improve decoupling and testability of client application #56

@bubianchi-criteo

Description

@bubianchi-criteo

Checklist

Describe the problem you'd like to have solved

I'm prototyping an application that leverages this very useful SDK. To develop our unit tests of my application code, I could not easily simulate and mock specific behaviors in particular for error cases because the OpenFgaClient is provided as a class without overridable methods.

Describe the ideal solution

We could improve the SDK extensibility and client application testability by providing features through interfaces, in particular a IOpenFgaClient interface with the public methods implemented by OpenFgaClient.
Moreover the actual construction of the OpenFga client could be managed through a factory pattern, and with its own interface would enable using natively Dependency Injection from AspNet

Alternatives and current workarounds

No response

References

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions