-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Integration Test - Part 1 (#51)
Adding Integration Test for Okta Setup Command Reducing delay for Okta MFA verification
- Loading branch information
Showing
29 changed files
with
623 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Ellosoft.AwsCredentialsManager/Services/Okta/OktaHttpClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) 2023 Ellosoft Limited. All rights reserved. | ||
|
||
namespace Ellosoft.AwsCredentialsManager.Services.Okta; | ||
|
||
public static class OktaHttpClient | ||
{ | ||
public static void Configure(HttpClient httpClient) | ||
{ | ||
const string USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0"; | ||
|
||
httpClient.DefaultRequestHeaders.Add("User-Agent", USER_AGENT); | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
src/Ellosoft.AwsCredentialsManager/Services/Okta/OktaHttpClientFactory.cs
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/Ellosoft.AwsCredentialsManager/Services/Platforms/MacOS/IntPtrExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...redentialsManager.Tests/Integration/Commands/Credentials/CreateCredentialsProfileTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2024 Ellosoft Limited. All rights reserved. | ||
|
||
using Ellosoft.AwsCredentialsManager.Commands.Credentials; | ||
using Ellosoft.AwsCredentialsManager.Infrastructure.Cli; | ||
using Ellosoft.AwsCredentialsManager.Services.Configuration.Interactive; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Ellosoft.AwsCredentialsManager.Tests.Integration.Commands.Credentials; | ||
|
||
public class CreateCredentialsProfileTests(ITestOutputHelper outputHelper, TestFixture testFixture) : IntegrationTest(outputHelper, testFixture) | ||
{ | ||
[Fact(Skip = "WIP")] | ||
public void CreateCredentialsProfile_Interactive_ShouldCreateNewProfile() | ||
{ | ||
App.Configure(config => | ||
config.AddBranch<CredentialsBranch>(cred => | ||
cred.AddCommand<CreateCredentialsProfile>())); | ||
|
||
var profileName = Guid.NewGuid().ToString("N"); | ||
|
||
var (exitCode, output) = App.Run("new", profileName); | ||
|
||
exitCode.Should().Be(0); | ||
output.Should().Contain($"'{profileName}' credentials created"); | ||
|
||
var credentialsManager = TestFixture.WebApp.Services.GetRequiredService<ICredentialsManager>(); | ||
credentialsManager.TryGetCredential(profileName, out var credentialsConfig); | ||
|
||
credentialsConfig.Should().NotBeNull(); | ||
// credentialsConfig.RoleArn.Should().Be(awsRoleArn); | ||
// credentialsConfig.OktaProfile.Should().Be(profileName); | ||
// credentialsConfig.OktaAppUrl.Should().Be(oktaAppUrl); | ||
|
||
} | ||
} |
Oops, something went wrong.