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

Make JOSS able to deal with ambiguous serviceCatalog elements #33

Closed
robert-bor opened this issue May 14, 2013 · 0 comments
Closed

Make JOSS able to deal with ambiguous serviceCatalog elements #33

robert-bor opened this issue May 14, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@robert-bor
Copy link
Contributor

@robert-bor robert-bor commented May 14, 2013

When no tenantId and/or tenantName is passed, the access object returned by Keystone will contain an empty serviceCatalog element.

The serviceCatalog element is supposed to be an array. This is true as long as the serviceCatalog has elements.

However, when the serviceCatalog has no elements, this can be different:

  • in some cases it becomes a map (curly brackets)
  • in some cases it becomes an array (square brackets)

Jackson understandably cannot deal with this ambiguity.

The concept solution is to have a different child class for Access that is only used when no tenant is supplied. In this case, the serviceCatalog is not added as a serializable field.

Example with an empty map:

{
    "access": {
        "token": {
            "expires": "2013-05-13T10:06:25Z",
            "id": "********"
        },
        "serviceCatalog": {},
        "user": {
            "username": "********",
            "roles_links": [],
            "id": "********",
            "roles": [],
            "name": "********"
        }
    }
}

Example with an empty array:

{
    "access": {
        "token": {
            "issued_at": "2013-05-12T10:09:31.816711",
            "expires": "2013-05-13T10:09:31Z",
            "id": "********"
        },
        "serviceCatalog": [],
        "user": {
            "username": "********",
            "roles_links": [],
            "id": "********",
            "roles": [],
            "name": "********"
        },
        "metadata": {
            "is_admin": 0,
            "roles": []
        }
    }
}
@ghost ghost assigned robert-bor May 14, 2013
robert-bor added a commit that referenced this issue May 20, 2013
…sed in case no tenant is supplied). Access interface is now used everywhere instead of AccessImpl.
robert-bor added a commit that referenced this issue May 20, 2013
…his class does not parse the service catalog, which is the 'featured' problem containing the curly/square bracket ambiguity
@robert-bor robert-bor closed this May 20, 2013
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
… child (used in case no tenant is supplied). Access interface is now used everywhere instead of AccessImpl.
katta pushed a commit to twxkit/joss that referenced this issue Oct 6, 2014
…passed. This class does not parse the service catalog, which is the 'featured' problem containing the curly/square bracket ambiguity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.