init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Client.CoreApi.Configuration;
|
||||
using Kreta.Client.CoreApi.Constant;
|
||||
|
||||
namespace Kreta.Client.CoreApi.Extension
|
||||
{
|
||||
internal static class CoreApiClientConfigurationExtension
|
||||
{
|
||||
public static Dictionary<string, string> GetPrivateTokenRequestParameters(this ICoreApiClientConfiguration coreApiClientConfiguration)
|
||||
{
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ TokenRequest.GrantType, GrantType.ClientCredentials },
|
||||
{ TokenRequest.ClientId, coreApiClientConfiguration.PrivateClientId },
|
||||
{ TokenRequest.ClientSecret, coreApiClientConfiguration.PrivateClientSecret },
|
||||
{ TokenRequest.Scope, coreApiClientConfiguration.Scope },
|
||||
};
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> GetCoreApiPrivateTokenRequestParameters(this ICoreApiClientConfiguration coreApiClientConfiguration)
|
||||
{
|
||||
return new Dictionary<string, string>
|
||||
{
|
||||
{ TokenRequest.GrantType, GrantType.ClientCredentials },
|
||||
{ TokenRequest.ClientId, coreApiClientConfiguration.CoreApiPrivateClientId },
|
||||
{ TokenRequest.ClientSecret, coreApiClientConfiguration.CoreApiPrivateClientSecret }
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
29
Kreta.Client/CoreApi/Extension/HeaderExtension.cs
Normal file
29
Kreta.Client/CoreApi/Extension/HeaderExtension.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Client.CoreApi.Extension
|
||||
{
|
||||
internal static class HeaderExtension
|
||||
{
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithMulitpartFrom(this string token)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "multipart/form-data" },
|
||||
{ "Authorization", $"Bearer {token}" },
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetAuthorizationHeaderWithJson(this string token, string intezmenyGuid, int tanevId)
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/json" },
|
||||
{ "Authorization", $"Bearer {token}" },
|
||||
{ "IntezmenyId", $"{intezmenyGuid}" },
|
||||
{ "TanevId", $"{tanevId}" },
|
||||
};
|
||||
|
||||
public static Dictionary<string, string> GetFormUrlEncodedHeader()
|
||||
=> new Dictionary<string, string>
|
||||
{
|
||||
{ "Content-Type", "application/x-www-form-urlencoded" },
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue