Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d06eda6
Refactorization of route and authorization config to be fully configu…
ChaosEngine Dec 8, 2019
0f91cc2
No-NewtonsoftJson
ChaosEngine Dec 11, 2019
4b7f898
Custom LoginPath, LogoutPath
ChaosEngine Dec 12, 2019
ad8ea9f
package.json bumps and audit fixes
ChaosEngine Mar 15, 2020
7d498dd
bump: lodash
ChaosEngine Jul 24, 2020
052b8f3
Refactorization of route and authorization config to be fully configu…
ChaosEngine Dec 8, 2019
3b1fef0
No-NewtonsoftJson
ChaosEngine Dec 11, 2019
003424b
Custom LoginPath, LogoutPath
ChaosEngine Dec 12, 2019
b6c6a7d
package.json bumps and audit fixes
ChaosEngine Mar 15, 2020
a18345d
bump: lodash
ChaosEngine Jul 24, 2020
16a1892
Merge branch 'IdentityManager-master' upstream IdentityManager2
ChaosEngine Dec 9, 2020
8dc8dab
Fix displaying user creation error messages
ChaosEngine Dec 12, 2020
50887c3
bumping jquery(v3.5.1), bootstrap (v4.5.3)
ChaosEngine Dec 12, 2020
9bdfbbb
dropping lodash from deps and unused gulp require
ChaosEngine Dec 23, 2020
2e7f02f
modal-backdrop style opacity fix for newwer bootstrap.js style. sorry…
ChaosEngine Dec 23, 2020
219bd84
blocking publishing package*.json
ChaosEngine Dec 31, 2020
5ab54e6
bump: gulp-less; npm audit fix simple vulns
ChaosEngine Aug 11, 2021
7aace8d
dotnet-7 upgrade
ChaosEngine Dec 14, 2022
e0f4433
1st try of migration to dotnet 8.
ChaosEngine Nov 4, 2023
9ac5532
<PublishTrimmed>true</PublishTrimmed>
ChaosEngine Nov 9, 2023
ad4da41
trim compatible serialization code
ChaosEngine Nov 14, 2023
01df57f
BadRequest(ModelState) serialization on errors, not finished
ChaosEngine Nov 15, 2023
6ade96f
back to regular OK,BadREquest plain responses and more using AddJsonO…
ChaosEngine Nov 17, 2023
7c6ade3
<TrimMode>full</TrimMode>
ChaosEngine Nov 18, 2023
d28c3ca
Decorating reflection heave methods with RequiresUnreferencedCode
ChaosEngine Nov 29, 2023
d241829
<TrimMode>partial</TrimMode>
ChaosEngine Jan 12, 2024
46784f2
github actions: dotnet-version: 8.0.x bump
ChaosEngine Jan 17, 2024
367441e
bump gh-actions versions
ChaosEngine Jan 27, 2024
2cc7cd5
bump: gh-actions: actions/setup-dotnet@v4
ChaosEngine May 22, 2024
8a20b73
package reference upgrades
ChaosEngine Nov 28, 2024
acfb74d
fixing ci/cd build pipelines
ChaosEngine Jan 6, 2025
ad41934
executing `npm audit fix --force` on project clientside dpens and dev…
ChaosEngine Jan 7, 2025
2d6c7b7
eslint-9 migration
ChaosEngine Feb 16, 2025
5bb66aa
bumping internal version of jquery and bootstrap
ChaosEngine Mar 14, 2025
00ba1db
update devDependencies to use caret (^) versioning for gulp packages
ChaosEngine May 21, 2025
2672157
Upgrade to .NET 9.0 and migrate to Duende IdentityServer
ChaosEngine Oct 9, 2025
7ca45cb
bump: gulp-5.0.1
ChaosEngine Oct 9, 2025
7a9d155
security version bump: AngularJS (AngularJS v1.8.3)
ChaosEngine Jan 10, 2026
bfbbb8f
removal of map files from JS libs
ChaosEngine Jan 11, 2026
48594ff
bump: Bootstrap v5.3.8
ChaosEngine Jan 11, 2026
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
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.301
dotnet-version: 9.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Duende.IdentityServer;
using Duende.IdentityServer.Services;
using Hosts.Shared.InMemory;
using IdentityManager2;
using IdentityServer4;
using IdentityServer4.Services;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="IdentityServer4" Version="3.1.0" />
<PackageReference Include="Duende.IdentityServer" Version="7.4.4" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Hosts/Hosts.IdentityServerAuthentication/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using Duende.IdentityServer.Models;
using Duende.IdentityServer.Test;
using Hosts.Shared.InMemory;
using IdentityManager2.Configuration;
using IdentityServer4.Models;
using IdentityServer4.Test;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Hosts/Hosts.Shared/Hosts.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
11 changes: 6 additions & 5 deletions src/IdentityManager2/Api/Controllers/MetaController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using IdentityManager2.Api.Models;
using IdentityManager2.Core.Metadata;
Expand Down Expand Up @@ -37,9 +38,9 @@ private async Task<IdentityManagerMetadata> GetMetadataAsync()
public async Task<IActionResult> Get()
{
var meta = await GetMetadataAsync();
var data = new Dictionary<string, object> {{"currentUser", new {username = User.Identity.Name}}};
var links = new Dictionary<string, object> {["users"] = Url.Link("GetUsers", null)};
var data = new Dictionary<string, object> { { "currentUser", new AnonymousUserName{ username = User.Identity.Name } } };

var links = new Dictionary<string, object> { ["users"] = Url.Link("GetUsers", null) };

if (meta.RoleMetadata.SupportsListing)
{
Expand All @@ -54,7 +55,7 @@ public async Task<IActionResult> Get()
links["createRole"] = new CreateRoleLink(Url, meta.RoleMetadata);
}

return Ok(new
return Ok(new MetaResult
{
Data = data,
Links = links
Expand Down
7 changes: 5 additions & 2 deletions src/IdentityManager2/Api/Controllers/PageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public async Task<IActionResult> Index()
Model = JsonSerializer.Serialize(new PageModelParams
{
PathBase = Request.PathBase,
ShowLoginButton = !authResult.Succeeded
})
ShowLoginButton = !authResult.Succeeded,
TitleNavBarLinkTarget = this.config.TitleNavBarLinkTarget,
LoginPath = this.config.SecurityConfiguration.LoginPath,
LogoutPath = this.config.SecurityConfiguration.LogoutPath
}, PageModelParams_Context.Default.PageModelParams)
});
}

