-
Notifications
You must be signed in to change notification settings - Fork 17
adds support for mongo-oidc #32
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
base: master
Are you sure you want to change the base?
Conversation
6547c1b to
e189b0f
Compare
IlyaEp
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.
Thanks for contributing! I’ll have another look after we address or discuss the current issues
| for (String browser : browsers) { | ||
| try { | ||
| // Check if browser exists | ||
| Process process = runtime.exec(new String[] {"which", browser}); |
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 use desktop actions?
| * jdbc:mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] | ||
| * The URL excepting the jdbc: prefix is passed as it is to the MongoDb native Java driver. | ||
| */ | ||
| public class MongoJdbcDriver implements Driver { |
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.
The changes are hard to read because the diff includes unnecessary style edits (formatting, etc.). Please remove them or split the commits so that only the actual logic changes are visible
| */ | ||
| public String getDriverVersion() { | ||
| return "1.20"; | ||
| return "1.30"; |
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.
Do not update driver version
| shadowJar { | ||
| archiveFileName = "mongo-jdbc-standalone-${version}.jar" | ||
| mergeServiceFiles() | ||
| relocate 'com.nimbusds', 'shadow.com.nimbusds' |
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.
Please describe the purpose of this change
| ShellHolder shellHolder = this.shellHolder; | ||
| this.shellHolder = createShellHolder(); | ||
|
|
||
| var existingResult = Optional.ofNullable(this.mongoConnection) |
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.
We don't use "var"
| public void start() throws IOException { | ||
| server = HttpServer.create(new InetSocketAddress(DEFAULT_REDIRECT_PORT), 0); | ||
|
|
||
| server.createContext("/callback", new CallbackHandler()); |
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.
You created a constant for '/accepted', but not for '/callback'. Why?
|
|
||
| import com.sun.net.httpserver.HttpExchange; | ||
| import com.sun.net.httpserver.HttpHandler; | ||
| import com.sun.net.httpserver.HttpServer; |
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 at least use Netty?
| } | ||
|
|
||
| public OidcResponse getOidcResponse() throws InterruptedException, OidcTimeoutException { | ||
| return getOidcResponse(Duration.ofSeconds(300)); |
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.
Magic number
| private @Nullable ExecutorService executorService; | ||
| private @Nullable Engine sharedEngine; | ||
| private @NotNull ShellHolder shellHolder; | ||
| private MongoConnection mongoConnection; |
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.
Do not cache the DB connection. If you need to cache the token, cache that instead
| return null; | ||
| } | ||
|
|
||
| Server server = new Server(); |
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.
Is it possible to bind the server lifecycle to the driver and initialize it lazily?
No description provided.