[PM-31954] Add server communication models to ConfigResponseJson (#6500)

This commit is contained in:
Patrick Honkonen
2026-02-10 08:17:34 -05:00
committed by GitHub
parent 5300386ce3
commit cf3660a5aa
9 changed files with 62 additions and 0 deletions

View File

@@ -7710,6 +7710,7 @@ class AuthRepositoryTest {
ssoUrl = "mockSsoUrl",
),
featureStates = emptyMap(),
communication = null,
),
)

View File

@@ -324,5 +324,6 @@ private val SERVER_CONFIG = ServerConfig(
"dummy-boolean" to JsonPrimitive(true),
"flexible-collections-v-1" to JsonPrimitive(false),
),
communication = null,
),
)

View File

@@ -54,5 +54,6 @@ private val SERVER_CONFIG = ServerConfig(
"flexible-collections-v-1" to JsonPrimitive(false),
"dummy-boolean" to JsonPrimitive(true),
),
communication = null,
),
)

View File

@@ -267,5 +267,6 @@ private val SERVER_CONFIG = ServerConfig(
"dummy-boolean" to JsonPrimitive(true),
"flexible-collections-v-1" to JsonPrimitive(false),
),
communication = null,
),
)

View File

@@ -54,5 +54,6 @@ private val SERVER_CONFIG = ServerConfig(
"flexible-collections-v-1" to JsonPrimitive(false),
"dummy-boolean" to JsonPrimitive(true),
),
communication = null,
),
)

View File

@@ -111,5 +111,6 @@ private val SERVER_CONFIG = ServerConfig(
"duo-redirect" to JsonPrimitive(true),
"flexible-collections-v-1" to JsonPrimitive(false),
),
communication = null,
),
)

View File

@@ -166,6 +166,7 @@ private val SERVER_CONFIG = ServerConfig(
"duo-redirect" to JsonPrimitive(true),
"flexible-collections-v-1" to JsonPrimitive(false),
),
communication = null,
),
)
@@ -189,4 +190,5 @@ private val CONFIG_RESPONSE_JSON = ConfigResponseJson(
"duo-redirect" to JsonPrimitive(true),
"flexible-collections-v-1" to JsonPrimitive(false),
),
communication = null,
)

View File

@@ -13,6 +13,7 @@ import kotlinx.serialization.json.JsonPrimitive
* @property server The server information (nullable).
* @property environment The environment information containing URLs (vault, api, identity, etc.).
* @property featureStates A map containing various feature states.
* @property communication The communication configuration for server bootstrap (nullable).
*/
@Serializable
data class ConfigResponseJson(
@@ -33,6 +34,9 @@ data class ConfigResponseJson(
@SerialName("featureStates")
val featureStates: Map<String, JsonPrimitive>?,
@SerialName("communication")
val communication: CommunicationJson?,
) {
/**
* Represents a server in the configuration response.
@@ -79,4 +83,38 @@ data class ConfigResponseJson(
@SerialName("sso")
val ssoUrl: String?,
)
/**
* Represents the communication configuration in the configuration response.
*
* @param bootstrap The bootstrap configuration for server communication (nullable).
*/
@Serializable
data class CommunicationJson(
@SerialName("bootstrap")
val bootstrap: BootstrapJson,
) {
/**
* Represents the bootstrap configuration for SSO cookie vendor authentication.
*
* @param type The type of bootstrap configuration (e.g., "ssoCookieVendor").
* @param idpLoginUrl The URL of the identity provider login page.
* @param cookieName The name of the authentication cookie.
* @param cookieDomain The domain for which the cookie is valid.
*/
@Serializable
data class BootstrapJson(
@SerialName("type")
val type: String,
@SerialName("idpLoginUrl")
val idpLoginUrl: String?,
@SerialName("cookieName")
val cookieName: String?,
@SerialName("cookieDomain")
val cookieDomain: String?,
)
}
}

View File

@@ -42,6 +42,14 @@ private const val CONFIG_RESPONSE_JSON = """
},
"featureStates": {
"feature one": false
},
"communication": {
"bootstrap": {
"type": "ssoCookieVendor",
"idpLoginUrl": "https://idp.example.com/login",
"cookieName": "sso-cookie",
"cookieDomain": ".example.com"
}
}
}
"""
@@ -64,4 +72,12 @@ private val CONFIG_RESPONSE = ConfigResponseJson(
featureStates = mapOf(
"feature one" to JsonPrimitive(false),
),
communication = ConfigResponseJson.CommunicationJson(
bootstrap = ConfigResponseJson.CommunicationJson.BootstrapJson(
type = "ssoCookieVendor",
idpLoginUrl = "https://idp.example.com/login",
cookieName = "sso-cookie",
cookieDomain = ".example.com",
),
),
)