-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize external integration client code (#48)
### Summary & Motivation Move all clients-code, i.e. code for integrating with external dependencies, into the calendar-assistant/Clients folder. Rename the MicrosoftGraphService to MicrosoftGraphClient. ### Checklist - [x] I have added a Label to the pull-request - [x] I have added tests, and done manual regression tests - [x] I have updated the documentation, if necessary
- Loading branch information
1 parent
d78e3fe
commit b6706ca
Showing
27 changed files
with
74 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...assistant/Core/Application/CalendarConnections/Commands/EnsureActiveCalendarConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
application/calendar-assistant/Core/Application/Meetings/Commands/CancelMeeting.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
application/calendar-assistant/Core/Application/Meetings/Commands/CreateMeeting.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
application/calendar-assistant/Core/Application/Meetings/Queries/GetMeetings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
application/calendar-assistant/Core/Application/Meetings/Queries/MeetingDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
application/calendar-assistant/Core/Application/Users/Commands/CreateUser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
application/calendar-assistant/Core/Application/Users/Queries/GetUserInfoByEmail.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...assistant/Core/AccountManagementClient.cs → ...ountManagement/AccountManagementClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Application/AccountManagementEndpoints.cs → ...tManagement/AccountManagementEndpoints.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ation/Calendar/CalendarClientException.cs → ...ients/Calendar/CalendarClientException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Moment42.CalendarAssistant.Application.Calendar; | ||
namespace Moment42.CalendarAssistant.Clients.Calendar; | ||
|
||
public sealed class CalendarClientException(string message) : Exception(message); |
2 changes: 1 addition & 1 deletion
2
...ication/Calendar/CalendarClientFactory.cs → ...Clients/Calendar/CalendarClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ore/Application/Calendar/CalendarEntry.cs → ...nt/Core/Clients/Calendar/CalendarEntry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/Application/Calendar/CalendarEntryId.cs → .../Core/Clients/Calendar/CalendarEntryId.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/Application/Calendar/ICalendarClient.cs → .../Core/Clients/Calendar/ICalendarClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...e/MicrosoftGraph/AccessTokenCredential.cs → ...s/MicrosoftGraph/AccessTokenCredential.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../MicrosoftGraph/IMicrosoftGraphService.cs → ...s/MicrosoftGraph/IMicrosoftGraphClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
application/calendar-assistant/Core/Clients/MicrosoftGraph/IMicrosoftGraphClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Moment42.CalendarAssistant.Clients.MicrosoftGraph; | ||
|
||
public interface IMicrosoftGraphClientFactory | ||
{ | ||
IMicrosoftGraphClient CreateFromAccessToken(string accessToken); | ||
|
||
IMicrosoftGraphClient Create(string entraTenantId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...softGraph/MicrosoftGraphServiceFactory.cs → ...osoftGraph/MicrosoftGraphClientFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
using Microsoft.Extensions.Options; | ||
using Moment42.CalendarAssistant.Authentication; | ||
|
||
namespace Moment42.CalendarAssistant.MicrosoftGraph; | ||
namespace Moment42.CalendarAssistant.Clients.MicrosoftGraph; | ||
|
||
public sealed class MicrosoftGraphServiceFactory(IOptions<EntraAuthenticationConfiguration> entraAuthenticationConfiguration) : IMicrosoftGraphServiceFactory | ||
public sealed class MicrosoftGraphClientFactory(IOptions<EntraAuthenticationConfiguration> entraAuthenticationConfiguration) : IMicrosoftGraphClientFactory | ||
{ | ||
private readonly string _clientId = entraAuthenticationConfiguration.Value.AppRegistration.ClientId | ||
?? throw new InvalidOperationException("No ClientId found in appsettings.json"); | ||
|
||
private readonly string _clientSecret = entraAuthenticationConfiguration.Value.AppRegistration.ClientSecret | ||
?? throw new InvalidOperationException("No ClientSecret found in appsettings.json"); | ||
|
||
public IMicrosoftGraphService CreateFromAccessToken(string accessToken) | ||
public IMicrosoftGraphClient CreateFromAccessToken(string accessToken) | ||
{ | ||
return new MicrosoftGraphService(accessToken); | ||
return new MicrosoftGraphClient(accessToken); | ||
} | ||
|
||
public IMicrosoftGraphService Create(string entraTenantId) | ||
public IMicrosoftGraphClient Create(string entraTenantId) | ||
{ | ||
return new MicrosoftGraphService(entraTenantId, _clientId, _clientSecret); | ||
return new MicrosoftGraphClient(entraTenantId, _clientId, _clientSecret); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
application/calendar-assistant/Core/MicrosoftGraph/IMicrosoftGraphServiceFactory.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.