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

Run dotnet format on the repository #234

Merged
merged 3 commits into from
Mar 24, 2025
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Run dotnet format
maartenba committed Mar 21, 2025

Verified

This commit was signed with the committer’s verified signature.
maartenba Maarten Balliauw
commit b7b6d44b4501fe02482a4da7a4376250b1d2ab9b
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.


using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
1 change: 1 addition & 0 deletions IdentityServer/v6/Basics/Apis/SimpleApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.


using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
1 change: 1 addition & 0 deletions IdentityServer/v6/Basics/Apis/SimpleApi/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.


using System.IdentityModel.Tokens.Jwt;
using Client;
using Microsoft.AspNetCore.Builder;
6 changes: 3 additions & 3 deletions IdentityServer/v6/Basics/IdentityServer/src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.


using System;
using Microsoft.AspNetCore.Hosting;
16 changes: 8 additions & 8 deletions IdentityServer/v6/Basics/IdentityServer/src/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.


using Duende.IdentityServer;
using Microsoft.AspNetCore.Builder;
@@ -36,14 +36,14 @@ public void ConfigureServices(IServiceCollection services)
// see https://docs.duendesoftware.com/identityserver/v6/fundamentals/resources/api_scopes
options.EmitStaticAudienceClaim = true;
})
.AddTestUsers(TestUsers.Users);

.AddTestUsers(TestUsers.Users);

builder.AddInMemoryIdentityResources(Resources.Identity);
builder.AddInMemoryApiScopes(Resources.ApiScopes);
builder.AddInMemoryApiResources(Resources.ApiResources);
builder.AddInMemoryClients(Clients.List);

// this is only needed for the JAR and JWT samples and adds supports for JWT-based client authentication
builder.AddInMemoryClients(Clients.List);

// this is only needed for the JAR and JWT samples and adds supports for JWT-based client authentication
builder.AddJwtBearerClientAuthentication();

services.AddAuthentication()
43 changes: 6 additions & 37 deletions IdentityServer/v6/Basics/Shared/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,16 @@
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

<<<<<<< TODO: Unmerged change from project 'Client', Before:
namespace Client
{
public class Urls
{
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";

// The API built with the OWIN pipeline defaults to not using TLS
// so that the sample will run "out of the box", without needing
// to create certificates and manage bindings with netsh.
public const string SampleOwinApi = "http://localhost:5003/";
}
=======
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
namespace Client;

namespace Client;

public class Urls
{
public const string IdentityServer = "https://localhost:5001";
public class Urls
{
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";

// The API built with the OWIN pipeline defaults to not using TLS
// so that the sample will run "out of the box", without needing
// to create certificates and manage bindings with netsh.
public const string SampleOwinApi = "http://localhost:5003/";
>>>>>>> After
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

namespace Client;

public class Urls
{
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";

// The API built with the OWIN pipeline defaults to not using TLS
// so that the sample will run "out of the box", without needing
// to create certificates and manage bindings with netsh.
public const string SampleOwinApi = "http://localhost:5003/";
}
public const string SampleOwinApi = "http://localhost:5003/";
}

Unchanged files with check annotations Beta

// checks periodically for a session state change and fires event
// this causes a round trip to the server
// adjust the period accordingly if that feature is needed
if (user.Identity.IsAuthenticated)

Check warning on line 37 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 37 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 37 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.

Check warning on line 37 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
{
_logger.LogInformation("starting background check..");
Timer? timer = null;
timer = new Timer(async _ =>
{
var currentUser = await GetUser(false);
if (currentUser.Identity.IsAuthenticated == false)

Check warning on line 45 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 45 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 45 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.

Check warning on line 45 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
{
_logger.LogInformation("user logged out");
NotifyAuthenticationStateChanged(Task.FromResult(new AuthenticationState(currentUser)));
await timer.DisposeAsync();

Check warning on line 49 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 49 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 49 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.

Check warning on line 49 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
}
}, null, 1000, 5000);
}
"name",
"role");
foreach (var claim in claims)

Check warning on line 91 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 91 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.

Check warning on line 91 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
{
identity.AddClaim(new Claim(claim.Type, claim.Value.ToString()));

Check warning on line 93 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (csharp)

Possible null reference argument for parameter 'value' in 'Claim.Claim(string type, string value)'.

Check warning on line 93 in BFF/v2/BlazorWasm/Client/BFF/BffAuthenticationStateProvider.cs

GitHub Actions / Analyze (javascript)

Possible null reference argument for parameter 'value' in 'Claim.Claim(string type, string value)'.
}
return new ClaimsPrincipal(identity);
<AuthorizeView>
<Authorized>
<strong>Hello, @context.User.Identity.Name!</strong>

Check warning on line 3 in BFF/v2/BlazorWasm/Client/Shared/LoginDisplay.razor

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 3 in BFF/v2/BlazorWasm/Client/Shared/LoginDisplay.razor

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 3 in BFF/v2/BlazorWasm/Client/Shared/LoginDisplay.razor

GitHub Actions / Analyze (javascript)

Dereference of a possibly null reference.
<a href="@context.User.FindFirst("bff:logout_url")?.Value">Log out</a>
</Authorized>
<NotAuthorized>
<<<<<<< TODO: Unmerged change from project 'SimpleApi', Before:

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered

Check failure on line 2 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered
namespace Client
{
public class Urls
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";
}
=======

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered

Check failure on line 10 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
{
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";
>>>>>>> After

Check failure on line 20 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 20 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

Merge conflict marker encountered

Check failure on line 20 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered

Check failure on line 20 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

Merge conflict marker encountered
// Copyright (c) Duende Software. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
{
public const string IdentityServer = "https://localhost:5001";
public const string SampleApi = "https://localhost:5002/";
}

Check failure on line 30 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

} expected

Check failure on line 30 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (csharp)

} expected

Check failure on line 30 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

} expected

Check failure on line 30 in IdentityServer/v6/UserInteraction/ProfileService/Shared/Constants.cs

GitHub Actions / Analyze (javascript)

} expected