+
Skip to content

Refactor createLogoutUrl() to use standardized URL APIs #77

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

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

jonkoops
Copy link
Contributor

Closes #76

Closes keycloak#76

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops jonkoops requested review from a team and Copilot April 25, 2025 15:38
@jonkoops jonkoops self-assigned this Apr 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the creation of logout URLs to leverage standardized URL APIs. The changes include new tests for different logout scenarios, an updated TestExecutor method to expose createLogoutUrl, and modifications to the Keycloak library to use URLSearchParams for query parameter construction.

  • Added comprehensive tests for logout URL generation.
  • Introduced a createLogoutUrl method to the TestExecutor.
  • Updated Keycloak’s createLogoutUrl to construct query parameters using URLSearchParams.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/tests/logout-url.spec.ts Added tests to validate logout URL creation with different options.
test/support/test-executor.ts Introduced createLogoutUrl method leveraging page.evaluate.
lib/keycloak.js Refactored createLogoutUrl to use URLSearchParams for GET requests.
Comments suppressed due to low confidence (1)

lib/keycloak.js:489

  • While the use of URLSearchParams is a good improvement, consider using the URL constructor (e.g. new URL(url)) to build the logout URL and then update its search parameters. This may improve clarity and ensure proper URL encoding.
kc.createLogoutUrl = function(options) {

Copy link

@douglaspalmer douglaspalmer left a comment

Choose a reason for hiding this comment

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

LGTM

@jonkoops jonkoops merged commit dfd97da into keycloak:main Apr 25, 2025
4 checks passed
@jonkoops jonkoops deleted the standard-api-logout-url branch April 25, 2025 16:31
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.

Refactor createLogoutUrl() to use standardized URL APIs
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载