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

Comments

Projects
None yet
1 participant
@robert-bor
Member

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

Issue #33 - preparatory work for introducing an extra Access child (u…
…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

Issue #33 - set up a separate Access class if no tenant was passed. T…
…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

Issue #33 - preparatory work for introducing an extra Access child (u…
…sed 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

Issue #33 - set up a separate Access class if no tenant was passed. T…
…his 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