Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
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@v3
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
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
3 changes: 3 additions & 0 deletions src/IdentityManager2/Api/Controllers/RolesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public async Task<IActionResult> GetRolesAsync(string filter = null, int start =

// POST
[HttpPost, Route("", Name = IdentityManagerConstants.RouteNames.CreateRole)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> CreateRoleAsync([FromBody] PropertyValue[] properties)
{
var meta = await GetMetadataAsync();
Expand Down Expand Up @@ -140,6 +141,7 @@ public async Task<IActionResult> GetRoleAsync(string subject)
}

[HttpDelete, Route("{subject}", Name = IdentityManagerConstants.RouteNames.DeleteRole)]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteRoleAsync(string subject)
{
var meta = await GetMetadataAsync();
Expand All @@ -163,6 +165,7 @@ 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))
Expand Down
7 changes: 7 additions & 0 deletions src/IdentityManager2/Api/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,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 Down Expand Up @@ -135,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 Down Expand Up @@ -164,6 +166,7 @@ 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))
Expand Down Expand Up @@ -194,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 Down Expand Up @@ -229,6 +233,7 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV
}

[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 @@ -257,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 @@ -282,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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<link rel="shortcut icon" type="image/x-icon" href="@Model.PathBase/assets/Content.favicon.ico" />
</head>
<body lang="en" ng-app="ttIdmApp" ng-csp ng-controller="LayoutCtrl" ng-cloak>
@Html.AntiForgeryToken()

<div ng-include="'@Model.PathBase/assets/Templates.navbar.html'"></div>

Expand Down
16 changes: 8 additions & 8 deletions src/IdentityManager2/Assets/Content/Style.less
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ img.logo-footer {
}
}

.center-block.pagination {
//width:300px;
}
// .center-block.pagination {
// //width:300px;
// }

.pager-text {
margin-top: 26px;
Expand Down Expand Up @@ -96,9 +96,9 @@ img.logo-footer {
top: 15px;
}

.subject {
//color: @gray-light;
}
// .subject {
// //color: @gray-light;
// }
}

@-moz-keyframes pulse {
Expand Down Expand Up @@ -195,8 +195,8 @@ img.logo-footer {
width: 200px;
}

span {
}
// span {
// }
}
.modal-backdrop.show {
opacity: .5;
Expand Down
3 changes: 1 addition & 2 deletions src/IdentityManager2/Assets/Content/bootstrap.min.css

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion src/IdentityManager2/Assets/Scripts/App/ttIdm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference path="../Libs/angular.min.js" />
/*global angular*/
/// <reference path="../Libs/angular.min.js" />

(function (angular) {
const app = angular.module("ttIdm", []);
Expand All @@ -10,6 +11,25 @@
return {
'request': function(config) {
idmErrorService.clear();

// Add anti-forgery token for non-GET requests
if (config.method && config.method !== 'GET') {
try {
const rvt = document.querySelector('input[name="__RequestVerificationToken"]');
if (rvt) {
const token = rvt.value;
if (token) {
if (!config.headers) {
config.headers = {};
}
config.headers.RequestVerificationToken = token;
}
}
} catch (e) {
console.error("Failed to extract antiforgery token:", e);
}
}

return config;
},
'responseError': function(response) {
Expand Down
10 changes: 7 additions & 3 deletions src/IdentityManager2/Assets/Scripts/App/ttIdmApp.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/// <reference path="../Libs/angular.min.js" />
/*global angular*/
/// <reference path="../Libs/angular.min.js" />
/// <reference path="../Libs/angular-route.min.js" />

(function (angular) {
const app = angular.module("ttIdmApp", ["ngRoute", "ttIdm", "ttIdmUI", "ttIdmUsers", "ttIdmRoles"]);
function config(PathBase, $routeProvider) {
function config(PathBase, $routeProvider, $locationProvider) {
// Configure hash prefix to empty string for compatibility with Angular 1.3.x URLs
$locationProvider.hashPrefix('');

$routeProvider
.when("/", {
templateUrl: PathBase + "/assets/Templates.home.html"
Expand All @@ -15,7 +19,7 @@
redirectTo: "/"
});
}
config.$inject = ["PathBase", "$routeProvider"];
config.$inject = ["PathBase", "$routeProvider", "$locationProvider"];
app.config(config);

function LayoutCtrl($rootScope, PathBase, idmApi, $location, $window, idmErrorService, ShowLoginButton,
Expand Down
5 changes: 3 additions & 2 deletions src/IdentityManager2/Assets/Scripts/App/ttIdmRoles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference path="../Libs/angular.min.js" />
/*global angular*/
/// <reference path="../Libs/angular.min.js" />
/// <reference path="../Libs/angular-route.min.js" />

(function (angular) {
Expand Down Expand Up @@ -111,7 +112,7 @@
$scope.tab = 1;
}
}, feedback.errorHandler);
};
}
loadRole();

$scope.setProperty = function (property) {
Expand Down
Loading
Loading