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/keycloak timeout #445

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Fix/keycloak timeout #445

wants to merge 12 commits into from

Conversation

MichalJura
Copy link
Collaborator

Your checklist for this pull request

  • [ x] I've read the contributing guideline.
  • [ x] I've tested my changes by building and running mquery, and testing changed functionality (if applicable)
  • I've added automated tests for my change (if applicable, optional)
  • I've updated documentation to reflect my change (if applicable)

What is the current behaviour?

Currently mquery does not revoke token by itself therefore forcing relogin.
Also after token expiration user is forced to log in even if instance allows anonymous access,
What is the new behaviour?

Test plan

Token is auto-refreshing itself now.
Also when the token expires, user get anonymous access.
Also User is not logged out so often.

Closing issues

fixes #411
fixes #425

@MichalJura MichalJura requested a review from msm-cert January 13, 2025 22:01
Comment on lines +5 to 6

import uvicorn # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import uvicorn # type: ignore
import uvicorn # type: ignore

"client_id": db.config.openid_client_id,
"client_secret": db.config.openid_secret,
}
url = "http://mquery-keycloak-1:8080/auth/realms/myrealm/protocol/openid-connect/token"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't be hardcoded - use url from config instead

@@ -70,6 +74,24 @@ def with_plugins() -> Iterable[PluginManager]:
plugins.cleanup()


def get_new_tokens(refresh_token):
Copy link
Member

Choose a reason for hiding this comment

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

Please add typing (I guess get_new_tokens(refresh_token: str) -> Tuple[str, str], but recheck)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants