mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 21:18:13 -05:00
[AC-1438] Updated SCIM controllers to respond with "content-Type: application/scim+json" (#3072)
This commit is contained in:
parent
6e58936fa3
commit
4a110ad135
@ -12,6 +12,7 @@ namespace Bit.Scim.Controllers.v2;
|
|||||||
|
|
||||||
[Authorize("Scim")]
|
[Authorize("Scim")]
|
||||||
[Route("v2/{organizationId}/groups")]
|
[Route("v2/{organizationId}/groups")]
|
||||||
|
[Produces("application/scim+json")]
|
||||||
[ExceptionHandlerFilter]
|
[ExceptionHandlerFilter]
|
||||||
public class GroupsController : Controller
|
public class GroupsController : Controller
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ namespace Bit.Scim.Controllers.v2;
|
|||||||
|
|
||||||
[Authorize("Scim")]
|
[Authorize("Scim")]
|
||||||
[Route("v2/{organizationId}/users")]
|
[Route("v2/{organizationId}/users")]
|
||||||
|
[Produces("application/scim+json")]
|
||||||
[ExceptionHandlerFilter]
|
[ExceptionHandlerFilter]
|
||||||
public class UsersController : Controller
|
public class UsersController : Controller
|
||||||
{
|
{
|
||||||
|
@ -48,6 +48,8 @@ public class GroupsControllerTests : IClassFixture<ScimApplicationFactory>, IAsy
|
|||||||
|
|
||||||
var responseModel = JsonSerializer.Deserialize<ScimGroupResponseModel>(context.Response.Body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
|
var responseModel = JsonSerializer.Deserialize<ScimGroupResponseModel>(context.Response.Body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
|
||||||
AssertHelper.AssertPropertyEqual(expectedResponse, responseModel);
|
AssertHelper.AssertPropertyEqual(expectedResponse, responseModel);
|
||||||
|
|
||||||
|
Assert.Contains("application/scim+json", context.Response.Headers.ContentType.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -55,6 +55,8 @@ public class UsersControllerTests : IClassFixture<ScimApplicationFactory>, IAsyn
|
|||||||
|
|
||||||
var responseModel = JsonSerializer.Deserialize<ScimUserResponseModel>(context.Response.Body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
|
var responseModel = JsonSerializer.Deserialize<ScimUserResponseModel>(context.Response.Body, new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase });
|
||||||
AssertHelper.AssertPropertyEqual(expectedResponse, responseModel);
|
AssertHelper.AssertPropertyEqual(expectedResponse, responseModel);
|
||||||
|
|
||||||
|
Assert.Contains("application/scim+json", context.Response.Headers.ContentType.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user