Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint for fetching current party roles #983

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Conversation

adamhaeger
Copy link
Contributor

@adamhaeger adamhaeger commented Dec 16, 2024

Adds endpoint for fetching the users current party roles.

You need this PR in localtest to test:

Altinn/app-localtest#131

Description

  • Adds endpoint /api/authorization/roles to AuthorizationController
  • Refactored functionality to fetch current party to reusable function
  • Implemented fetching of the current parties.

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)

@adamhaeger adamhaeger changed the title Endpoint working Endpoint for fetching current party roles Dec 16, 2024
@adamhaeger adamhaeger added the kind/feature-request New feature or request label Dec 16, 2024
Copy link
Contributor

@danielskovli danielskovli left a comment

Choose a reason for hiding this comment

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

LGTM

src/Altinn.App.Api/Controllers/AuthorizationController.cs Outdated Show resolved Hide resolved
src/Altinn.App.Api/Controllers/AuthorizationController.cs Outdated Show resolved Hide resolved
@adamhaeger adamhaeger added the feature Label Pull requests with new features. Used when generation releasenotes label Dec 17, 2024
@adamhaeger adamhaeger marked this pull request as ready for review December 17, 2024 09:16
Comment on lines +140 to +144
new HttpResponseMessage
{
StatusCode = System.Net.HttpStatusCode.OK,
Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json"),
}

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable Warning test

Disposable 'HttpResponseMessage' is created but not disposed.
Comment on lines +206 to +210
new HttpResponseMessage
{
StatusCode = System.Net.HttpStatusCode.InternalServerError,
Content = new StringContent("Internal Server Error"),
}

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable Warning test

Disposable 'HttpResponseMessage' is created but not disposed.
Copy link
Contributor

@martinothamar martinothamar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
41.7% Coverage on New Code (required ≥ 65%)
34.62% Condition Coverage on New Code (required ≥ 65%)

See analysis details on SonarQube Cloud

@adamhaeger adamhaeger merged commit 699b82a into main Dec 20, 2024
10 of 12 checks passed
@adamhaeger adamhaeger deleted the feat/2089-add-role-endpoint branch December 20, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Label Pull requests with new features. Used when generation releasenotes kind/feature-request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants