Refreshes token for intellisense (#1476)

* check if token refresh needed

* add more checks

* simplify logic

* add summary and change to false

* wip

* wip

* add ExpiresOn field to check when token needs to be refreshed

* expired token check

* wip

* wip

* wip

* update expiresOn check

* wip

* wip

* working refresh token

* add closing tag

* fix summary

* pr comments

* add max tolerance

* refactoring

* refactoring and updating descriptions

* remove comment

* pr updates

* more pr comments

* pr comments

* wip

* pr comments - add state tracker

* update comment

* fix type

* pr comments

* fix race condition

* wip

* pr comments

* add comment

* pr comments

* nullable int

* pr comments

* remove uri from map upon disconnect

* pr comments

* remove uri from map upon editor close

* pr comments
This commit is contained in:
Christopher Suh
2022-05-13 11:47:37 -07:00
committed by GitHub
parent 01fe402adf
commit 106b6baeda
5 changed files with 205 additions and 12 deletions

View File

@@ -543,7 +543,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
SetOptionValue("databaseDisplayName", value);
}
}
public string AzureAccountToken
{
get
@@ -556,6 +556,18 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
}
}
public int? ExpiresOn
{
get
{
return GetOptionValue<int?>("expiresOn");
}
set
{
SetOptionValue("expiresOn", value);
}
}
public bool IsComparableTo(ConnectionDetails other)
{
if (other == null)