Commit f362c94e authored by MozLando's avatar MozLando
Browse files

Merge #6251



6251: Closes #6012: Run the FxA extension on non-prod servers r=csadilek a=eoger

Thanks to `GeckoPort.senderUrl`  exposing the content URL, we can now assert in `FxaWebChannelFeature` that a WebChannel message comes from the right content page.
This allows us to inject the extension content script in more FxA server instances while ensuring that a non-prod instance can mess up a prod-instance account data.
 


Co-authored-by: default avatarEdouard Oger <eoger@fastmail.com>
parents fcfcf621 4f73c139
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -382,6 +382,10 @@ class GeckoPort(
        return nativePort.name
    }

    override fun senderUrl(): String {
        return nativePort.sender.url
    }

    override fun disconnect() {
        nativePort.disconnect()
    }
+4 −0
Original line number Diff line number Diff line
@@ -382,6 +382,10 @@ class GeckoPort(
        return nativePort.name
    }

    override fun senderUrl(): String {
        return nativePort.sender.url
    }

    override fun disconnect() {
        nativePort.disconnect()
    }
+4 −0
Original line number Diff line number Diff line
@@ -302,6 +302,10 @@ class GeckoPort(
        return nativePort.name
    }

    override fun senderUrl(): String {
        return nativePort.sender.url
    }

    override fun disconnect() {
        nativePort.disconnect()
    }
+5 −0
Original line number Diff line number Diff line
@@ -305,6 +305,11 @@ abstract class Port(val engineSession: EngineSession? = null) {
     */
    abstract fun name(): String

    /**
     * Returns the URL of the port sender.
     */
    abstract fun senderUrl(): String

    /**
     * Disconnects this port.
     */
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ class WebExtensionTest {

            override fun disconnect() {}

            override fun senderUrl(): String {
                return "https://foo.bar"
            }

            override fun postMessage(message: JSONObject) { }
        }

Loading