Skip to content

Commit

Permalink
Merge branch 'master' into analytics-consent
Browse files Browse the repository at this point in the history
  • Loading branch information
andracc committed Jan 21, 2025
2 parents 3006ac0 + 117e235 commit 4ccf628
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 99 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ jobs:
builds.dotnet.microsoft.com:443
dc.services.visualstudio.com:443
deb.debian.org:80
dotnetbuilds.azureedge.net:443
dotnetcli.azureedge.net:443
github.com:443
md-hdd-t032zjxllntc.z26.blob.storage.azure.net:443
objects.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup dotnet
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install ffmpeg
Expand Down Expand Up @@ -113,15 +111,14 @@ jobs:
api.nuget.org:443
builds.dotnet.microsoft.com:443
dc.services.visualstudio.com:443
dotnetcli.azureedge.net:443
github.com:443
objects.githubusercontent.com:443
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# Manually install .NET to work around:
# https://github.com/github/codeql-action/issues/757
- name: Setup .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: "8.0.x"
- name: Initialize CodeQL
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/deploy_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ jobs:
api.nuget.org:443
archive.ubuntu.com:80
auth.docker.io:443
codecov.io:443
dc.services.visualstudio.com:443
deb.debian.org:80
docker.io:443
dotnetcli.azureedge.net:443
files.pythonhosted.org:443
github.com:443
mcr.microsoft.com:443
Expand All @@ -51,7 +49,6 @@ jobs:
security.ubuntu.com:80
storage.googleapis.com:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
uploader.codecov.io:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ jobs:
*.actions.githubusercontent.com:443
*.cloudfront.net:443
*.data.mcr.microsoft.com:443
api.ecr-public.us-east-1.amazonaws.com:443
api.ecr-public.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
api.github.com:443
api.nuget.org:443
archive.ubuntu.com:80
auth.docker.io:443
dc.services.visualstudio.com:443
deb.debian.org:80
docker.io:443
dotnetcli.azureedge.net:443
files.pythonhosted.org:443
github.com:443
mcr.microsoft.com:443
Expand All @@ -47,7 +46,7 @@ jobs:
security.debian.org:80
security.ubuntu.com:80
storage.googleapis.com:443
sts.us-east-1.amazonaws.com:443
sts.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com:443
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Build The Combine
id: build_combine
Expand Down
10 changes: 6 additions & 4 deletions Backend/Controllers/SpeakerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;

namespace BackendFramework.Controllers
{
Expand Down Expand Up @@ -96,9 +97,9 @@ public async Task<IActionResult> GetSpeaker(string projectId, string speakerId)

/// <summary> Creates a <see cref="Speaker"/> for the specified projectId </summary>
/// <returns> Id of created Speaker </returns>
[HttpGet("create/{name}", Name = "CreateSpeaker")]
[HttpPut("create", Name = "CreateSpeaker")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> CreateSpeaker(string projectId, string name)
public async Task<IActionResult> CreateSpeaker(string projectId, [FromBody, BindRequired] string name)
{
// Check permissions
if (!await _permissionService.HasProjectPermission(
Expand Down Expand Up @@ -193,9 +194,10 @@ public async Task<IActionResult> RemoveConsent(string projectId, string speakerI

/// <summary> Updates the <see cref="Speaker"/>'s name for the specified projectId and speakerId </summary>
/// <returns> Id of updated Speaker </returns>
[HttpGet("update/{speakerId}/{name}", Name = "UpdateSpeakerName")]
[HttpPut("update/{speakerId}", Name = "UpdateSpeakerName")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> UpdateSpeakerName(string projectId, string speakerId, string name)
public async Task<IActionResult> UpdateSpeakerName(
string projectId, string speakerId, [FromBody, BindRequired] string name)
{
// Check permissions
if (!await _permissionService.HasProjectPermission(
Expand Down
10 changes: 5 additions & 5 deletions Backend/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ public async Task<IActionResult> GetUser(string userId)
}

/// <summary> Returns <see cref="User"/> with the specified email address. </summary>
[HttpGet("getemail/{email}", Name = "GetUserByEmail")]
[HttpPut("getbyemail", Name = "GetUserByEmail")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(User))]
public async Task<IActionResult> GetUserByEmail(string email)
public async Task<IActionResult> GetUserByEmail([FromBody, BindRequired] string email)
{
if (!_permissionService.IsCurrentUserAuthorized(HttpContext))
{
Expand Down Expand Up @@ -200,17 +200,17 @@ public async Task<IActionResult> CreateUser([FromBody, BindRequired] User user)

/// <summary> Checks whether specified email address is taken or empty. </summary>
[AllowAnonymous]
[HttpGet("isemailtaken/{email}", Name = "IsEmailUnavailable")]
[HttpPut("isemailtaken", Name = "IsEmailUnavailable")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(bool))]
public async Task<IActionResult> IsEmailUnavailable(string email)
public async Task<IActionResult> IsEmailUnavailable([FromBody, BindRequired] string email)
{
var isUnavailable = string.IsNullOrWhiteSpace(email) || await _userRepo.GetUserByEmail(email) is not null;
return Ok(isUnavailable);
}

/// <summary> Updates <see cref="User"/> with specified id. </summary>
/// <returns> Id of updated user. </returns>
[HttpPut("{userId}", Name = "UpdateUser")]
[HttpPut("updateuser/{userId}", Name = "UpdateUser")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(string))]
public async Task<IActionResult> UpdateUser(string userId, [FromBody, BindRequired] User user)
{
Expand Down
2 changes: 1 addition & 1 deletion Backend/Controllers/UserRoleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public async Task<IActionResult> ChangeOwner(string projectId, string oldUserId,
if (newResult != ResultOfUpdate.Updated)
{
return StatusCode(StatusCodes.Status304NotModified, newRoleId);
};
}

// Change the old owner to a project admin
oldUserRole.Role = Role.Administrator;
Expand Down
Loading

0 comments on commit 4ccf628

Please sign in to comment.