forked from databricks/databricks-sql-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PECO-909] Automatically renew oauth token when refresh token is avai…
…lable (databricks#156) * HiveDriver: obtain a thrift client before each request (allows to re-create client if needed) Signed-off-by: Levko Kravets <[email protected]> * Move auth logic to DBSQLClient Signed-off-by: Levko Kravets <[email protected]> * Remove redundant HttpTransport class Signed-off-by: Levko Kravets <[email protected]> * Cache OAuth tokens in memory by default to avoid re-running OAuth flow on every request Signed-off-by: Levko Kravets <[email protected]> * Re-create thrift client when auth credentials (e.g. oauth token) change Signed-off-by: Levko Kravets <[email protected]> * Update tests Signed-off-by: Levko Kravets <[email protected]> --------- Signed-off-by: Levko Kravets <[email protected]> Signed-off-by: nithinkdb <[email protected]>
- Loading branch information
1 parent
637b3bf
commit efd3c65
Showing
17 changed files
with
554 additions
and
564 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import HttpTransport from '../transports/HttpTransport'; | ||
import { HttpHeaders } from 'thrift'; | ||
|
||
export default interface IAuthentication { | ||
authenticate(transport: HttpTransport): Promise<void>; | ||
authenticate(): Promise<HttpHeaders>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
import IConnectionOptions from './IConnectionOptions'; | ||
import IAuthentication from './IAuthentication'; | ||
import IThriftConnection from './IThriftConnection'; | ||
|
||
export default interface IConnectionProvider { | ||
connect(options: IConnectionOptions, authProvider: IAuthentication): Promise<IThriftConnection>; | ||
connect(options: IConnectionOptions): Promise<IThriftConnection>; | ||
} |
Oops, something went wrong.