mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add AAD token expiration handling for query runner (#17117)
* Add AAD token refresh for notebook * move token refresh to query management and remove previous refresh calls
This commit is contained in:
@@ -233,7 +233,6 @@ export class RunQueryAction extends QueryTaskbarAction {
|
|||||||
editor = this.editor;
|
editor = this.editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
|
||||||
if (this.isConnected(editor)) {
|
if (this.isConnected(editor)) {
|
||||||
// Hide IntelliSense suggestions list when running query to match SSMS behavior
|
// Hide IntelliSense suggestions list when running query to match SSMS behavior
|
||||||
this.commandService?.executeCommand('hideSuggestWidget');
|
this.commandService?.executeCommand('hideSuggestWidget');
|
||||||
@@ -306,7 +305,6 @@ export class EstimatedQueryPlanAction extends QueryTaskbarAction {
|
|||||||
|
|
||||||
public override async run(): Promise<void> {
|
public override async run(): Promise<void> {
|
||||||
if (!this.editor.isSelectionEmpty()) {
|
if (!this.editor.isSelectionEmpty()) {
|
||||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
|
||||||
if (this.isConnected(this.editor)) {
|
if (this.isConnected(this.editor)) {
|
||||||
// If we are already connected, run the query
|
// If we are already connected, run the query
|
||||||
this.runQuery(this.editor);
|
this.runQuery(this.editor);
|
||||||
@@ -346,7 +344,6 @@ export class ActualQueryPlanAction extends QueryTaskbarAction {
|
|||||||
|
|
||||||
public override async run(): Promise<void> {
|
public override async run(): Promise<void> {
|
||||||
if (!this.editor.isSelectionEmpty()) {
|
if (!this.editor.isSelectionEmpty()) {
|
||||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
|
||||||
if (this.isConnected(this.editor)) {
|
if (this.isConnected(this.editor)) {
|
||||||
// If we are already connected, run the query
|
// If we are already connected, run the query
|
||||||
this.runQuery(this.editor);
|
this.runQuery(this.editor);
|
||||||
|
|||||||
@@ -212,7 +212,9 @@ export class QueryManagementService implements IQueryManagementService {
|
|||||||
}
|
}
|
||||||
let handler = this._requestHandlers.get(providerId);
|
let handler = this._requestHandlers.get(providerId);
|
||||||
if (handler) {
|
if (handler) {
|
||||||
return action(handler);
|
return this._connectionService.refreshAzureAccountTokenIfNecessary(uri).then(() => {
|
||||||
|
return action(handler);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return Promise.reject(new Error('No Handler Registered'));
|
return Promise.reject(new Error('No Handler Registered'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user