Move SSD remote endpoint wrapper to typed Kotlin
ober
894c0eabf980c9489f7ceae8b3169b348f6ac800
--- a/templates/ssd-review.ss +++ b/templates/ssd-review.ss @@ -759,7 +759,7 @@ (typed-kotlin-file "com/sfb/ssdreview/NetworkSafety.kt" (typed-library (com sfb ssdreview) - (export normalizeRemoteEndpointValue localTruthHttpAllowed) + (export normalizeRemoteEndpointValue normalizeRemoteEndpoint localTruthHttpAllowed) (def (normalizeRemoteEndpointValue (value : String) (defaultEndpoint : String)) : String (let ((trimmed (string-trim value))) (let ((base (if (string-blank? trimmed) defaultEndpoint trimmed))) @@ -776,6 +776,8 @@ (if (string-ends-with? stripped "/api") endpoint (string-append stripped "/api")))))))) + (def (normalizeRemoteEndpoint (value : String)) : String + (normalizeRemoteEndpointValue value "https://10.66.60.2:8797/api")) (def (localTruthHttpAllowed (host : String)) : Bool (let ((lower (string-lowercase host))) (if (or (or (equal? lower "localhost") @@ -4323,10 +4325,6 @@ " return RemoteConfig(url, pin, token)" " }" "" - " private fun normalizeRemoteEndpoint(value: String): String {" - " return normalizeRemoteEndpointValue(value, DEFAULT_TRUTH_API_URL)" - " }" - "" " private fun remoteUrl(relative: String): URL {" " require(relative.isNotBlank() && !relative.startsWith('/') && !relative.contains(\"..\"))" " val config = remoteConfig ?: throw IllegalStateException(\"Remote SSD service is not locally configured\")"