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

11039 the api should return a 401 status code when a session is invalid #11658

Conversation

standeren
Copy link
Contributor

Description

Add a custom 401 delegation handler on the http client for the gitea service. The custom delegation handler checks if the response from the underlying gitea api is 401 when the appKeyToken is no longer valid and deletes all cookies.

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)

@standeren standeren linked an issue Nov 23, 2023 that may be closed by this pull request
@github-actions github-actions bot added solution/studio/designer Issues related to the Altinn Studio Designer solution. quality/testing Tests that are missing, needs to be created or could be improved. labels Nov 23, 2023
@standeren standeren force-pushed the 11039-the-api-should-return-a-401-status-code-when-a-session-is-invalid branch from 288d8e3 to 2033fcb Compare November 23, 2023 14:35
Copy link
Collaborator

@mirkoSekulic mirkoSekulic left a comment

Choose a reason for hiding this comment

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

Conceptually it is not ok to change the response code of the endpoint in the delegating handler that is used to call third-party service.

Just curious, when we're getting the invalid session? Seems like we're solving the issue for gitea session since solution lies in the delegating handler. Are we trying to solve the problem when user logs in from, for example 2 browsers?

…rom source control fetch remote changes method
@standeren standeren force-pushed the 11039-the-api-should-return-a-401-status-code-when-a-session-is-invalid branch from 416ee29 to 9168884 Compare November 27, 2023 13:03
@standeren standeren force-pushed the 11039-the-api-should-return-a-401-status-code-when-a-session-is-invalid branch from f873e70 to 1206f0f Compare November 27, 2023 13:23
@standeren standeren force-pushed the 11039-the-api-should-return-a-401-status-code-when-a-session-is-invalid branch from 91818f3 to b602ab5 Compare November 28, 2023 12:56
@standeren standeren merged commit f9e322b into master Nov 28, 2023
9 checks passed
@standeren standeren deleted the 11039-the-api-should-return-a-401-status-code-when-a-session-is-invalid branch November 28, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality/testing Tests that are missing, needs to be created or could be improved. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The API should return a 401 status code when a session is invalid
2 participants