Skip to content

Commit 045aac4

Browse files
authored
Remove authorization for healthcheck API (#2105)
* remove authorization for healthcheck * use allow anonymous instead --------- Co-authored-by: chuongnguyen <[email protected]>
1 parent af7141a commit 045aac4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Microsoft.Azure.SignalR.Emulator/Common/SignalRServiceWebApiDefinition.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ internal abstract class SignalRServiceWebApiDefinition : ControllerBase
2828
/// <response code="200">The service is healthy</response>
2929
[HttpGet("health"), HttpHead("health")]
3030
[ProducesResponseType(200)]
31+
[AllowAnonymous]
3132
public abstract IActionResult GetHealthStatus();
3233

3334
// POST /api/v1/hubs/chat

test/Microsoft.Azure.SignalR.Emulator.Tests/Controllers/SignalRServiceEmulatorWebApiTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ public SignalRServiceEmulatorWebApiTests()
5151
_controller.ControllerContext = controllerContext;
5252
}
5353

54+
[Fact]
55+
public void HealthCheckReturnsOK()
56+
{
57+
var result = _controller.GetHealthStatus();
58+
59+
// assert
60+
Assert.IsType<OkResult>(result);
61+
}
62+
5463
// CheckConnectionExistence Tests
5564
[Fact]
5665
public void CheckConnectionExistenceValidConnectionReturnsOk()

0 commit comments

Comments
 (0)