From 8a38a043af3bfe8a118c743409ac2611e5a3330b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20De=CC=81fago?= Date: Thu, 12 Dec 2024 14:17:44 +0100 Subject: [PATCH] Prevent item creation from non-official service endpoints --- Sources/CoreBusiness/DataProvider/Server.swift | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Sources/CoreBusiness/DataProvider/Server.swift b/Sources/CoreBusiness/DataProvider/Server.swift index ba95efa5e..52ff036dd 100644 --- a/Sources/CoreBusiness/DataProvider/Server.swift +++ b/Sources/CoreBusiness/DataProvider/Server.swift @@ -26,15 +26,13 @@ public struct Server { private let baseUrl: URL private let queryItems: [URLQueryItem] - /// Creates a server with custom settings. + /// This API will be removed in a future Pillarbox release. Do not use. /// - /// - Parameters: - /// - baseUrl: The base URL of the server. - /// - queryItems: Additional query items to associate with each request. - /// - /// Useful for servers which can exactly pose as SRG SSR servers and deliver the same playback metadata format and - /// image scaling capabilities. + /// > Warning: This API will be removed in a future Pillarbox release. Do not use. public init(baseUrl: URL, queryItems: [URLQueryItem] = []) { + // FIXME: This initializer must be made private after SAM replaces the IL. The assertion must be removed at + // the same time. + assert(Bundle.main.bundleIdentifier!.hasPrefix("ch.srgssr.Pillarbox-demo"), "This API will be removed in a future Pillarbox release. Do not use.") self.baseUrl = baseUrl self.queryItems = queryItems }