Allow the arm baseURI to be set dynamically (#920)

* Allow the arm baseURI to be set dynamically

* Defensive programming
This commit is contained in:
Amir Omidi
2020-03-23 14:41:45 -07:00
committed by GitHub
parent 6920c34570
commit 50a666f794
5 changed files with 111 additions and 21 deletions

View File

@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using Microsoft.SqlTools.ResourceProvider.Core.Contracts;
namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
{
@@ -12,6 +13,11 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Authentication
/// </summary>
public interface IAzureUserAccount : IEquatable<IAzureUserAccount>, IUserAccount
{
Account UnderlyingAccount
{
get;
set;
}
/// <summary>
/// User Account Display Info
/// </summary>

View File

@@ -31,7 +31,7 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
/// Indicates if the account needs refreshing
/// </summary>
public bool IsStale { get; set; }
}
/// <summary>
@@ -58,9 +58,57 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
get;
set;
}
/// <summary>
/// Information about the auth provider
/// </summary>
public ProviderSettings ProviderSettings;
}
public class ProviderSettings
{
/// <summary>
/// Display name of the provider
/// </summary>
public string DisplayName;
/// <summary>
/// ID of the provider
/// </summary>
public string Id;
/// <summary>
/// Settings for the provider itself
/// </summary>
public ProviderSettingsObject Settings;
}
public class ProviderSettingsObject
{
public ResourceSetting ArmResource;
public ResourceSetting GraphResource;
public ResourceSetting OssRdbmsResource;
public ResourceSetting SqlResource;
/// <summary>
/// Actual sign in link
/// </summary>
public string Host;
/// <summary>
/// ClientID used
/// </summary>
public string ClientId;
}
public class ResourceSetting
{
/// <summary>
/// Endpoint of the resource
/// </summary>
public string Endpoint;
public string Id;
}
/// <summary>
/// Represents a key that identifies an account.
/// </summary>
@@ -87,7 +135,6 @@ namespace Microsoft.SqlTools.ResourceProvider.Core.Contracts
/// <summary>
/// A display name that offers context for the account, such as "Contoso".
/// </summary>
public string ContextualDisplayName { get; set; }
// Note: ignoring ContextualLogo as it's not needed