Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uaa list-clients: json: cannot unmarshal string into Go struct field Client.resource_ids of type []string #38

Open
Houlistonm opened this issue Aug 29, 2019 · 4 comments

Comments

@Houlistonm
Copy link
Contributor

Houlistonm commented Aug 29, 2019

Version

$ uaa version
0.7.0 8b3ea1f

Command

uaa list-clients

Returns

An unknown error occurred while parsing response from https://uaa.run.markspcffoundry.com/oauth/clients?count=100&sortOrder=ascending&startIndex=1. Response was <18150 characters of redacted json>: json: cannot unmarshal string into Go struct field Client.resource_ids of type []string

The <18150 bytes of redacted json> is from me, not the uaa client.

If I take the 18150 characters of json and pipe through jq it processes successfully.
If I run the command a second time with the --verbose flag, and compare the json from that output to the json in the error message, it is a perfect match.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168193674

The labels on this github issue will be updated when the story is started.

@smatochkin
Copy link

  • According to UAA API specs, GET /oauth/clients/{client_id} should return resource_ids attribute as an Array.
  • Actual UAA implementations return resource_ids either as an array of strings or as a simple string.

Example of querying UAA v4.19.2:

$ uaa curl /oauth/clients|jq '.resources[]|select(.resource_ids|type == "string")'
{
  "scope": [
    "cloud_controller.admin",
    "cloud_controller.read",
    "cloud_controller.write",
    "openid",
    "zones.*.*",
    "zones.*.*.*",
    "zones.read",
    "zones.write",
    "scim.read"
  ],
  "client_id": "identity",
  "resource_ids": "none",
  "authorized_grant_types": [
    "authorization_code",
    "client_credentials",
    "refresh_token"
  ],
  "redirect_uri": [
    "REDACTED",
    "REDACTED*"
  ],
  "autoapprove": true,
  "authorities": [
    "zones.read",
    "zones.write",
    "scim.zones",
    "uaa.resource",
    "uaa.admin",
    "cloud_controller.admin"
  ],
  "lastModified": 1551175600000
}

So, even with uaa-cli is API compliant, it is not compatible with the actual UAA servers.

@Houlistonm
Copy link
Contributor Author

Just to follow up

$ uaa version
0.10.0 8626b94

OM/PAS = 2.8.5

Problem persists.

@shamus
Copy link

shamus commented Aug 11, 2020

Hello. The /oauth/clients api does have some quirks and I agree that this cli should handle those.

We don't have plans to start work on this CLI again at the moment, but if we do this issue will be addressed then.

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

No branches or pull requests

4 participants