-
Notifications
You must be signed in to change notification settings - Fork 43
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(java): Initialize Java SDK #158
Conversation
f1cf146
to
9b18af8
Compare
config/clients/java/template/Java/gradle-wrapper.properties.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/build.gradle.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/build.gradle.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/build.gradle.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/README_license_disclaimer.mustache
Outdated
Show resolved
Hide resolved
e0e1c41
to
a4a0228
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the top level files are repeated under native
config/clients/java/template/Java/libraries/native/README.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/api.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/apiException.mustache
Outdated
Show resolved
Hide resolved
config/clients/java/template/Java/libraries/native/api_doc.mustache
Outdated
Show resolved
Hide resolved
6f9804d
to
73563af
Compare
35a1c62
to
9792022
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the SDK namespace to dev.openfga.sdk
? in the future we may want to publish other packages under the dev.openfga
namespace
58a317c
to
4e5faaa
Compare
Closes #169 From #170 * chore(java): Update to JUnit 5 * test(java): Move generated OpenFgaApiTest to a template * test(java): Unit test the Check API, introduce Mockito, update javadocs * test(java): Add unhappy case tests * test(java): Flesh out first test on check * clean(java): Remove lengthy javadoc descriptions in unit tests * test(java): Add HTTP mocks and verifications * test(java): Flesh out all unit tests and mocks * clean(java): Remove now-unused api_test.mustache * clean(java): Only configure tests with jvm-test-suite semantics * clean(java): Re-order tests to follow other test suites and order of https://openfga.dev/api/service * clean(java): Refactor tests for brevity and clarity * test(java): Flesh out write API with writes/deletes * test(java): Flesh out expand test, minor refactors * test(java): Add tests on all 400/404/500s, Update status codes on some create/delete tests
Adds Configuration for the SDK. This also includes a StringUtil utility class, and basic credentials modeling (but not handling yet) Closes #154 Details can be found in #173 * feat(java): Introduce a Configuration class * fix(java): Assert deletion by Store ID instead of name for local dev * fix(java): Update integ tests for Configuration change * misc(java): Minor refactors to Configuration * misc(java): Move Configuration class out of ApiClient * refactor(java): Make interface of Configuration more similar to generated models * feat(java): Add isValid() to Configuration * misc(java): Make an errors package path * docs(java): Note in javadocs that Configuration will take precedence over HttpClient settings * refactor(java): Make Configuration an interface, BasicConfiguration an implementation, other updates * refactor(java): Rename Configuration types * feat(java): Add some Credentials types * refactor(java): Rename Configuration template files with config- prefix * refactor(java): Move isNullOrWhitespace out of Configuration * feat(java): Add assertValid() to ClientCredentials * misc(java): Update filenames of "util" classes * Update config/clients/java/template/config-Configuration.java.mustache * Co-authored-by: Raghd Hamzeh <raghd.hamzeh@auth0.com> * Update config/clients/java/template/config-Configuration.java.mustache * Co-authored-by: Raghd Hamzeh <raghd.hamzeh@auth0.com> * feat(java): Add default for API URL when its null/empty/whitespace --------- Co-authored-by: Raghd Hamzeh <raghd.hamzeh@auth0.com>
* refactor(java): Thread Configuration through request builders * refactor(java): Thread Configuration through requests * feat(java): Introduce ConfigurationOverride class * test(java): Add tests on ConfigurationOverride * refactor(java): Consistent code in Configuration.override(...)
- Add Java 20 to CI - Use exact hashes for CI actions - Fix broken link for models in README - Fix artifact version in build.gradle and elsewhere - Git ignore some files --------- Co-authored-by: Raghd Hamzeh <raghd.hamzeh@auth0.com>
* refactor(java): Remove all @generated annotations * refactor(java): Remove unused JSON.java * refactor(java): Move configuration types to dev.openfga.sdk.api.configuration
3547c9c
to
695a622
Compare
* refactor(java): Move error and util classes around * refactor(java): Remove an unused date format class * refactor(java): Move auth classes to their own space * refactor(java): Move ApiException creation function to a constructor * feat(java): Introduce OAuth2Client * refactor(java): Use more mustache values for Java package paths * refactor(java): Rename misc classes and variable names * test(java): Add basic happy-path test on OAuth2Client * refactor(java): Move some credentials packages to 'configuration' package * refactor(java): Add Credentials to Configuration * refactor(java): Add OAuth2Client to OpenFgaApi * refactor(java): Assert valid credentials when asserting valid configuration * feat(java): Put OAuth2 header on requests * feat(java): Allow credentials in Configuration to be overridden
ae78930
to
70bbda1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the scripts/build_client.sh
, please add to line 33: |.gradle
So that it becomes:
cd "${CLIENTS_OUTPUT_DIR}/fga-${SDK_LANGUAGE}-sdk" && ls -A | grep -Ev '.git|node_modules|.idea|venv|.gradle' | xargs rm -r && cd -
} | ||
|
||
group = '{{groupId}}' | ||
version = '{{artifactVersion}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packageVersion and drop from overrides
"modelPackage": "dev.openfga.sdk.api.model", | ||
"snapshotVersion": false, | ||
"packageDescription": "Java SDK for OpenFGA", | ||
"artifactDescription": "Java SDK for OpenFGA", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop
"packageName": "dev.openfga:openfga-sdk", | ||
"artifactId": "openfga-sdk", | ||
"groupId": "dev.openfga", | ||
"artifactVersion": "0.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop
Introduces a Java SDK generated with
make setup-new-sdk
Description
References
Closes #152
Closes #157
Review Checklist
main