Skip to content

Commit

Permalink
Fix apim deploy (#128)
Browse files Browse the repository at this point in the history
* Fix apim deploy

* Changed to include uniqe value in path insted of adding Query parameters after review

* Added specification to where the uuid should be fetched
  • Loading branch information
lovoll authored Jan 29, 2024
1 parent 90eb1f1 commit ca6525b
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("{userUuid:Guid}")]
[HttpGet("byuuid/{userUuid:Guid}")]
[Authorize(Policy = "PlatformAccess")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
public async Task<ActionResult<UserProfile>> Get(Guid userUuid)
public async Task<ActionResult<UserProfile>> Get([FromRoute] 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}");
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}");
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}");
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}");
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 ca6525b

Please sign in to comment.