-
Notifications
You must be signed in to change notification settings - Fork 135
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
[APPS-47043] Allow user to provide a specific port and host for containerized environment #1004
base: master
Are you sure you want to change the base?
Conversation
I have read the CLA Document and I hereby sign the CLA Kelly Huntlin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
index.d.ts
Outdated
/** | ||
* Custom socket port to use for the local SAML server. Useful for SSO in containerized environments. | ||
*/ | ||
localSamlServerPort?: boolean; |
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.
Could you consider unifying these two parameters and specify one name e.g. samlRedirectUri
? It would be great in term of consistency with our configuration variable oauthRedirectUri
which we're planning to introduce when adding support for Soteria
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, I have done this. It requires a bit more effort in parsing the address that comes in, so I have added unit tests for a URLUtil method.
lib/authentication/auth_web.js
Outdated
server.listen(0, 0); | ||
// Preserving previous behavior. If user does not provide a custom port or address, | ||
// it will use a random port and fallback to localhost | ||
// https://github.com/nodejs/node/blob/main/lib/net.js#L1311 |
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.
Could we change the comment to be related only to the current state and inform about defaults when custom parameters not provided
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.
Yes, changing the comment style.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1004 +/- ##
==========================================
+ Coverage 88.89% 88.93% +0.04%
==========================================
Files 72 72
Lines 7003 7034 +31
==========================================
+ Hits 6225 6256 +31
Misses 778 778 ☔ View full report in Codecov by Sentry. |
…ronments that need SSO.
315e534
to
ee7a774
Compare
To give some background, customers who use the VS Code extension for Snowflake in a remote environment cannot easily SSO via SAML because of the user's local machine and the remote machine boundary. When the Identity Provider redirected eventually to the listening server with the token in the url, the listening server is in the remote machine and the user's local machine fails to communicate to the remote server to pass the token along.
The previous solution in the VS Code extension was to let the user copy-paste that redirect address and give it to the extension.
SSO support in virtualized environments.
But it's a little clunky and users would like to just have it happen automatically. This would entail adding a configuration option in the extension + the configuration in the Node Connector to enable selection of a specific port and address. Then the customers' networking admins can hook up the port and host between their local and their remote and it will happen smoothly.
It is similar to this change in the python connector, but thru the configuration rather than environment variable.
snowflakedb/snowflake-connector-python#932
What do you think of this approach?
Checklist
npm run lint:check -- CHANGED_FILES
and fix problems in changed code)npm run test:unit
andnpm run test:integration
)