Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 1 addition & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# mongo database environment variables

MONGO_INITDB_ROOT_USERNAME=admin
MONGO_INITDB_ROOT_PASSWORD=admin

# web application environment variables
MONGO_CONNECTIONSTRING=mongodb://admin:admin@localhost:27017
MONGO_DATABASENAME=identity

# web application admin credentials
VINDER_IDENTITY_PROVIDER_ADMIN_USERNAME=admin
VINDER_IDENTITY_PROVIDER_ADMIN_PASSWORD=admin
4 changes: 2 additions & 2 deletions .github/workflows/publish-image-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: build docker image
run: docker build -t vinderio/identity.provider:latest .
run: docker build -t vinderio/federation:latest .

- name: push docker image
run: docker push vinderio/identity.provider:latest
run: docker push vinderio/federation:latest
17 changes: 7 additions & 10 deletions .github/workflows/staging-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# this pipeline deploys the application to the staging environment on every push to main branch
# it uses FTP to upload the published files to the somee.com server

# we stop the application by uploading an app_offline.htm file
# then we wait for a few seconds to let IIS unload the application and release file locks

Expand All @@ -27,7 +24,7 @@ jobs:

- name: publish application
run: |
dotnet publish Source/Vinder.Identity.WebApi \
dotnet publish Source/Vinder.Federation.WebApi \
-c Release \
-r win-x64 \
-o ./publish
Expand All @@ -44,8 +41,8 @@ jobs:
- name: upload app_offline.htm
run: |
sudo apt-get install -y lftp
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-io-identity-provider.somee.com <<EOF
cd /www.vinder-io-identity-provider.somee.com/
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
cd /www.vinder-federation.somee.com/
put app_offline.htm
quit
EOF
Expand All @@ -55,13 +52,13 @@ jobs:

- name: deploy publish via FTP (no delete)
run: |
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-io-identity-provider.somee.com <<EOF
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
set ftp:ssl-allow no
set ftp:chmod false
set mirror:set-permissions false
set mirror:use-pget-n false

mirror -R ./publish /www.vinder-io-identity-provider.somee.com \
mirror -R ./publish /www.vinder-federation.somee.com \
--only-newer \
--verbose

Expand All @@ -70,8 +67,8 @@ jobs:

- name: remove app_offline.htm
run: |
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-io-identity-provider.somee.com <<EOF
cd /www.vinder-io-identity-provider.somee.com/
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
cd /www.vinder-federation.somee.com/
rm app_offline.htm
quit
EOF
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

# copy project files to restore dependencies
COPY ["Source/Vinder.Identity.WebApi/Vinder.Identity.WebApi.csproj", "Vinder.Identity.WebApi/"]
COPY ["Source/Vinder.Federation.WebApi/Vinder.Federation.WebApi.csproj", "Vinder.Federation.WebApi/"]

# copy the entire solution 'n related projects
COPY ["Vinder.Identity.sln", "./"]
COPY ["Vinder.Federation.sln", "./"]

# restore dependencies for the project
RUN dotnet restore "Vinder.Identity.WebApi/Vinder.Identity.WebApi.csproj"
RUN dotnet restore "Vinder.Federation.WebApi/Vinder.Federation.WebApi.csproj"

# copy all source code into the container
COPY Source/ ./Source/

# set working directory to the web project
WORKDIR "/src/Source/Vinder.Identity.WebApi"
WORKDIR "/src/Source/Vinder.Federation.WebApi"

# build in Release mode
RUN dotnet build "Vinder.Identity.WebApi.csproj" -c Release -o /app/build
RUN dotnet build "Vinder.Federation.WebApi.csproj" -c Release -o /app/build

# publish the project for production
FROM build AS publish
RUN dotnet publish "Vinder.Identity.WebApi.csproj" -c Release -o /app/publish /p:UseAppHost=false
RUN dotnet publish "Vinder.Federation.WebApi.csproj" -c Release -o /app/publish /p:UseAppHost=false

