Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: end 2 end testing #95

Merged
merged 34 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
98a4971
wip
IvanJosipovic Oct 10, 2023
03c6fb6
updates
IvanJosipovic Oct 10, 2023
2c074cf
wip
IvanJosipovic Oct 10, 2023
609ae0f
wip
IvanJosipovic Oct 10, 2023
5e947ac
merge from main
IvanJosipovic Oct 31, 2023
f2219ba
wip
IvanJosipovic Oct 10, 2023
3af5a28
updates
IvanJosipovic Oct 10, 2023
7ceaebd
wip
IvanJosipovic Oct 10, 2023
eb0b768
wip
IvanJosipovic Oct 10, 2023
3a151a9
wip
IvanJosipovic Oct 31, 2023
a172c12
Merge branch 'main' into e2e
IvanJosipovic Oct 31, 2023
406c4b5
wip
IvanJosipovic Oct 31, 2023
753e397
wip
IvanJosipovic Oct 31, 2023
9e3bb93
wip
IvanJosipovic Nov 7, 2023
50fa008
wip
IvanJosipovic Nov 7, 2023
2be8aba
wip
IvanJosipovic Nov 8, 2023
a60f099
Merge branch 'main' into e2e
IvanJosipovic Nov 8, 2023
5f278fe
wip
IvanJosipovic Nov 8, 2023
9b21796
Merge branch 'e2e' of https://github.com/IvanJosipovic/OIDC-Guard int…
IvanJosipovic Nov 8, 2023
8553ea6
wip
IvanJosipovic Nov 8, 2023
7159130
fix
IvanJosipovic Nov 8, 2023
59e88f2
wip
IvanJosipovic Nov 8, 2023
e178622
wip
IvanJosipovic Nov 9, 2023
18a60de
wip
IvanJosipovic Nov 9, 2023
1ea6354
wip
IvanJosipovic Nov 9, 2023
5cb5f95
Merge branch 'main' into e2e
IvanJosipovic Nov 9, 2023
555c18e
wip
IvanJosipovic Nov 9, 2023
ffc76de
wip
IvanJosipovic Nov 9, 2023
618b36c
wip
IvanJosipovic Nov 9, 2023
a5ccf8d
chore: clean
IvanJosipovic Nov 15, 2023
b4d13a2
chore: switch to built in user
IvanJosipovic Nov 15, 2023
741392b
chore: cleanup
IvanJosipovic Nov 15, 2023
55b8559
merge
IvanJosipovic Nov 21, 2023
dbe2d8a
chore: hide debug field
IvanJosipovic Nov 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ jobs:
working-directory: src/oidc-guard
run: docker build -t oidc-guard .

- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.0.1 demo-app.test.loc" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 oidc-guard.test.loc" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 oidc-server.oidc-server" | sudo tee -a /etc/hosts

- name: Install Playwright
working-directory: tests/oidc-guard-tests/bin/Release/net8.0
run: ./playwright.ps1 install --with-deps
shell: pwsh

- name: .NET Test
run: dotnet test -c Release --collect:"XPlat Code Coverage"

Expand Down
7 changes: 5 additions & 2 deletions src/oidc-guard/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
o.ClientSecret = settings.Cookie.ClientSecret;
o.CorrelationCookie.Name = settings.Cookie.CookieName;
o.MetadataAddress = settings.OpenIdProviderConfigurationUrl;
o.RequireHttpsMetadata = settings.RequireHttpsMetadata;
o.NonceCookie.Name = settings.Cookie.CookieName;
o.ResponseType = OpenIdConnectResponseType.Code;
o.SaveTokens = settings.Cookie.SaveTokensInCookie;
Expand All @@ -129,6 +130,8 @@
{
auth.AddJwtBearer(o =>
{
o.RequireHttpsMetadata = settings.RequireHttpsMetadata;

if (!string.IsNullOrEmpty(settings.JWT.JWKSUrl))
{
var httpClient = new HttpClient(o.BackchannelHttpHandler ?? new HttpClientHandler())
Expand Down Expand Up @@ -181,8 +184,6 @@

var app = builder.Build();

app.UseHttpLogging();

app.UseForwardedHeaders();

app.Use((context, next) =>
Expand Down Expand Up @@ -227,6 +228,8 @@
return next();
});

app.UseHttpLogging();

app.UseAuthentication();
app.UseAuthorization();

Expand Down Expand Up @@ -264,7 +267,7 @@
{
foreach (var item in skipEquals)
{
var commaIndex = item.IndexOf(',');

Check warning on line 270 in src/oidc-guard/Program.cs

View workflow job for this annotation

GitHub Actions / Build & Test

Dereference of a possibly null reference.
if (commaIndex != -1)
{
var method = item[..commaIndex];
Expand All @@ -291,7 +294,7 @@
{
foreach (var item in skipNotEquals)
{
var commaIndex = item.IndexOf(',');

Check warning on line 297 in src/oidc-guard/Program.cs

View workflow job for this annotation

GitHub Actions / Build & Test

Dereference of a possibly null reference.
if (commaIndex != -1)
{
var method = item[..commaIndex];
Expand Down
1 change: 1 addition & 0 deletions src/oidc-guard/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
public bool SkipAuthPreflight { get; set; }
public LogLevel LogLevel { get; set; }
public string OpenIdProviderConfigurationUrl { get; set; } = null!;
public bool RequireHttpsMetadata { get; set; } = true;
public string? Host { get; set; }
public string? Scheme { get; set; }
public CookieAuthSettings Cookie { get; set; } = new();
Expand All @@ -21,7 +22,7 @@
public string ClientSecret { get; set; } = null!;
public string CookieName { get; set; } = "oidc-guard";
public string? CookieDomain { get; set; }
public string[] Scopes { get; set; }

Check warning on line 25 in src/oidc-guard/Settings.cs

View workflow job for this annotation

GitHub Actions / Build & Test

Non-nullable property 'Scopes' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
public string[]? AllowedRedirectDomains { get; set; }
}

Expand Down
Loading
Loading