Skip to content

Bug: 'users' command can't decode the response with certain "Additional Resources"#259

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 |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| [email protected] | 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" : "[email protected]",
      "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 |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| [email protected] | 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 |
+--------------------------+------------+-----------+-----------+----------------------+------------------+--------------+
| [email protected]   | 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 protected]",
      "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)).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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