mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
Expose apiKey on Purchases via @_spi(Internal) (#6635)
Adapter modules that import the SDK with `@_spi(Internal) import RevenueCat` (e.g. `RevenueCatAdMob`) need to read the configured public API key when constructing payloads such as the AdMob SSV `customRewardString`. - Store the API key on `SystemInfo` and wire it through `Purchases` init. - Add `@_spi(Internal) public var apiKey: String` on `Purchases`. - Add a Swift API tester case so any future signature change is caught. - Add a unit test verifying the accessor returns the configured key. The key is already public plaintext in the app binary, so exposing it as SPI does not introduce any new security risk.
This commit is contained in:
1 parent
4b94128374
commit
a59ca8f4ea
17 files changed
+64
-31
No files matched your search
@@ -23,7 +23,6 @@ class HTTPClient {
|
||||
|
||||
let systemInfo: SystemInfo
|
||||
let timeout: TimeInterval
|
||||
let apiKey: String
|
||||
let authHeaders: RequestHeaders
|
||||
|
||||
private let session: URLSession
|
||||
@@ -43,8 +42,7 @@ class HTTPClient {
|
||||
TimeInterval(3)
|
||||
]
|
||||
|
||||
init(apiKey: String,
|
||||
systemInfo: SystemInfo,
|
||||
init(systemInfo: SystemInfo,
|
||||
eTagManager: ETagManager,
|
||||
signing: SigningType,
|
||||
diagnosticsTracker: DiagnosticsTrackerType?,
|
||||
@@ -70,8 +68,7 @@ class HTTPClient {
|
||||
self.dnsChecker = dnsChecker
|
||||
self.retriableStatusCodes = retriableStatusCodes
|
||||
self.timeout = requestTimeout
|
||||
self.apiKey = apiKey
|
||||
self.authHeaders = HTTPClient.authorizationHeader(withAPIKey: apiKey)
|
||||
self.authHeaders = HTTPClient.authorizationHeader(withAPIKey: systemInfo.apiKey)
|
||||
self.dateProvider = dateProvider
|
||||
self.operationDispatcher = operationDispatcher
|
||||
self.requestTimeoutManager = timeoutManager ?? HTTPRequestTimeoutManager(
|
||||
|
||||
Reference in new issue
Block a user