align auth provider with go-client (#1415)
* remove unsupport provider * fix build * fix missing * rm unused
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
using FluentAssertions;
|
||||
using k8s.Authentication;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace k8s.Tests
|
||||
{
|
||||
public class GcpTokenProviderTests
|
||||
{
|
||||
[OperatingSystemDependentFact(Exclude = OperatingSystems.OSX)]
|
||||
public async Task GetToken()
|
||||
{
|
||||
var isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||
var cmd = Path.Combine(Directory.GetCurrentDirectory(), "assets", isWindows ? "mock-gcloud.cmd" : "mock-gcloud.sh");
|
||||
if (!isWindows)
|
||||
{
|
||||
System.Diagnostics.Process.Start("chmod", $"+x {cmd}").WaitForExit();
|
||||
}
|
||||
|
||||
var sut = new GcpTokenProvider(cmd);
|
||||
var result = await sut.GetAuthenticationHeaderAsync(CancellationToken.None).ConfigureAwait(false);
|
||||
result.Scheme.Should().Be("Bearer");
|
||||
result.Parameter.Should().Be("ACCESS-TOKEN");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user