Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 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
58c7cec
Fix displaying user creation error messages
ChaosEngine Dec 12, 2020
5c2a0a0
Refactorization of route and authorization config to be fully configu…
ChaosEngine Dec 8, 2019
11b2b31
No-NewtonsoftJson
ChaosEngine Dec 11, 2019
e779b07
Custom LoginPath, LogoutPath
ChaosEngine Dec 12, 2019
dfe5b97
package.json bumps and audit fixes
ChaosEngine Mar 15, 2020
17f65e0
bump: lodash
ChaosEngine Jul 24, 2020
2006ab1
Refactorization of route and authorization config to be fully configu…
ChaosEngine Dec 8, 2019
9fd9d6e
No-NewtonsoftJson
ChaosEngine Dec 11, 2019
5dd7ad9
Custom LoginPath, LogoutPath
ChaosEngine Dec 12, 2019
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
6b184a2
Merge branch 'dev'
ChaosEngine Jan 13, 2024
c199805
Update dotnet-core.yml
ChaosEngine Jan 14, 2024
bff7664
Merge branch 'IdentityManager:master' into master
ChaosEngine Jan 14, 2024
4b1aec5
Update dotnet-core.yml
ChaosEngine Jan 14, 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
767d357
bump: JQuery-4.0.0
ChaosEngine Jan 22, 2026
5076197
refactor: enhance ttMatch directive with $parse and improve modal han…
ChaosEngine Jan 31, 2026
9b6d616
fix: correct escape character for double quotes in string replacement
ChaosEngine Feb 1, 2026
a5cdfc6
fix: update navbar toggle button to use Bootstrap 5 data attributes
ChaosEngine Feb 1, 2026
c99814f
feat: implement anti-forgery token handling in API and frontend
ChaosEngine Feb 2, 2026
cc78b11
Merge branch 'master' into dev
ChaosEngine Feb 3, 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@v4
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@v4

# ℹ️ 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@v4
16 changes: 8 additions & 8 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 All @@ -27,8 +27,8 @@ jobs:
run: |
cd src/IdentityManager2
dotnet pack -c Release -o publish --no-build
- name: Publish
uses: actions/upload-artifact@master
with:
name: IdentityManager2
path: src/IdentityManager2/publish
# - name: Publish
# uses: actions/upload-artifact@master
# with:
# name: IdentityManager2
# path: src/IdentityManager2/publish
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
24 changes: 13 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,8 @@ 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)
[ValidateAntiForgeryToken]
public async Task<IActionResult> CreateRoleAsync([FromBody] PropertyValue[] properties)
{
var meta = await GetMetadataAsync();
if (!meta.RoleMetadata.SupportsCreate)
Expand All @@ -87,12 +89,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 +110,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,14 +135,13 @@ public async Task<IActionResult> GetRoleAsync(string subject)
}

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


return response;
}
return BadRequest(result.ToError());
}

[HttpDelete, Route("{subject}", Name = IdentityManagerConstants.RouteNames.DeleteRole)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteRoleAsync(string subject)
{
var meta = await GetMetadataAsync();
Expand All @@ -164,11 +165,12 @@ public async Task<IActionResult> DeleteRoleAsync(string subject)
}

[HttpPut, Route("{subject}/properties/{type}", Name = IdentityManagerConstants.RouteNames.UpdateRoleProperty)]
[ValidateAntiForgeryToken]
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
32 changes: 21 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 @@ -54,6 +55,7 @@ public async Task<IActionResult> GetUsersAsync(string filter = null, int start =
}

[HttpPost("", Name = IdentityManagerConstants.RouteNames.CreateUser)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> CreateUserAsync([FromBody] PropertyValue[] properties)
{
var meta = await GetMetadataAsync();
Expand All @@ -74,17 +76,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 +99,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 @@ -132,6 +136,7 @@ public async Task<IActionResult> GetUserAsync(string subject)
}

[HttpDelete, Route("{subject}", Name = IdentityManagerConstants.RouteNames.DeleteUser)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteUserAsync(string subject)
{
var meta = await GetMetadataAsync();
Expand All @@ -142,7 +147,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 @@ -161,11 +166,12 @@ public async Task<IActionResult> DeleteUserAsync(string subject)
}

[HttpPut, Route("{subject}/properties/{type}", Name = IdentityManagerConstants.RouteNames.UpdateUserProperty)]
[ValidateAntiForgeryToken]
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 All @@ -191,6 +197,7 @@ public async Task<IActionResult> SetPropertyAsync(string subject, string type)
}

[HttpPost, Route("{subject}/claims", Name = IdentityManagerConstants.RouteNames.AddClaim)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimValue model)
{
var meta = await GetMetadataAsync();
Expand All @@ -201,7 +208,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,11 +228,12 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV

ModelState.AddErrors(result);
}

return BadRequest(ModelState.ToError());
}

[HttpDelete, Route("{subject}/claims/{type}/{value}", Name = IdentityManagerConstants.RouteNames.RemoveClaim)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> RemoveClaimAsync(string subject, string type, string value)
{
type = type.FromBase64UrlEncoded();
Expand Down Expand Up @@ -254,6 +262,7 @@ public async Task<IActionResult> RemoveClaimAsync(string subject, string type, s
}

[HttpPost, Route("{subject}/roles/{role}", Name = IdentityManagerConstants.RouteNames.AddRole)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> AddRoleAsync(string subject, string role)
{
var meta = await GetMetadataAsync();
Expand All @@ -279,6 +288,7 @@ public async Task<IActionResult> AddRoleAsync(string subject, string role)
}

[HttpDelete, Route("{subject}/roles/{role}", Name = IdentityManagerConstants.RouteNames.RemoveRole)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> RemoveRoleAsync(string subject, string role)
{
var meta = await GetMetadataAsync();
Expand Down
Loading
Loading