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

Fix unauthorized submit resulting in 500 #243

Merged
merged 5 commits into from
May 25, 2023

Conversation

Magnusrm
Copy link
Contributor

@Magnusrm Magnusrm commented May 24, 2023

Handle exception thrown when platform responds with 403 when trying to update process.

Description

There has been added a try-catch that catches a PlatformHTTPException and responds with 403 if the exceptions statuscode is 403. If the exception contains any other statuscode, we rethrow the exception.

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)

@Magnusrm Magnusrm marked this pull request as ready for review May 24, 2023 07:59
@Magnusrm Magnusrm marked this pull request as draft May 24, 2023 08:39
@Magnusrm Magnusrm marked this pull request as ready for review May 24, 2023 08:48
@Magnusrm Magnusrm requested a review from tjololo May 24, 2023 08:48
Copy link
Member

@tjololo tjololo left a comment

Choose a reason for hiding this comment

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

Looks good, one comment about code style

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Magnusrm Magnusrm added the bugfix Label Pull requests with bugfix. Used when generation releasenotes label May 25, 2023
@Magnusrm Magnusrm merged commit 984bde6 into main May 25, 2023
@Magnusrm Magnusrm deleted the bug/241-forbidden-from-platform-results-in-500 branch May 25, 2023 07:35
tjololo added a commit that referenced this pull request Aug 8, 2023
* Remove trailing slash from source filter in event subscription. (#242)

Co-authored-by: Ronny Birkeli <ronny.birkeli@digdir.no>

* Fix unauthorized submit resulting in 500 (#243)

* catch PlatformException and return 403

* remove code smell

* add test for 403 case

* add test that other PlatformHttpExceptions are rethrown

* return ok inside try block

* chore(deps): update nuget non-major dependencies (#251)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Support for extended file analysis (#229)

Co-authored-by: Ronny Birkeli <ronny.birkeli@digdir.no>

* chore(deps): update dependency coverlet.collector to v6 (#252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Documentation of parameteres used when generating codelists (#259)

Co-authored-by: Ronny Birkeli <ronny.birkeli@digdir.no>

* chore(deps): update nuget non-major dependencies (#254)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency jwtcookieauthentication to v3 (#258)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update nuget non-major dependencies (#270)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com>

* Feat/add instance selection options to appmetadata (#271)

* Add instance selection option to appmetadata

* update test to use new OnEntry class

* Fix obsolete method in IAppResources

* newlines cleanup

---------

Co-authored-by: Vemund Gaukstad <tjololo@users.noreply.github.com>

* Add defaultRowsPerPage option to InstanceSelection (#272)

* add defaultRowsPerPage option to InstanceSelection

* remove pagination class

* chore(deps): update nuget non-major dependencies (#274)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Mark onEntry as nullable and add check for null (#279)

* Introduce new option for default selected pages per row (#280)

* Introduce new option for default selected pages per row

* fix codesmells

* chore(deps): update nuget non-major dependencies (#281)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fixed missing await statement (#282)

* Fixed missing await statement

* Changed from array to string

---------

Co-authored-by: Ronny Birkeli <ronny.birkeli@digdir.no>

* Fix bug in 7.13.0 where anonymous statlessapps does not allow anonymous users even if configured (#283)

* Sync backend expression functions with frontend (#277)

* Implement missing functions in backend

* add some testcases for functions that should be evaluated before implemented in the backend code

* Simplify some functions

* last sync changes from main

* update some testfiles

* fix some codesmells

---------

Co-authored-by: Ronny Birkeli <ronny.birkeli@gmail.com>
Co-authored-by: Ronny Birkeli <ronny.birkeli@digdir.no>
Co-authored-by: Magnus Revheim Martinsen <mrmartinsen.96@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Label Pull requests with bugfix. Used when generation releasenotes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants