William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package authpb; |
| 3 | |
| 4 | import "gogoproto/gogo.proto"; |
| 5 | |
| 6 | option (gogoproto.marshaler_all) = true; |
| 7 | option (gogoproto.sizer_all) = true; |
| 8 | option (gogoproto.unmarshaler_all) = true; |
| 9 | option (gogoproto.goproto_getters_all) = false; |
| 10 | option (gogoproto.goproto_enum_prefix_all) = false; |
| 11 | |
Abhilash S.L | 3b49463 | 2019-07-16 15:51:09 +0530 | [diff] [blame] | 12 | message UserAddOptions { |
| 13 | bool no_password = 1; |
| 14 | }; |
| 15 | |
William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 16 | // User is a single entry in the bucket authUsers |
| 17 | message User { |
| 18 | bytes name = 1; |
| 19 | bytes password = 2; |
| 20 | repeated string roles = 3; |
Abhilash S.L | 3b49463 | 2019-07-16 15:51:09 +0530 | [diff] [blame] | 21 | UserAddOptions options = 4; |
William Kurkian | ea86948 | 2019-04-09 15:16:11 -0400 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | // Permission is a single entity |
| 25 | message Permission { |
| 26 | enum Type { |
| 27 | READ = 0; |
| 28 | WRITE = 1; |
| 29 | READWRITE = 2; |
| 30 | } |
| 31 | Type permType = 1; |
| 32 | |
| 33 | bytes key = 2; |
| 34 | bytes range_end = 3; |
| 35 | } |
| 36 | |
| 37 | // Role is a single entry in the bucket authRoles |
| 38 | message Role { |
| 39 | bytes name = 1; |
| 40 | |
| 41 | repeated Permission keyPermission = 2; |
| 42 | } |