Expand Down
21 changes: 10 additions & 11 deletions src/IdentityManager2/Api/Controllers/RolesController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using IdentityManager2.Api.Models;
using IdentityManager2.Core;
Expand All @@ -15,7 +16,7 @@ namespace IdentityManager2.Api.Controllers
{
[Route(IdentityManagerConstants.RoleRoutePrefix)]
[Authorize(IdentityManagerConstants.IdMgrAuthPolicy)]
[ResponseCache(NoStore=true, Location=ResponseCacheLocation.None)]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
public class RolesController : Controller
{
private readonly IIdentityManagerService service;
Expand Down Expand Up @@ -67,7 +68,7 @@ public async Task<IActionResult> GetRolesAsync(string filter = null, int start =

// POST
[HttpPost, Route("", Name = IdentityManagerConstants.RouteNames.CreateRole)]
public async Task<IActionResult> CreateRoleAsync([FromBody]PropertyValue[] properties)
public async Task<IActionResult> CreateRoleAsync([FromBody] PropertyValue[] properties)
{
var meta = await GetMetadataAsync();
if (!meta.RoleMetadata.SupportsCreate)
Expand All @@ -87,12 +88,12 @@ public async Task<IActionResult> CreateRoleAsync([FromBody]PropertyValue[] prope
var result = await service.CreateRoleAsync(properties);
if (result.IsSuccess)
{
var url = Url.Link(IdentityManagerConstants.RouteNames.GetRole, new { subject = result.Result.Subject });
var url = Url.Link(IdentityManagerConstants.RouteNames.GetRole, new AnonymousSubject { subject = result.Result.Subject });

var resource = new
var resource = new AnonymousCreatedRole
{
Data = new { subject = result.Result.Subject },
Links = new { detail = url }
Data = new AnonymousSubject { subject = result.Result.Subject },
Links = new AnonymousDetail { detail = url }
};
return Created(url, resource);
}
Expand All @@ -108,7 +109,7 @@ public async Task<IActionResult> GetRoleAsync(string subject)
{
if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand All @@ -133,8 +134,6 @@ public async Task<IActionResult> GetRoleAsync(string subject)
}

var response = Ok(new RoleDetailResource(result.Result, Url, meta.RoleMetadata));


return response;
}
return BadRequest(result.ToError());
Expand Down Expand Up @@ -168,7 +167,7 @@ public async Task<IActionResult> SetPropertyAsync(string subject, string type)
{
if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand Down
25 changes: 14 additions & 11 deletions src/IdentityManager2/Api/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using IdentityManager2.Api.Models;
using IdentityManager2.Core;
Expand All @@ -25,7 +26,7 @@ public UsersController(IIdentityManagerService service)
{
this.service = service ?? throw new ArgumentNullException(nameof(service));
}

public async Task<IdentityManagerMetadata> GetMetadataAsync()
{
if (metadata == null)
Expand Down Expand Up @@ -74,17 +75,19 @@ public async Task<IActionResult> CreateUserAsync([FromBody] PropertyValue[] prop
var result = await service.CreateUserAsync(properties);
if (result.IsSuccess)
{
var url = Url.Link(IdentityManagerConstants.RouteNames.GetUser, new {subject = result.Result.Subject});
var resource = new
var url = Url.Link(IdentityManagerConstants.RouteNames.GetUser, new AnonymousSubject { subject = result.Result.Subject });
var resource = new AnonymousCreatedUser
{
Data = new {subject = result.Result.Subject},
Links = new {detail = url}
Data = new AnonymousSubject { subject = result.Result.Subject },
Links = new AnonymousDetail { detail = url }
};

return Created(url, resource);
}

ModelState.AddModelError("", result.ToString());
ModelState.AddModelError("errors", result.Errors.Aggregate((workingSentence, next) => workingSentence + " " + next));
if (result.Errors.Count > 0)
return BadRequest(ModelState);
}

return BadRequest(400);
Expand All @@ -95,7 +98,7 @@ public async Task<IActionResult> GetUserAsync(string subject)
{
if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand Down Expand Up @@ -142,7 +145,7 @@ public async Task<IActionResult> DeleteUserAsync(string subject)

if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand All @@ -165,7 +168,7 @@ public async Task<IActionResult> SetPropertyAsync(string subject, string type)
{
if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand Down Expand Up @@ -201,7 +204,7 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV

if (IsNullOrWhiteSpace(subject))
{
ModelState["subject.String"].Errors.Clear();
ModelState["subject.String"]?.Errors.Clear();
ModelState.AddModelError("", Messages.SubjectRequired);
}

Expand All @@ -221,7 +224,7 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV

ModelState.AddErrors(result);
}

return BadRequest(ModelState.ToError());
}

Expand Down
Loading