asc: expose ASCKey.makeJWT for direct REST calls
- Commit
8ab0a623adb10e6b2ee97b0261b5052dd8e59aae- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-18 15:58 UTC (17 days ago)
- Parents
aa93fdc
dist commands talk to App Store Connect endpoints the generated OpenAPI client does not cover (build uploads, review submissions), so they need the same ES256 JWT the middleware mints.
Diff
Sources/XKit/DeveloperServices/OpenAPI/ASCKey.swift
diff --git a/Sources/XKit/DeveloperServices/OpenAPI/ASCKey.swift b/Sources/XKit/DeveloperServices/OpenAPI/ASCKey.swiftindex 5cf7e01..96e5107 100644--- a/Sources/XKit/DeveloperServices/OpenAPI/ASCKey.swift+++ b/Sources/XKit/DeveloperServices/OpenAPI/ASCKey.swift@@ -99,3 +99,12 @@ extension Data { .replacingOccurrences(of: "=", with: "") } }++extension ASCKey {+ /// Mints a short-lived App Store Connect JWT (ES256) for direct REST+ /// calls (e.g. `xtool dist`), reusing the same signing logic as the+ /// OpenAPI middleware.+ public func makeJWT() async throws -> String {+ try await ASCJWTGenerator(key: self).generate()+ }+}