Android: old host name out of the pinned-root config and the S-1 fixture
- Pinned-root network security config (D-082) is now a template in app/src/releasePinnedRoot/; with kvitt.tls.pinnedRoot=true the task generatePinnedRootNetworkSecurityConfig writes it into the release resources with the domain kvitt.publicHost (D-121), and stops with a clear message while the root src/release/res/raw/kvitt_root_ca.crt is not committed (fallback unprepared, SPEC 10.5.3). Comment: pinned NPM root (D-120). - Port 443 (D-124): RELEASE_SERVER_URL is https://<kvitt.publicHost> without a port (RELEASE_SERVER_PORT removed); the AC-2.6 intent filter has no android:port; InviteLink drops an explicit default port. - S-1 fixture GOLDEN_SERVER https://kvitt.example.org; 28 S-1 goldens re-recorded (only the server row changed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
+5
-2
@@ -45,8 +45,10 @@ object InviteLink {
|
||||
val segments = path.trim('/').split('/')
|
||||
if (segments.size != 2 || segments[0] != "i") return null
|
||||
val code = code(segments[1]) ?: return null
|
||||
val port = if (uri.port == -1) "" else ":${uri.port}"
|
||||
return PastedInvite(code, "${uri.scheme.lowercase()}://${uri.host}$port", adminName(uri.rawQuery?.let(::params)?.get(FROM)))
|
||||
val scheme = uri.scheme.lowercase()
|
||||
// An explicit default port is dropped, so `https://<host>:443/i/…` names the release server `https://<host>`.
|
||||
val port = if (uri.port == -1 || uri.port == DEFAULT_PORTS[scheme]) "" else ":${uri.port}"
|
||||
return PastedInvite(code, "$scheme://${uri.host}$port", adminName(uri.rawQuery?.let(::params)?.get(FROM)))
|
||||
}
|
||||
|
||||
/** The first value of each key; a value that is not valid percent-encoding is dropped. */
|
||||
@@ -67,6 +69,7 @@ object InviteLink {
|
||||
}
|
||||
|
||||
private const val FROM = "from"
|
||||
private val DEFAULT_PORTS = mapOf("https" to 443, "http" to 80)
|
||||
|
||||
/** The normalised code when [text] normalises to exactly 12 alphabet characters (§8.3), else null. */
|
||||
private fun code(text: String): String? {
|
||||
|
||||
+4
-6
@@ -4,14 +4,12 @@ import java.net.URI
|
||||
import java.net.URISyntaxException
|
||||
import javax.inject.Qualifier
|
||||
|
||||
/** The release server's port: the router forwards external 8443 to the TLS proxy (SPEC §10.1, D-120). */
|
||||
const val RELEASE_SERVER_PORT = 8443
|
||||
|
||||
/**
|
||||
* The release server of a public host name, `https://<host>:8443` (AC-2.7, D-121). `:app` builds it from its
|
||||
* `BuildConfig.PUBLIC_HOST` (the Gradle property `kvitt.publicHost`) and provides it as [ReleaseServerUrl].
|
||||
* The release server of a public host name, `https://<host>` on the default port 443, where NPM selects Kvitt by host
|
||||
* name (AC-2.7, D-121, D-124). `:app` builds it from its `BuildConfig.PUBLIC_HOST` (the Gradle property
|
||||
* `kvitt.publicHost`) and provides it as [ReleaseServerUrl].
|
||||
*/
|
||||
fun releaseServerUrl(publicHost: String): String = "https://$publicHost:$RELEASE_SERVER_PORT"
|
||||
fun releaseServerUrl(publicHost: String): String = "https://$publicHost"
|
||||
|
||||
/** The release server prefilled on S-1 (AC-2.7), `RELEASE_SERVER_URL` in `:app` (D-121). */
|
||||
@Qualifier
|
||||
|
||||
Reference in New Issue
Block a user