# final image to run the app
FROM base AS final
Expand All @@ -37,4 +37,4 @@ WORKDIR /app
COPY --from=publish /app/publish .

# set the command to start the application
ENTRYPOINT ["dotnet", "Vinder.Identity.WebApi.dll"]
ENTRYPOINT ["dotnet", "Vinder.Federation.WebApi.dll"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class AssignPermissionToGroupHandler(IGroupCollection groupCollection, IPermissionCollection permissionCollection) :
IMessageHandler<AssignGroupPermissionScheme, Result<GroupDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class FetchGroupsHandler(IGroupCollection collection) :
IMessageHandler<GroupsFetchParameters, Result<Pagination<GroupDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class GroupCreationHandler(IGroupCollection groupCollection, ITenantProvider tenantProvider) :
IMessageHandler<GroupCreationScheme, Result<GroupDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class GroupDeletionHandler(IGroupCollection collection) : IMessageHandler<GroupDeletionScheme, Result>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class GroupUpdateHandler(IGroupCollection collection) :
IMessageHandler<GroupUpdateScheme, Result<GroupDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class ListGroupAssignedPermissionsHandler(IGroupCollection collection) :
IMessageHandler<ListGroupAssignedPermissionsParameters, Result<IReadOnlyCollection<PermissionDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Group;
namespace Vinder.Federation.Application.Handlers.Group;

public sealed class RevokeGroupPermissionHandler(IGroupCollection groupCollection, IPermissionCollection permissionCollection) :
IMessageHandler<RevokeGroupPermissionScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Identity;
namespace Vinder.Federation.Application.Handlers.Identity;

public sealed class AuthenticationHandler(IAuthenticationService authenticationService) :
IMessageHandler<AuthenticationCredentials, Result<AuthenticationResult>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Identity;
namespace Vinder.Federation.Application.Handlers.Identity;

public sealed class ClientAuthenticationHandler(
ITenantCollection tenantCollection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Identity;
namespace Vinder.Federation.Application.Handlers.Identity;

public sealed class IdentityEnrollmentHandler(
IUserCollection userCollection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Identity;
namespace Vinder.Federation.Application.Handlers.Identity;

public sealed class SessionInvalidationHandler(ISecurityTokenService tokenService) :
IMessageHandler<SessionInvalidationScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Identity;
namespace Vinder.Federation.Application.Handlers.Identity;

public sealed class SessionTokenRenewalHandler(IUserCollection userCollection, ISecurityTokenService tokenService) :
IMessageHandler<SessionTokenRenewalScheme, Result<AuthenticationResult>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.OpenID;
namespace Vinder.Federation.Application.Handlers.OpenID;

public sealed class FetchJsonWebKeysHandler(ISecretCollection collection) :
IMessageHandler<FetchJsonWebKeysParameters, Result<JsonWebKeySetScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.OpenID;
namespace Vinder.Federation.Application.Handlers.OpenID;

public sealed class FetchOpenIDConfigurationHandler(IHostInformationProvider host) :
IMessageHandler<FetchOpenIDConfigurationParameters, Result<OpenIDConfigurationScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Permission;
namespace Vinder.Federation.Application.Handlers.Permission;

public sealed class FetchPermissionsHandler(IPermissionCollection collection) :
IMessageHandler<PermissionsFetchParameters, Result<Pagination<PermissionDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Permission;
namespace Vinder.Federation.Application.Handlers.Permission;

public sealed class PermissionCreationHandler(IPermissionCollection collection, ITenantProvider tenantProvider) :
IMessageHandler<PermissionCreationScheme, Result<PermissionDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Permission;
namespace Vinder.Federation.Application.Handlers.Permission;

public sealed class PermissionDeletionHandler(IPermissionCollection collection) : IMessageHandler<PermissionDeletionScheme, Result>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Permission;
namespace Vinder.Federation.Application.Handlers.Permission;

public sealed class PermissionUpdateHandler(IPermissionCollection collection, ITenantProvider tenantProvider) :
IMessageHandler<PermissionUpdateScheme, Result<PermissionDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Scope;
namespace Vinder.Federation.Application.Handlers.Scope;

public sealed class ScopeCreationHandler(IScopeCollection scopeCollection, ITenantCollection tenantCollection, ITenantProvider tenantProvider) :
IMessageHandler<ScopeCreationScheme, Result<ScopeDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class AssignPermissionToTenantHandler(ITenantCollection tenantCollection, IPermissionCollection permissionCollection) :
IMessageHandler<AssignTenantPermissionScheme, Result<IReadOnlyCollection<PermissionDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class FetchTenantsHandler(ITenantCollection collection) :
IMessageHandler<TenantFetchParameters, Result<Pagination<TenantDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class ListTenantAssignedPermissionsHandler(ITenantCollection collection) :
IMessageHandler<ListTenantAssignedPermissionsParameters, Result<IReadOnlyCollection<PermissionDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class RevokeTenantPermissionHandler(ITenantCollection tenantCollection, IPermissionCollection permissionCollection) :
IMessageHandler<RevokeTenantPermissionScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class TenantCreationHandler(ITenantCollection collection, IClientCredentialsGenerator credentialsGenerator) :
IMessageHandler<TenantCreationScheme, Result<TenantDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class TenantDeletionHandler(ITenantCollection collection) : IMessageHandler<TenantDeletionScheme, Result>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.Tenant;
namespace Vinder.Federation.Application.Handlers.Tenant;

public sealed class TenantUpdateHandler(ITenantCollection collection) :
IMessageHandler<TenantUpdateScheme, Result<TenantDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class AssignUserPermissionHandler(IUserCollection userCollection, IPermissionCollection permissionCollection) :
IMessageHandler<AssignUserPermissionScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class AssignUserToGroupHandler(IUserCollection userCollection, IGroupCollection groupCollection) :
IMessageHandler<AssignUserToGroupScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class FetchUsersHandler(IUserCollection collection) :
IMessageHandler<UsersFetchParameters, Result<Pagination<UserDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class InspectPrincipalHandler(IPrincipalProvider principalProvider) :
IMessageHandler<InspectPrincipalParameters, Result<PrincipalDetailsScheme>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class ListUserAssignedGroupsHandler(IUserCollection collection) :
IMessageHandler<ListUserAssignedGroupsParameters, Result<IReadOnlyCollection<GroupBasicDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class ListUserAssignedPermissionsHandler(IUserCollection collection) :
IMessageHandler<ListUserAssignedPermissionsParameters, Result<IReadOnlyCollection<PermissionDetailsScheme>>>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class RemoveUserFromGroupHandler(IUserCollection userCollection, IGroupCollection groupCollection) :
IMessageHandler<RemoveUserFromGroupScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class RevokeUserPermissionHandler(IUserCollection userCollection, IPermissionCollection permissionCollection) :
IMessageHandler<RevokeUserPermissionScheme, Result>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Handlers.User;
namespace Vinder.Federation.Application.Handlers.User;

public sealed class UserDeletionHandler(IUserCollection collection) : IMessageHandler<UserDeletionScheme, Result>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class GroupMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.IdentityModel.Tokens;

namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class JsonWebKeysMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class OpenIDMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class PermissionMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class ScopeMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class TenantMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class TokenMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Mappers;
namespace Vinder.Federation.Application.Mappers;

public static class UserMapper
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Payloads.Client;
namespace Vinder.Federation.Application.Payloads.Client;

public sealed record ClientCredentials
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Payloads.Common;
namespace Vinder.Federation.Application.Payloads.Common;

public sealed record Pagination<TItem>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Payloads.Group;
namespace Vinder.Federation.Application.Payloads.Group;

public sealed record AssignGroupPermissionScheme : IMessage<Result<GroupDetailsScheme>>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Vinder.Identity.Application.Payloads.Group;
namespace Vinder.Federation.Application.Payloads.Group;

public sealed record GroupBasicDetailsScheme
{
Expand Down
Loading
Loading