Skip to content

Conversation

@jonkjetiloye
Copy link
Member

@jonkjetiloye jonkjetiloye commented Oct 4, 2025

Description

  • Added new TokenGeneratorController
  • Added new RegisterService for party info lookup
  • Moved existing token building logic from AuthenticationController to a new TokenService

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

#1524
- Added new TokenGeneratorController
- Added new RegisterService for party info lookup
- Moved existing token building logic from AuthenticationController to a new TokenService
/// <param name="cancellationToken">Cancellation token</param>
/// <returns>A personal access token for the user</returns>
[HttpGet()]
[Route("personaltoken")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hvordan skal vi låse ned dette til bare test-miljøer?

Skal det være åpent i test-miljøer eller kreve noe autentisering for å få tilgang?

Content = JsonContent.Create(body)
};

var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseContentRead, cancellationToken);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ikke forstått hva som må til for at platformtoken blir lagt på automatisk gjennom servicedefaults httpclient implementasjonen. Har lokalt testet med å legge på ekstra headere så lenge

var partyinfo = await registerService.GetParty(pid, cancellationToken);
if (!partyinfo.Success || partyinfo.Party == null)
{
return NotFound($"No party found for pid {pid}");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BadRequest and ProblemDetails plz

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
41.3% Coverage on New Code (required ≥ 65%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant