William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package etcdserverpb; |
| 3 | |
| 4 | import "gogoproto/gogo.proto"; |
| 5 | import "etcdserver.proto"; |
| 6 | import "rpc.proto"; |
| 7 | |
| 8 | option (gogoproto.marshaler_all) = true; |
| 9 | option (gogoproto.sizer_all) = true; |
| 10 | option (gogoproto.unmarshaler_all) = true; |
| 11 | option (gogoproto.goproto_getters_all) = false; |
| 12 | |
| 13 | message RequestHeader { |
| 14 | uint64 ID = 1; |
| 15 | // username is a username that is associated with an auth token of gRPC connection |
| 16 | string username = 2; |
| 17 | // auth_revision is a revision number of auth.authStore. It is not related to mvcc |
| 18 | uint64 auth_revision = 3; |
| 19 | } |
| 20 | |
| 21 | // An InternalRaftRequest is the union of all requests which can be |
| 22 | // sent via raft. |
| 23 | message InternalRaftRequest { |
| 24 | RequestHeader header = 100; |
| 25 | uint64 ID = 1; |
| 26 | |
| 27 | Request v2 = 2; |
| 28 | |
| 29 | RangeRequest range = 3; |
| 30 | PutRequest put = 4; |
| 31 | DeleteRangeRequest delete_range = 5; |
| 32 | TxnRequest txn = 6; |
| 33 | CompactionRequest compaction = 7; |
| 34 | |
| 35 | LeaseGrantRequest lease_grant = 8; |
| 36 | LeaseRevokeRequest lease_revoke = 9; |
| 37 | |
| 38 | AlarmRequest alarm = 10; |
| 39 | |
| 40 | LeaseCheckpointRequest lease_checkpoint = 11; |
| 41 | |
| 42 | AuthEnableRequest auth_enable = 1000; |
| 43 | AuthDisableRequest auth_disable = 1011; |
| 44 | |
| 45 | InternalAuthenticateRequest authenticate = 1012; |
| 46 | |
| 47 | AuthUserAddRequest auth_user_add = 1100; |
| 48 | AuthUserDeleteRequest auth_user_delete = 1101; |
| 49 | AuthUserGetRequest auth_user_get = 1102; |
| 50 | AuthUserChangePasswordRequest auth_user_change_password = 1103; |
| 51 | AuthUserGrantRoleRequest auth_user_grant_role = 1104; |
| 52 | AuthUserRevokeRoleRequest auth_user_revoke_role = 1105; |
| 53 | AuthUserListRequest auth_user_list = 1106; |
| 54 | AuthRoleListRequest auth_role_list = 1107; |
| 55 | |
| 56 | AuthRoleAddRequest auth_role_add = 1200; |
| 57 | AuthRoleDeleteRequest auth_role_delete = 1201; |
| 58 | AuthRoleGetRequest auth_role_get = 1202; |
| 59 | AuthRoleGrantPermissionRequest auth_role_grant_permission = 1203; |
| 60 | AuthRoleRevokePermissionRequest auth_role_revoke_permission = 1204; |
| 61 | } |
| 62 | |
| 63 | message EmptyResponse { |
| 64 | } |
| 65 | |
| 66 | // What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? |
| 67 | // InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. |
| 68 | // For avoiding misusage the field, we have an internal version of AuthenticateRequest. |
| 69 | message InternalAuthenticateRequest { |
| 70 | string name = 1; |
| 71 | string password = 2; |
| 72 | |
| 73 | // simple_token is generated in API layer (etcdserver/v3_server.go) |
| 74 | string simple_token = 3; |
| 75 | } |