caoyingjunz / pixiu

Pixiu is an open source container platform for cloud-native application management.
403 stars 187 forks source link

Add a group binding list API #538

Closed crazytaxii closed 3 weeks ago

crazytaxii commented 3 weeks ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add a group binding list API.

HTTP route: /pixiu/auth/binding HTTP method: GET

Does this PR introduce a user-facing change?

Calling this API like curl command here:

$ curl -s -H 'Authorization: Bearer '${token}'' -X GET  http://127.0.0.1:8090/pixiu/auth/binding?user_id=3&group_name=root | jq
{
  "code": 200,
  "result": [
    {
      "username": "foo",
      "groupname": "root"
    }
  ],
  "message": "success"
}

$ curl -s -H 'Authorization: Bearer '${token}'' -X GET  http://127.0.0.1:8090/pixiu/auth/binding?group_name=root | jq
{
  "code": 200,
  "result": [
    {
      "username": "foo",
      "groupname": "root"
    },
    {
      "username": "bar",
      "groupname": "root"
    },
    {
      "username": "baz",
      "groupname": "root"
    }
  ],
  "message": "success"
}