Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski committed Oct 15, 2023
1 parent a4b92a0 commit 85f08a7
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,8 @@ open class AuthenticatedWebsite(
* @param context the `WebAppContext` to configure
*/
open fun configure(context: WebAppContext, addFilter: Boolean = true): WebAppContext {
// Create a ServletHolder for the GoogleLoginServlet and add it to the context
val googleServletHolder = ServletHolder("googleLogin", GoogleLoginServlet())
context.addServlet(googleServletHolder, "/googleLogin")
// Create a ServletHolder for the OAuth2CallbackServlet and add it to the context
val callbackServletHolder = ServletHolder("oauth2callback", OAuth2CallbackServlet())
context.addServlet(callbackServletHolder, "/oauth2callback")
// Add a SessionIdFilter to the context that intercepts every request
context.addServlet(ServletHolder("googleLogin", GoogleLoginServlet()), "/googleLogin")
context.addServlet(ServletHolder("oauth2callback", OAuth2CallbackServlet()), "/oauth2callback")
if(addFilter) context.addFilter(FilterHolder(SessionIdFilter()), "/*", EnumSet.of(DispatcherType.REQUEST))
return context
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ abstract class SkyenetMacroChat(
sessionUI: SessionUI,
sessionDiv: SessionDiv,
parameters: T,
feedbackFn: (msg: T, t: String) -> Unit,
fns: Map<String, (t: T) -> Unit>
feedbackFn: (msg: T, feedback: String) -> Unit,
fns: Map<String, (obj: T) -> Unit> = mapOf(),
toString: (obj: T) -> String = JsonUtil::toJson
) = sessionDiv.append(
"""
<pre>${JsonUtil.toJson(parameters)}</pre>
<pre>${toString(parameters)}</pre>
<br/>
${sessionUI.textInput { feedbackFn(parameters, it) }}
<br/>
Expand All @@ -129,6 +130,7 @@ abstract class SkyenetMacroChat(
}}
""", false
)

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream

abstract class SkyenetSessionServerBase(
val applicationName: String,
override val applicationName: String,
val oauthConfig: String? = null,
resourceBase: String = "simpleSession",
val baseURL: String = "http://localhost:8080",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import java.util.*

abstract class WebSocketServer(val resourceBase: String) {

abstract val applicationName: String

inner class NewSessionServlet : HttpServlet() {
override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) {
val sessionId = UUID.randomUUID().toString()
Expand Down
47 changes: 0 additions & 47 deletions webui/src/main/resources/simple/chat.css

This file was deleted.

56 changes: 0 additions & 56 deletions webui/src/main/resources/simple/chat.js

This file was deleted.

45 changes: 0 additions & 45 deletions webui/src/main/resources/simple/index.html

This file was deleted.

This file was deleted.

0 comments on commit 85f08a7

Please sign in to comment.