Skip to content

Commit 216234d

Browse files
chore: this commit migrates the project structure to a monorepo
1 parent d1eb6f1 commit 216234d

73 files changed

Lines changed: 4342 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{B8EFCA5F-814F-285C-A8CB-F00F14650265}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpsRichardy.Federation.Sdk.Contracts", "Source\HttpsRichardy.Federation.Sdk.Contracts.csproj", "{B51529DB-B2C8-4989-B785-1E9A28E4BB42}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Debug|x64 = Debug|x64
14+
Debug|x86 = Debug|x86
15+
Release|Any CPU = Release|Any CPU
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|x64.ActiveCfg = Debug|Any CPU
23+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|x64.Build.0 = Debug|Any CPU
24+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|x86.ActiveCfg = Debug|Any CPU
25+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Debug|x86.Build.0 = Debug|Any CPU
26+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|x64.ActiveCfg = Release|Any CPU
29+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|x64.Build.0 = Release|Any CPU
30+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|x86.ActiveCfg = Release|Any CPU
31+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42}.Release|x86.Build.0 = Release|Any CPU
32+
EndGlobalSection
33+
GlobalSection(SolutionProperties) = preSolution
34+
HideSolutionNode = FALSE
35+
EndGlobalSection
36+
GlobalSection(NestedProjects) = preSolution
37+
{B51529DB-B2C8-4989-B785-1E9A28E4BB42} = {B8EFCA5F-814F-285C-A8CB-F00F14650265}
38+
EndGlobalSection
39+
EndGlobal
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IConnectClient
4+
{
5+
public Task<Result<ClientAuthenticationResult>> AuthenticateAsync(
6+
ClientAuthenticationCredentials credentials,
7+
CancellationToken cancellation = default
8+
);
9+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IGroupsClient
4+
{
5+
public Task<Result<Pagination<GroupDetails>>> GetGroupsAsync(
6+
GroupsFetchParameters? parameters = null,
7+
CancellationToken cancellation = default
8+
);
9+
10+
public Task<Result<GroupDetails>> CreateGroupAsync(
11+
GroupCreationScheme group,
12+
CancellationToken cancellation = default
13+
);
14+
15+
public Task<Result<GroupDetails>> UpdateGroupAsync(
16+
GroupUpdateScheme group,
17+
CancellationToken cancellation = default
18+
);
19+
20+
public Task<Result> DeleteGroupAsync(
21+
string groupId,
22+
CancellationToken cancellation = default
23+
);
24+
25+
public Task<Result<GroupDetails>> AssignGroupPermissionAsync(
26+
string groupId,
27+
string permission,
28+
CancellationToken cancellation = default
29+
);
30+
31+
public Task<Result> RevokeGroupPermissionAsync(
32+
string groupId,
33+
string permissionId,
34+
CancellationToken cancellation = default
35+
);
36+
37+
public Task<Result<IReadOnlyCollection<PermissionDetails>>> GetGroupPermissionsAsync(
38+
string groupId,
39+
ListGroupPermissionsParameters? parameters = null,
40+
CancellationToken cancellation = default
41+
);
42+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IIdentityClient
4+
{
5+
public Task<Result<AuthenticationResult>> AuthenticateAsync(
6+
AuthenticationCredentials credentials,
7+
CancellationToken cancellation = default
8+
);
9+
10+
public Task<Result<UserDetails>> CreateIdentityAsync(
11+
IdentityEnrollmentCredentials credentials,
12+
CancellationToken cancellation = default
13+
);
14+
15+
public Task<Result> InvalidateSessionAsync(
16+
SessionInvalidation session,
17+
CancellationToken cancellation = default
18+
);
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IPermissionsClient
4+
{
5+
public Task<Result<Pagination<PermissionDetails>>> GetPermissionsAsync(
6+
PermissionsFetchParameters parameters,
7+
CancellationToken cancellation = default
8+
);
9+
10+
public Task<Result<PermissionDetails>> CreatePermissionAsync(
11+
PermissionCreationScheme permission,
12+
CancellationToken cancellation = default
13+
);
14+
public Task<Result<PermissionDetails>> UpdatePermissionAsync(
15+
PermissionUpdateScheme permission,
16+
CancellationToken cancellation = default
17+
);
18+
19+
public Task<Result> DeletePermissionAsync(
20+
string permissionId,
21+
CancellationToken cancellation = default
22+
);
23+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IRealmsClient
4+
{
5+
public Task<Result<Pagination<RealmDetails>>> GetRealmsAsync(
6+
RealmFetchParameters parameters,
7+
CancellationToken cancellation = default
8+
);
9+
10+
public Task<Result<RealmDetails>> CreateRealmAsync(
11+
RealmCreationScheme realm,
12+
CancellationToken cancellation = default
13+
);
14+
15+
public Task<Result<RealmDetails>> UpdateRealmAsync(
16+
RealmUpdateScheme realm,
17+
CancellationToken cancellation = default
18+
);
19+
20+
public Task<Result> DeleteRealmAsync(
21+
string realmId,
22+
CancellationToken cancellation = default
23+
);
24+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Clients;
2+
3+
public interface IUsersClient
4+
{
5+
public Task<Result<Pagination<UserDetails>>> GetUsersAsync(
6+
UsersFetchParameters? parameters = null,
7+
CancellationToken cancellation = default
8+
);
9+
10+
public Task<Result<IReadOnlyCollection<PermissionDetails>>> GetUserPermissionsAsync(
11+
string userId,
12+
ListUserAssignedPermissionsParameters? parameters = null,
13+
CancellationToken cancellation = default
14+
);
15+
16+
public Task<Result<IReadOnlyCollection<GroupBasicDetails>>> GetUserGroupsAsync(
17+
string userId,
18+
ListUserAssignedGroupsParameters? parameters = null,
19+
CancellationToken cancellation = default
20+
);
21+
22+
public Task<Result> DeleteUserAsync(
23+
string userId,
24+
CancellationToken cancellation = default
25+
);
26+
27+
public Task<Result> AssignUserGroupAsync(
28+
string userId,
29+
string groupId,
30+
CancellationToken cancellation = default
31+
);
32+
33+
public Task<Result> AssignUserPermissionAsync(
34+
string userId,
35+
string permission,
36+
CancellationToken cancellation = default
37+
);
38+
39+
public Task<Result> RevokeUserPermissionAsync(
40+
string userId,
41+
string permissionId,
42+
CancellationToken cancellation = default
43+
);
44+
45+
public Task<Result> RemoveUserFromGroupAsync(
46+
string userId,
47+
string groupId,
48+
CancellationToken cancellation = default
49+
);
50+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Errors;
2+
3+
public static class AuthenticationErrors
4+
{
5+
public static readonly Error InvalidTokenFormat = new(
6+
Code: "#ERROR-32B37",
7+
Description: "The token format is invalid or the token is malformed."
8+
);
9+
10+
public static readonly Error TokenExpired = new(
11+
Code: "#ERROR-5F736",
12+
Description: "The token has expired."
13+
);
14+
15+
public static readonly Error InvalidSignature = new(
16+
Code: "#ERROR-FB8E4",
17+
Description: "The token signature is invalid."
18+
);
19+
20+
public static readonly Error InvalidRefreshToken = new(
21+
Code: "#ERROR-2C0D9",
22+
Description: "The provided refresh token is invalid, expired, or has already been used."
23+
);
24+
25+
public static readonly Error LogoutFailed = new(
26+
Code: "#ERROR-60CBC",
27+
Description: "Logout failed: the refresh token is invalid, expired, or has already been used."
28+
);
29+
30+
public static readonly Error InvalidCredentials = new(
31+
Code: "#ERROR-A7E7C",
32+
Description: "The provided credentials are invalid."
33+
);
34+
35+
public static readonly Error ClientNotFound = new(
36+
Code: "#ERROR-0AF50",
37+
Description: "The client was not found."
38+
);
39+
40+
public static readonly Error InvalidClientCredentials = new(
41+
Code: "#ERROR-D5D7C",
42+
Description: "The provided client credentials are invalid."
43+
);
44+
45+
public static readonly Error UserNotFound = new(
46+
Code: "#ERROR-04A2F",
47+
Description: "The user was not found."
48+
);
49+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Errors;
2+
3+
public static class AuthorizationErrors
4+
{
5+
public static readonly Error RedirectUriNotAllowed = new(
6+
Code: "#ERROR-F8EBC",
7+
Description: "The specified redirect URI is not registered or allowed for this realm."
8+
);
9+
10+
public static readonly Error InvalidAuthorizationCode = new(
11+
Code: "#ERROR-C9D0A",
12+
Description: "The provided authorization code is invalid, expired, or has already been used."
13+
);
14+
15+
public static readonly Error AuthorizationCodeExpired = new(
16+
Code: "#ERROR-5F5B3",
17+
Description: "The authorization code has expired."
18+
);
19+
20+
public static readonly Error InvalidCodeVerifier = new(
21+
Code: "#ERROR-DDA70",
22+
Description: "The provided code verifier does not match the code challenge."
23+
);
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace HttpsRichardy.Federation.Sdk.Contracts.Errors;
2+
3+
public static class GroupErrors
4+
{
5+
public static readonly Error GroupAlreadyExists = new(
6+
Code: "#ERROR-1C6F3",
7+
Description: "The group with the specified name already exists."
8+
);
9+
10+
public static readonly Error GroupAlreadyHasPermission = new(
11+
Code: "#ERROR-9C69E",
12+
Description: "The group already has the specified permission assigned."
13+
);
14+
15+
public static readonly Error GroupDoesNotExist = new(
16+
Code: "#ERROR-4D2E2",
17+
Description: "The group with the specified ID does not exist."
18+
);
19+
20+
public static readonly Error PermissionNotAssigned = new(
21+
Code: "#ERROR-C2FB0",
22+
Description: "The group does not have the specified permission assigned."
23+
);
24+
}

0 commit comments

Comments
 (0)