AvdLee / appstoreconnect-swift-sdk

The Swift SDK to work with the App Store Connect API from Apple.
Other
1.48k stars 198 forks source link

Support individual keys in SDK #279

Closed polpielladev closed 4 months ago

polpielladev commented 4 months ago

Currently, the SDK only supports team keys, but the App Store Connect API offers the possibility of creating and using individual keys with the same permissions as the user to authenticate requests.

Individual keys do not have the iss field in the JWT's payload but they instead have a sub field: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests#4313913. This PR makes backwards-compatible changes to allow developers to authenticate requests with an individual API key.

SwiftLeeBot commented 4 months ago
Warnings
:warning: 'InAppPurchases' is deprecated: Deprecated
:warning: 'InAppPurchases' is deprecated: Deprecated
:warning: 'Builds' is deprecated: Deprecated
:warning: 'Builds' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'InAppPurchase' is deprecated: Deprecated
:warning: 'GameCenterEnabledVersion' is deprecated: Deprecated
:warning: 'AgeRatingDeclaration' is deprecated: Deprecated
:warning: 'AgeRatingDeclaration' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionSubmission' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionSubmission' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'InAppPurchase' is deprecated: Deprecated
:warning: 'GameCenterEnabledVersion' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AgeRatingDeclaration' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'InAppPurchases' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppStoreVersionSubmission' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'InAppPurchase' is deprecated: Deprecated
:warning: 'GameCenterEnabledVersion' is deprecated: Deprecated
:warning: 'Builds' is deprecated: Deprecated
:warning: 'AppStoreVersionSubmission' is deprecated: Deprecated
:warning: 'AppStoreVersionExperiment' is deprecated: Deprecated
:warning: 'AppPreOrder' is deprecated: Deprecated
:warning: 'InAppPurchase' is deprecated: Deprecated
:warning: 'GameCenterEnabledVersion' is deprecated: Deprecated
Messages
:book: AppStoreConnect-Swift-SDK-Tests: Executed 17 tests (0 failed, 0 retried, 0 skipped) in 0.238 seconds
:book: View more details on Bitrise

Code Coverage Report

Name Coverage

SwiftLint found issues

Severity File Reason
Warning JWT.swift:95 Variable declarations should be separated from other statements by a blank line (let_var_whitespace)
Warning JWT.swift:42 Line should be 140 characters or less; currently it has 141 characters (line_length)
Warning JWT.swift:60 Line should be 140 characters or less; currently it has 141 characters (line_length)
Warning JWT.swift:105 Line should be 140 characters or less; currently it has 143 characters (line_length)
Warning JWT.swift:9 Imports should be sorted (sorted_imports)
Warning JWT.swift:130 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:95 Line should be 140 characters or less; currently it has 142 characters (line_length)
Warning APIProvider.swift:78 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning APIProvider.swift:138 Use shorthand syntax for optional binding (shorthand_optional_binding)
Warning APIProvider.swift:50 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:69 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:91 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:206 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:312 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:342 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:363 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:380 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:390 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:406 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:419 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:430 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:440 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:448 Lines should not have trailing whitespace (trailing_whitespace)
Warning APIProvider.swift:168 Parentheses are not needed when declaring closure arguments (unneeded_parentheses_in_closure_argument)

Generated by :no_entry_sign: Danger Swift against b20f100d200bf4b77681417a49a233753c1d751b

polpielladev commented 4 months ago

Ideally, we would write tests for this too to ensure nothing breaks in the future. ~Since you're now Indie, I guess you have time for that? ;-P~ I'm accepting to at least unblock you for now!

Good point, I will make sure I add some tests in a future PR 👍