Skip to content

Commit a4b387e

Browse files
feature(#6): this commit defines the contract for the permission namespace policy service
1 parent a00b767 commit a4b387e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace HttpsRichardy.Federation.Domain.Policies;
2+
3+
// defines a policy responsible for protecting the system permission namespace
4+
// from unauthorized usage by realms
5+
6+
// certain permissions are reserved by the federation system and represent
7+
// privileged administrative capabilities (e.g. managing realms or federation resources)
8+
9+
// this policy ensures that realms cannot create or manipulate permissions
10+
// whose identifiers belong to the reserved system namespace, preventing
11+
// privilege escalation through permission name collision
12+
13+
public interface IPermissionNamespacePolicy
14+
{
15+
public Task<Result> EnsurePermissionIsAllowedAsync(
16+
Realm realm,
17+
Permission permission,
18+
CancellationToken cancellation = default
19+
);
20+
}

0 commit comments

Comments
 (0)