align auth provider with go-client (#1415)

* remove unsupport provider

* fix build

* fix missing

* rm unused
This commit is contained in:
Boshi Lian
2023-10-02 08:38:46 -07:00
committed by GitHub
parent 2899a13cbf
commit da71e32d13
4 changed files with 2 additions and 143 deletions

View File

@@ -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");
}
}
}