mirror of
https://github.com/bitwarden/server
synced 2025-12-17 16:53:23 +00:00
[PM-25182] Improve swagger OperationIDs: Part 1 (#6229)
* Improve swagger OperationIDs: Part 1 * Fix tests and fmt * Improve docs and add more tests * Fmt * Improve Swagger OperationIDs for Auth * Fix review feedback * Use generic getcustomattributes * Format * replace swaggerexclude by split+obsolete * Format * Some remaining excludes
This commit is contained in:
@@ -344,7 +344,6 @@ public class AccountsController : Controller
|
||||
}
|
||||
|
||||
[HttpPut("profile")]
|
||||
[HttpPost("profile")]
|
||||
public async Task<ProfileResponseModel> PutProfile([FromBody] UpdateProfileRequestModel model)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
@@ -363,8 +362,14 @@ public class AccountsController : Controller
|
||||
return response;
|
||||
}
|
||||
|
||||
[HttpPost("profile")]
|
||||
[Obsolete("This endpoint is deprecated. Use PUT /profile instead.")]
|
||||
public async Task<ProfileResponseModel> PostProfile([FromBody] UpdateProfileRequestModel model)
|
||||
{
|
||||
return await PutProfile(model);
|
||||
}
|
||||
|
||||
[HttpPut("avatar")]
|
||||
[HttpPost("avatar")]
|
||||
public async Task<ProfileResponseModel> PutAvatar([FromBody] UpdateAvatarRequestModel model)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
@@ -382,6 +387,13 @@ public class AccountsController : Controller
|
||||
return response;
|
||||
}
|
||||
|
||||
[HttpPost("avatar")]
|
||||
[Obsolete("This endpoint is deprecated. Use PUT /avatar instead.")]
|
||||
public async Task<ProfileResponseModel> PostAvatar([FromBody] UpdateAvatarRequestModel model)
|
||||
{
|
||||
return await PutAvatar(model);
|
||||
}
|
||||
|
||||
[HttpGet("revision-date")]
|
||||
public async Task<long?> GetAccountRevisionDate()
|
||||
{
|
||||
@@ -430,7 +442,6 @@ public class AccountsController : Controller
|
||||
}
|
||||
|
||||
[HttpDelete]
|
||||
[HttpPost("delete")]
|
||||
public async Task Delete([FromBody] SecretVerificationRequestModel model)
|
||||
{
|
||||
var user = await _userService.GetUserByPrincipalAsync(User);
|
||||
@@ -467,6 +478,13 @@ public class AccountsController : Controller
|
||||
throw new BadRequestException(ModelState);
|
||||
}
|
||||
|
||||
[HttpPost("delete")]
|
||||
[Obsolete("This endpoint is deprecated. Use DELETE / instead.")]
|
||||
public async Task PostDelete([FromBody] SecretVerificationRequestModel model)
|
||||
{
|
||||
await Delete(model);
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpPost("delete-recover")]
|
||||
public async Task PostDeleteRecover([FromBody] DeleteRecoverRequestModel model)
|
||||
@@ -638,7 +656,6 @@ public class AccountsController : Controller
|
||||
await _twoFactorEmailService.SendNewDeviceVerificationEmailAsync(user);
|
||||
}
|
||||
|
||||
[HttpPost("verify-devices")]
|
||||
[HttpPut("verify-devices")]
|
||||
public async Task SetUserVerifyDevicesAsync([FromBody] SetVerifyDevicesRequestModel request)
|
||||
{
|
||||
@@ -654,6 +671,13 @@ public class AccountsController : Controller
|
||||
await _userService.SaveUserAsync(user);
|
||||
}
|
||||
|
||||
[HttpPost("verify-devices")]
|
||||
[Obsolete("This endpoint is deprecated. Use PUT /verify-devices instead.")]
|
||||
public async Task PostSetUserVerifyDevicesAsync([FromBody] SetVerifyDevicesRequestModel request)
|
||||
{
|
||||
await SetUserVerifyDevicesAsync(request);
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<Guid>> GetOrganizationIdsClaimingUserAsync(Guid userId)
|
||||
{
|
||||
var organizationsClaimingUser = await _userService.GetOrganizationsClaimingUserAsync(userId);
|
||||
|
||||
Reference in New Issue
Block a user