-
Notifications
You must be signed in to change notification settings - Fork 2
Single logout via a small Swagger-UI plugin #1935
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1935 +/- ##
==========================================
- Coverage 93.06% 92.78% -0.29%
==========================================
Files 304 305 +1
Lines 3534 3546 +12
Branches 505 524 +19
==========================================
+ Hits 3289 3290 +1
- Misses 245 256 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f9ecac9 to
6909cfe
Compare
|
Argh: sdk$ ./gradlew generateSwaggerCode
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :generateSwaggerCodeTypescript FAILED
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
| Error count: 1, Warning count: 2
Errors:
-attribute components.securitySchemes.auth.logoutUrl is unexpected
Warnings:
-attribute components.securitySchemes.auth.logoutUrl is unexpected
at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateSwaggerCodeTypescript'.
> Process 'command '/usr/lib/jvm/java-17-openjdk-amd64/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 9s
4 actionable tasks: 3 executed, 1 up-to-date |
6909cfe to
8c9eea0
Compare
8c9eea0 to
f866b59
Compare
|
This push incorporates an acceptable extension to the security schema prefixed with |
To allow Keycloak logout from the OpenAPI documentation, this uses an OpenAPI plugin as a separate module. The reason for clean separation is inclusion of the "dom" module, which has no place in the node project except to be added to the `swagger-ui` browser code. Without this change, the logout only applies to the OpenAPI docs page and the PDC Keycloak session would remain. With this change, the logout really logs out of PDC Keycloak entirely. Issue #1915 Single logout from OpenAPI docs
f866b59 to
d5efa6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most changes here are due to the fully built OpenAPI plugin becoming a dependency of the main codebase.
|
Adding a test requires adding a new jest config with jsdom. |
|
@slifty While adapting the back-end codebase for essentially front-end code, I wonder if this would be a better fit as a front-end module. Or does the front-end assume too much about its modules? |
|
@bickelj did we end up moving this to it's own plugin outside of github? |
|
@slifty I left off at https://code.librehq.com/ots/swagger-ui-logout/-/tree/initial-project-setup?ref_type=heads - making an automated test seems disproportionately difficult for such a common operation (a window.location.href redirect). |
To allow Keycloak logout from the OpenAPI documentation, this uses an OpenAPI plugin as a separate module. The reason for clean separation is inclusion of the "dom" module, which has no place in the node project except to be added to the
swagger-uibrowser code. Without this change, the logout only applies to the OpenAPI docs page and the PDC Keycloak session would remain. With this change, the logout really logs out of PDC Keycloak entirely.Resolves #1915