Files
sqltoolsservice/src/Microsoft.SqlTools.ResourceProvider.DefaultImpl/AzureTenant.cs
Kevin Cunnane 7acc668c04 Create Firewall Rule support with a simple Resource Provider implementation
Implementation of the resource provider APIs in order to support Create Firewall Rule. Provides definition for a ResourceProvider and Authentication service. The ResourceProvider supports firewall rules for now, and since authentication is routed through that method it will call into the auth service to set up the current account to be used.

Additional notes:
- Fixed deserialization by adding an Accept header. This shouldn't be necessary, but for some reason the firewall rule defaults to XML without this
- Use generic server list and parse the ID to get the resource group, avoiding a large number of extra calls for each RG
- Errors now include error message from the API
2017-10-09 15:45:33 -07:00

56 lines
1.4 KiB
C#

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using Microsoft.SqlTools.ResourceProvider.Core;
using Microsoft.SqlTools.ResourceProvider.Core.Authentication;
namespace Microsoft.SqlTools.ResourceProvider.DefaultImpl
{
/// <summary>
/// Implementation for <see cref="IAzureTenant" /> using VS services
/// Contains information about an Azure account
/// </summary>
public class AzureTenant : IAzureTenant
{
public string TenantId
{
get;
set;
}
public string AccountDisplayableId
{
get;
set;
}
/// <summary>
/// URI defining the root for resource lookup
/// </summary>
public string Resource { get; set; }
/// <summary>
/// Access token for use in login scenarios. Note that we could consider implementing this better in the
/// </summary>
public string AccessToken
{
get;
set;
}
/// <summary>
/// Optional token type defining whether this is a Bearer token or other type of token
/// </summary>
public string TokenType
{
get;
set;
}
}
}