Skip to content

Commit

Permalink
*: unify type of key and rangeEnd in AuthRoleRevokePermissionRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
mitake committed Mar 14, 2018
1 parent c541793 commit 752963b
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 260 deletions.
4 changes: 2 additions & 2 deletions Documentation/dev-guide/api_reference_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ Empty field.
| Field | Description | Type |
| ----- | ----------- | ---- |
| role | | string |
| key | | string |
| range_end | | string |
| key | | bytes |
| range_end | | bytes |



Expand Down
6 changes: 4 additions & 2 deletions Documentation/dev-guide/apispec/swagger/rpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1286,10 +1286,12 @@
"type": "object",
"properties": {
"key": {
"type": "string"
"type": "string",
"format": "byte"
},
"range_end": {
"type": "string"
"type": "string",
"format": "byte"
},
"role": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions auth/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ func TestRoleRevokePermission(t *testing.T) {

_, err = as.RoleRevokePermission(&pb.AuthRoleRevokePermissionRequest{
Role: "role-test-1",
Key: "Keys",
RangeEnd: "RangeEnd",
Key: []byte("Keys"),
RangeEnd: []byte("RangeEnd"),
})
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion clientv3/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (auth *auth) RoleList(ctx context.Context) (*AuthRoleListResponse, error) {
}

func (auth *auth) RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) {
resp, err := auth.remote.RoleRevokePermission(ctx, &pb.AuthRoleRevokePermissionRequest{Role: role, Key: key, RangeEnd: rangeEnd}, auth.callOpts...)
resp, err := auth.remote.RoleRevokePermission(ctx, &pb.AuthRoleRevokePermissionRequest{Role: role, Key: []byte(key), RangeEnd: []byte(rangeEnd)}, auth.callOpts...)
return (*AuthRoleRevokePermissionResponse)(resp), toErr(ctx, err)
}

Expand Down
Loading

0 comments on commit 752963b

Please sign in to comment.