Implied Roles responses do not match the spec

Bug #1563113 reported by Sean Perry on 2016-03-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Wishlist
Sean Perry

Bug Description

http --pretty format PUT https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88/implies/edd42085d3ab472e9cf13b3cf3c362b6 "X-Auth-Token:4879c74089b744439057581c9d85bc19"

    {
        "role_inference": {
            "implies": {
                "id": "edd42085d3ab472e9cf13b3cf3c362b6",
                "links": {
                    "self": "https://identity.example.com:35357/v3/roles/edd42085d3ab472e9cf13b3cf3c362b6"
                },
                "name": "SomeRole1"
            },
            "prior_role": {
                "id": "5a912666c3704c22a20d4c35f3068a88",
                "links": {
                    "self": "https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88"
                },
                "name": "testing"
            }
        }
    }

https://github.com/openstack/keystone-specs/blob/master/api/v3/identity-api-v3.rst#create-role-inference-rule

    {
        "role_inference": {
            "prior_role": {
                "id": "--prior-role-id--",
                "links": {
                    "self": "http://identity:35357/v3/roles/--prior-role-id--"
                }
                "name": "prior role name"
            },
            "implies":
                {
                    "id": "--implied-role1-id--",
                    "link": {
                        "self": "http://identity:35357/v3/roles/--implied-role1-id--"
                    },
                    "name": "implied role1 name"
                }
        },
    }

Note missing comma and s/links/link/. Also, json is usually output in sorted order.

http --pretty format GET https://identity.example.com:35357/v3/role_inferences "X-Auth-Token:4879c74089b744439057581c9d85bc19"

    {
        "role_inferences": [
            {
                "implies": [
                    {
                        "id": "edd42085d3ab472e9cf13b3cf3c362b6",
                        "links": {
                            "self": "https://identity.example.com:35357/v3/roles/edd42085d3ab472e9cf13b3cf3c362b6"
                        },
                        "name": "SomeRole1"
                    }
                ],
                "prior_role": {
                    "id": "5a912666c3704c22a20d4c35f3068a88",
                    "links": {
                        "self": "https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88"
                    },
                    "name": "testing"
                }
            }
        ]
    }

https://github.com/openstack/keystone-specs/blob/master/api/v3/identity-api-v3.rst#list-all-role-inference-rules

Again, s/link/links/. No missing comma though.

http --pretty format GET https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88/implies/edd42085d3ab472e9cf13b3cf3c362b6 "X-Auth-Token:4879c74089b744439057581c9d85bc19"

    {
        "role_inference": {
            "implies": {
                "id": "edd42085d3ab472e9cf13b3cf3c362b6",
                "links": {
                    "self": "https://identity.example.com:35357/v3/roles/edd42085d3ab472e9cf13b3cf3c362b6"
                },
                "name": "SomeRole1"
            },
            "prior_role": {
                "id": "5a912666c3704c22a20d4c35f3068a88",
                "links": {
                    "self": "https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88"
                },
                "name": "testing"
            }
        }
    }

https://github.com/openstack/keystone-specs/blob/master/api/v3/identity-api-v3.rst#get-role-inference-rule

According to the spec, there is no "role_inference" wrapper here. Also, a top level "links". There is also a missing comma but the 'links' for implies is correct (only place this is true).

http --pretty format GET https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88/implies "X-Auth-Token:4879c74089b744439057581c9d85bc19"

    {
        "role_inference": {
            "implies": [
                {
                    "id": "edd42085d3ab472e9cf13b3cf3c362b6",
                    "links": {
                        "self": "https://identity.example.com:35357/v3/roles/edd42085d3ab472e9cf13b3cf3c362b6"
                    },
                    "name": "SomeRole1"
                }
            ],
            "prior_role": {
                "id": "5a912666c3704c22a20d4c35f3068a88",
                "links": {
                    "self": "https://identity.example.com:35357/v3/roles/5a912666c3704c22a20d4c35f3068a88"
                },
                "name": "testing"
            }
        }
    }

https://github.com/openstack/keystone-specs/blob/master/api/v3/identity-api-v3.rst#list-implied-roles-for-role

This says there will also be a "links" key under role_inference (which is wrong). Also, continued failure of s/link/links/.

Steve Martinelli (stevemar) wrote :

Looks like the spec has a few minor issues, let's fix them up.

Changed in keystone:
status: New → Triaged
importance: Undecided → Wishlist

Fix proposed to branch: master
Review: https://review.openstack.org/298925

Changed in keystone:
assignee: nobody → Sean Perry (sean-perry-a)
status: Triaged → In Progress
Changed in keystone:
milestone: none → newton-1

Reviewed: https://review.openstack.org/298925
Committed: https://git.openstack.org/cgit/openstack/keystone-specs/commit/?id=a2d175502e686b379233ae903ecb4cddade16ebc
Submitter: Jenkins
Branch: master

commit a2d175502e686b379233ae903ecb4cddade16ebc
Author: Sean Perry <email address hidden>
Date: Tue Mar 29 11:28:14 2016 -0700

    Cleanup 'implied roles' section of Identity API V3 spec

    Replace 'link' with 'links'
    Cleanup comma usage
    Cleanup brace indentation and placement
    Remove incorrect extra 'links'
    Ensure that the output for GET implied role is wrapped in 'role_inference'

    Change-Id: Ie6787c1d81a0fa20bcd4f883b68d15fda7e6ca2f
    Closes-Bug: 1563113

Changed in keystone:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers