appstoreconnect-swift-sdk icon indicating copy to clipboard operation
appstoreconnect-swift-sdk copied to clipboard

Invalid String value DEVELOPER_ID_APPLICATION_G2

Open vvorlov opened this issue 2 years ago • 1 comments

Problem

Apple API returns DEVELOPER_ID_APPLICATION_G2 as CertificateType that is not presented in the codebase.

Scenario

  1. Go to https://developer.apple.com/account/resources/profiles/add
  2. Generate Developer ID. Create a Developer ID provisioning profile to use Apple services with your Developer ID signed applications.
  3. Run command
asc profiles list \
    --api-issuer XXX \
    --api-key-id XXX \
    --filter-name "test" \
    --filter-profile-state active \
    --filter-profile-type "mac_app_direct" \
    --download-path ~/Library/MobileDevice/Provisioning\ Profiles

Expected behavior

Profiles downloaded to the folder.

Actual behavior

Error: Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "included", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "attributes", intValue: nil), CodingKeys(stringValue: "certificateType", intValue: nil)], debugDescription: "Cannot initialize CertificateType from invalid String value DEVELOPER_ID_APPLICATION_G2", underlyingError: nil)).

Response

      ...
   "included" : [ {
       "type" : "certificates",
       "id" : "XXX",
       "attributes" : {
         "serialNumber" : "XXXX",
         "certificateContent" : "XXX",
         "displayName" : "XXX LLC",
         "name" : "Developer ID Application: XXX LLC",
         "csrContent" : null,
         "platform" : "MAC_OS",
         "expirationDate" : "2028-08-17T14:31:40.000+00:00",
         "certificateType" : "DEVELOPER_ID_APPLICATION_G2"
   },
   "relationships" : {

vvorlov avatar Dec 04 '23 18:12 vvorlov

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Jan 04 '24 00:01 github-actions[bot]

I've just hit this too, annoyingly it seems that Apple don't have this value in their OpenAPI spec. That just contains...

"enum" : [ "IOS_DEVELOPMENT", "IOS_DISTRIBUTION", "MAC_APP_DISTRIBUTION", "MAC_INSTALLER_DISTRIBUTION", "MAC_APP_DEVELOPMENT", "DEVELOPER_ID_KEXT", "DEVELOPER_ID_APPLICATION", "DEVELOPMENT", "DISTRIBUTION", "PASS_TYPE_ID", "PASS_TYPE_ID_WITH_NFC" ]

...and is missing DEVELOPER_ID_APPLICATION_G2

Workshed avatar Apr 01 '24 16:04 Workshed