Skip to content

Commit

Permalink
Changed to include uniqe value in path insted of adding Query paramet…
Browse files Browse the repository at this point in the history
…ers after review
  • Loading branch information
lovoll committed Jan 26, 2024
1 parent f71cffc commit 38b9ac0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Altinn.Profile/Controllers/UsersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public async Task<ActionResult<UserProfile>> Get(int userID)
/// </summary>
/// <param name="userUuid">The user uuid</param>
/// <returns>The information about a given user</returns>
[HttpGet("")]
[HttpGet("byuuid/{userUuid:Guid}")]
[Authorize(Policy = "PlatformAccess")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<UserProfile>> Get([FromQuery] Guid userUuid)
public async Task<ActionResult<UserProfile>> Get(Guid userUuid)
{
UserProfile result = await _userProfilesWrapper.GetUserByUuid(userUuid);
if (result == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public async Task GetUsersByUuid_SblBridgeFindsProfile_ResponseOk_ReturnsUserPro
});
_webApplicationFactorySetup.SblBridgeHttpMessageHandler = messageHandler;

HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users?userUuid={userUuid}");
HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}");

httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest"));

Expand Down Expand Up @@ -196,7 +196,7 @@ public async Task GetUsersByUuid_UserAuthenticatedMissingPlatformAccesToken_Retu
const int userId = 20000009;
Guid userUuid = new("cc86d2c7-1695-44b0-8e82-e633243fdf31");

HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users?userUuid={userUuid}");
HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}");

HttpClient client = _webApplicationFactorySetup.GetTestServerClient();

Expand All @@ -223,7 +223,7 @@ public async Task GetUsersByUuid_SblBridgeReturnsNotFound_ResponseNotFound()
});
_webApplicationFactorySetup.SblBridgeHttpMessageHandler = messageHandler;

HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users?userUuid={userUuid}");
HttpRequestMessage httpRequestMessage = CreateGetRequest(userId, $"/profile/api/v1/users/byuuid/{userUuid}");

httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest"));

Expand All @@ -246,7 +246,7 @@ public async Task GetUsersByUuid_MissingAuthentication_NotAuthorized()
// Arrange
Guid userUuid = new("cc86d2c7-1695-44b0-8e82-e633243fdf31");

HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, $"/profile/api/v1/users?userUuid={userUuid}");
HttpRequestMessage httpRequestMessage = new(HttpMethod.Get, $"/profile/api/v1/users/byuuid/{userUuid}");

httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest"));

Expand Down

0 comments on commit 38b9ac0

Please sign in to comment.