2020-03-02 16:50:28 +01:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2020-06-24 03:34:09 +02:00
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using BTCPayServer.Client.Models;
|
2020-03-02 16:50:28 +01:00
|
|
|
|
|
|
|
namespace BTCPayServer.Client
|
|
|
|
{
|
|
|
|
public partial class BTCPayServerClient
|
|
|
|
{
|
|
|
|
|
|
|
|
public static Uri GenerateAuthorizeUri(Uri btcpayHost, string[] permissions, bool strict = true,
|
|
|
|
bool selectiveStores = false)
|
|
|
|
{
|
|
|
|
var result = new UriBuilder(btcpayHost);
|
|
|
|
result.Path = "api-keys/authorize";
|
|
|
|
|
|
|
|
AppendPayloadToQuery(result,
|
|
|
|
new Dictionary<string, object>()
|
|
|
|
{
|
|
|
|
{"strict", strict}, {"selectiveStores", selectiveStores}, {"permissions", permissions}
|
|
|
|
});
|
|
|
|
|
|
|
|
return result.Uri;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|