Skip to content

Commit 758dddf

Browse files
committed
Description.
1 parent e90fb4b commit 758dddf

File tree

64 files changed

+640
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+640
-335
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,31 @@ An Identity and Access Management (IAM) platform.
44

55
# Documentation
66

7-
Please visit the [Shuttle.Access documentation](https://www.pendel.co.za/shuttle-access/home.html) for more information.
7+
Please visit the [Shuttle.Access documentation](https://www.pendel.co.za/shuttle-access/home.html) for more information
8+
9+
- move "allow identity/password" setting to back-end
10+
- add description to identity (for OID scenarios)
11+
- logging of tokens as option
12+
- configuration.json:
13+
14+
```json
15+
{
16+
"Roles": [
17+
{
18+
"Name": "Admin",
19+
"Description": "Administrator role",
20+
"Permissions": [
21+
"system://name/permission-a"
22+
]
23+
},
24+
{
25+
"Name": "User",
26+
"Description": "User role"
27+
}
28+
],
29+
"Permissions": [
30+
"system://name/permission-a",
31+
"system://name/permission-b",
32+
]
33+
}
34+
```

Shuttle.Access.Application/.package/package.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package>
44
<metadata>
55
<id>Shuttle.Access.Application</id>
6-
<version>7.2.2</version>
6+
<version>7.3.0</version>
77
<authors>Eben Roux</authors>
88
<owners>Eben Roux</owners>
99
<license type="expression">BSD-3-Clause</license>

Shuttle.Access.Application/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
[assembly: AssemblyTitle(".NET Unified Platform")]
1010
#endif
1111

12-
[assembly: AssemblyVersion("7.2.2.0")]
12+
[assembly: AssemblyVersion("7.3.0.0")]
1313
[assembly: AssemblyCopyright("Copyright (c) 2025, Eben Roux")]
1414
[assembly: AssemblyProduct("Shuttle.Access.Application")]
1515
[assembly: AssemblyCompany("Eben Roux")]
1616
[assembly: AssemblyConfiguration("Release")]
17-
[assembly: AssemblyInformationalVersion("7.2.2")]
17+
[assembly: AssemblyInformationalVersion("7.3.0")]
1818
[assembly: ComVisible(false)]

Shuttle.Access.Application/RegisterIdentityParticipant.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public async Task ProcessMessageAsync(IParticipantContext<RequestResponseMessage
5959
stream = await _eventStore.GetAsync(id.Value);
6060
}
6161

62-
var registered = identity.Register(message.Name, message.PasswordHash, message.RegisteredBy, message.GeneratedPassword, message.Activated);
62+
var registered = identity.Register(message.Name, message.Description, message.PasswordHash, message.RegisteredBy, message.GeneratedPassword, message.Activated);
6363

6464
stream.Add(registered);
6565

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System.Threading.Tasks;
2+
using Shuttle.Access.Messages.v1;
3+
using Shuttle.Core.Contract;
4+
using Shuttle.Core.Mediator;
5+
using Shuttle.Recall;
6+
using Shuttle.Recall.Sql.Storage;
7+
8+
namespace Shuttle.Access.Application;
9+
10+
public class SetIdentityDescriptionParticipant : IParticipant<RequestResponseMessage<SetIdentityDescription, IdentityDescriptionSet>>
11+
{
12+
private readonly IEventStore _eventStore;
13+
private readonly IIdKeyRepository _idKeyRepository;
14+
15+
public SetIdentityDescriptionParticipant(IEventStore eventStore, IIdKeyRepository idKeyRepository)
16+
{
17+
_eventStore = Guard.AgainstNull(eventStore);
18+
_idKeyRepository = Guard.AgainstNull(idKeyRepository);
19+
}
20+
21+
public async Task ProcessMessageAsync(IParticipantContext<RequestResponseMessage<SetIdentityDescription, IdentityDescriptionSet>> context)
22+
{
23+
Guard.AgainstNull(context);
24+
25+
var request = context.Message.Request;
26+
27+
var identity = new Identity();
28+
var stream = await _eventStore.GetAsync(request.Id);
29+
30+
stream.Apply(identity);
31+
32+
if (identity.Description.Equals(request.Description))
33+
{
34+
return;
35+
}
36+
37+
stream.Add(identity.SetDescription(request.Description));
38+
39+
await _eventStore.SaveAsync(stream);
40+
41+
context.Message.WithResponse(new()
42+
{
43+
Id = request.Id,
44+
Description = request.Description
45+
});
46+
}
47+
}

Shuttle.Access.AspNetCore/.package/package.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package>
44
<metadata>
55
<id>Shuttle.Access.AspNetCore</id>
6-
<version>7.2.3</version>
6+
<version>7.3.0</version>
77
<authors>Eben Roux</authors>
88
<owners>Eben Roux</owners>
99
<license type="expression">BSD-3-Clause</license>

Shuttle.Access.AspNetCore/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
[assembly: AssemblyTitle(".NET Unified Platform")]
1010
#endif
1111

12-
[assembly: AssemblyVersion("7.2.3.0")]
12+
[assembly: AssemblyVersion("7.3.0.0")]
1313
[assembly: AssemblyCopyright("Copyright (c) 2025, Eben Roux")]
1414
[assembly: AssemblyProduct("Shuttle.Access.AspNetCore")]
1515
[assembly: AssemblyCompany("Eben Roux")]
1616
[assembly: AssemblyConfiguration("Release")]
17-
[assembly: AssemblyInformationalVersion("7.2.3")]
17+
[assembly: AssemblyInformationalVersion("7.3.0")]
1818
[assembly: ComVisible(false)]

Shuttle.Access.AspNetCore/Shuttle.Access.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.7.0" />
16-
<PackageReference Include="Shuttle.Access" Version="7.2.3" />
16+
<PackageReference Include="Shuttle.Access" Version="7.3.0" />
1717
<PackageReference Include="Shuttle.Core.Contract" Version="20.0.1" />
1818
</ItemGroup>
1919

Shuttle.Access.Data/Migrations/20250517164921_IdentityDescription.Designer.cs

Lines changed: 205 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Microsoft.EntityFrameworkCore.Migrations;
2+
3+
#nullable disable
4+
5+
namespace Shuttle.Access.Data.Migrations
6+
{
7+
/// <inheritdoc />
8+
public partial class IdentityDescription : Migration
9+
{
10+
/// <inheritdoc />
11+
protected override void Up(MigrationBuilder migrationBuilder)
12+
{
13+
migrationBuilder.AddColumn<string>(
14+
name: "Description",
15+
table: "Identity",
16+
type: "nvarchar(500)",
17+
maxLength: 500,
18+
nullable: false,
19+
defaultValue: "");
20+
}
21+
22+
/// <inheritdoc />
23+
protected override void Down(MigrationBuilder migrationBuilder)
24+
{
25+
migrationBuilder.DropColumn(
26+
name: "Description",
27+
table: "Identity");
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)