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

feat: Initial OpenFgaClientConfig #12

Merged
merged 10 commits into from
Mar 6, 2024
Merged

feat: Initial OpenFgaClientConfig #12

merged 10 commits into from
Mar 6, 2024

Conversation

jimmyjames
Copy link
Collaborator

@jimmyjames jimmyjames commented Mar 5, 2024

Initial support for autoconfiguration of an OpenFgaClient.

Description

Creates an openFgaClient bean from configuration.

Not all configurations available via Configuration are added in this PR (e.g., maxRetries, timeouts). We can capture another issue to see what other configurations should be surfaced here.

I also added some very brief info to the README; obviously will need more work, but wanted to capture some of the details.

Some details about how the OpenFgaClient is configured given property values:

  • If no credentials properties are specified, no credentials (no authorization) is configured for the client
  • If a credentials.api-token property is specified, that (and only that) will be used to configure the client
  • If other credentials properties are specifed, they will be used to configure the client

Closes #2

References

https://github.com/openfga/java-sdk/tree/main?tab=readme-ov-file#initializing-the-api-client

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@jimmyjames jimmyjames marked this pull request as ready for review March 5, 2024 01:06
@jimmyjames jimmyjames requested a review from a team March 5, 2024 02:09
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jimmyjames jimmyjames requested a review from rhamzeh March 6, 2024 16:54
@rhamzeh
Copy link
Member

rhamzeh commented Mar 6, 2024

Q: We are copying the enum and validation here, any chance we can reuse what's in the SDK?

@jimmyjames jimmyjames added this pull request to the merge queue Mar 6, 2024
Merged via the queue into main with commit 64f69ff Mar 6, 2024
4 checks passed
@jimmyjames jimmyjames deleted the autoconfig branch March 6, 2024 17:35
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide OpenFgaClient auto configuration
2 participants