Skip to content

Commit

Permalink
Remove authorization for healthcheck API (#2105)
Browse files Browse the repository at this point in the history
* remove authorization for healthcheck

* use allow anonymous instead

---------

Co-authored-by: chuongnguyen <[email protected]>
  • Loading branch information
cqnguy23 and cqnguy23 authored Dec 5, 2024
1 parent af7141a commit 045aac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal abstract class SignalRServiceWebApiDefinition : ControllerBase
/// <response code="200">The service is healthy</response>
[HttpGet("health"), HttpHead("health")]
[ProducesResponseType(200)]
[AllowAnonymous]
public abstract IActionResult GetHealthStatus();

// POST /api/v1/hubs/chat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ public SignalRServiceEmulatorWebApiTests()
_controller.ControllerContext = controllerContext;
}

[Fact]
public void HealthCheckReturnsOK()
{
var result = _controller.GetHealthStatus();

// assert
Assert.IsType<OkResult>(result);
}

// CheckConnectionExistence Tests
[Fact]
public void CheckConnectionExistenceValidConnectionReturnsOk()
Expand Down

0 comments on commit 045aac4

Please sign in to comment.