8000 Bug: 'users' command can't decode the response with certain "Additional Resources" · Issue #259 · ittybittyapps/appstoreconnect-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Bug: 'users' command can't decode the response with certain "Additional Resources" #259
Open
@roseyuanzhang

Description

@roseyuanzhang

🌎 Environment

  • OS: macOS 13.3.1
  • Version/Release: master as of [cbe6b1e]

💬 Description

'users' command can't decode the response when the user role has certain "Additional Resources". So far the "Create Apps" and "Access to Cloud Managed Developer ID Certificate" are the two giving me errors.

🦶 Reproduction Steps for "Create Apps" Additional Resources

  1. A user has the "Developer" role, and "Create Apps" as "Additional Resources" in the AppStoreConnect UI.
  2. Run this $ asc users info --api-issuer <issuer-id> --api-key-id <key-id> -v <user-email>

🤔 Expected Results

+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| Username                 | First Name | Last Name | Role      | Provisioning Allowed | All Apps Visible | Visible Apps |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| myname@gmail.com | Firstname       | Lastname     | DEVELOPER, CREATE_APPS | No                   | Yes              |              |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+

😲 Actual Results

(Removed the PII from console output)

Error: Failed to decode response:
{
  "data" : [ {
    "type" : "users",
    "id" : "########-####-####-####-############",
    "attributes" : {
      "username" : "myname@gmail.com",
      "firstName" : "Firstname",
      "lastName" : "Lastname",
      "roles" : [ "DEVELOPER", "CREATE_APPS" ],
      "allAppsVisible" : true,
      "provisioningAllowed" : false
    },
    "relationships" : {
      "visibleApps" : {
        "links" : {
          "self" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############/relationships/visibleApps",
          "related" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############/visibleApps"
        }
      }
    },
    "links" : {
      "self" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############"
    }
  } ],
  "links" : {
    "self" : "https://api.appstoreconnect.apple.com/v1/users?filter%5Busername%5D=myname%40gmail.com"
  },
  "meta" : {
    "paging" : {
      "total" : 1,
      "limit" : 50
    }
  }
}
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "data", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "attributes", intValue: nil), CodingKeys(stringValue: "roles", intValue: nil), _JSONKey(stringValue: "Index 1", intValue: 1)], debugDescription: "Cannot initialize UserRole from invalid String value CREATE_APPS", underlyingError: nil)).

If I removed "Create_Apps" from the AppStoreConnect UI, the same command will give me the correct output:

+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| Username                 | First Name | Last Name | Role      | Provisioning Allowed | All Apps Visible | Visible Apps |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| myname@gmail.com | Firstname       | Lastname     | DEVELOPER | No                   | Yes              |              |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+

🦶 Reproduction Steps for "Access to Cloud Managed Developer ID Certificate" Additional Resources

  1. A user has the "Admin" role, and all the choices are checked under "Additional Resources" in the AppStoreConnect UI. I'm not sure how it gets checked for "Access to Cloud Managed Developer ID Certificate" in the first place, as if I remove the "Admin" role and then add the "Admin" role back, I can't manually check the "Access to Cloud Managed Developer ID Certificate" from the AppStoreConnect UI (it grayed out).
  2. Run this $ asc users info --api-issuer <issuer-id> --api-key-id <key-id> -v <user-email>

🤔 Expected Results

+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| Username                 | First Name | Last Name | Role      | Provisioning Allowed | All Apps Visible | Visible Apps |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| myname@gmail.com   | Firstname       | Lastname     | ADMIN,CLOUD_MANAGED_DEVELOPER_ID | No                   | Yes              |              |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+

😲 Actual Results

(Removed the PII from console output)

Error: Failed to decode response:
{
  "data" : [ {
    "type" : "users",
    "id" : "########-####-####-####-############",
    "attributes" : {
      "username" : "email@domain.com",
      "firstName" : "Firstname",
      "lastName" : "Lastname",
      "roles" : [ "ADMIN", "CLOUD_MANAGED_DEVELOPER_ID" ],
      "allAppsVisible" : true,
      "provisioningAllowed" : true
    },
    "relationships" : {
      "visibleApps" : {
        "links" : {
          "self" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############/relationships/visibleApps",
          "related" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############/visibleApps"
        }
      }
    },
    "links" : {
      "self" : "https://api.appstoreconnect.apple.com/v1/users/########-####-####-####-############"
    }
  } ],
  "links" : {
    "self" : "https://api.appstoreconnect.apple.com/v1/users?filter%5Busername%5D=email%40domain.com"
  },
  "meta" : {
    "paging" : {
      "total" : 1,
      "limit" : 50
    }
  }
}
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "data", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "attributes", intValue: nil), CodingKeys(stringValue: "roles", intValue: nil), _JSONKey(stringValue: "Index 1", intValue: 1)], debugDescription: "Cannot initialize UserRole from invalid String value CLOUD_MANAGED_DEVELOPER_ID", underlyingError: nil)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0