-
Notifications
You must be signed in to change notification settings - Fork 0
add login with 'remember me' option by storing data in $home/.tiledb/cloud.json #8
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
add login with 'remember me' option by storing data in $home/.tiledb/cloud.json #8
Conversation
|
This pull request has been linked to Shortcut Story #22111: Support cloud config file.. |
.openapi-generator-ignore
Outdated
| settings.gradle | ||
|
|
||
| #the api client contains the custom code for static initialization from the json file | ||
| src/main/java/io/tiledb/cloud/rest_api/ApiClient.java |
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.
I don't think we should override generated classes. Can we take the approach we had in TileDB-Cloud-Py in that we create higher level classes that wrap the generated API?
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.
Created the TileDBClient class to wrap the autogenerated one
Shelnutt2
left a comment
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.
Great work! One question then lgtm.
| @@ -0,0 +1,73 @@ | |||
| package io.tiledb.cloud.rest_api; | |||
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.
Should we move this up a level so we keep autogenerated in a separate package?
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.
Done!
This PR enables TileDB-Cloud-Java to use
$home/.tiledb/cloud.jsonto store login information.To achieve that I created a new Login class. This class is used the first time someone wants to login. This Login class takes as input all credentials and server settings required and has two additional options.
RememberMe: if true, it will store the credentials in$home/.tiledb/cloud.jsonfor future use.OverwritePrevious: If true, it will favor the new input credentials over the saved ones. In combination withRememberMeit can be used to overwrite the data in$home/.tiledb/cloud.jsonIn Addition I created the TileDBClient class to wrap the ApiClient class, similarly to what we do in python and R to avoid modifying auto-generated classes.
Loading the credentials is done by statically initiallizing the
TileDBClientclass.Note: See updated example file for details.