github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/auth/auth.proto (about) 1 syntax = "proto3"; 2 3 package auth; 4 5 option go_package = "github.com/tickoalcantara12/micro/v3/proto/auth;auth"; 6 7 service Auth { 8 rpc Generate(GenerateRequest) returns (GenerateResponse) {}; 9 rpc Inspect(InspectRequest) returns (InspectResponse) {}; 10 rpc Token(TokenRequest) returns (TokenResponse) {}; 11 } 12 13 service Accounts { 14 rpc List(ListAccountsRequest) returns (ListAccountsResponse) {}; 15 rpc Delete(DeleteAccountRequest) returns (DeleteAccountResponse) {}; 16 rpc ChangeSecret(ChangeSecretRequest) returns (ChangeSecretResponse) {}; 17 } 18 19 service Rules { 20 rpc Create(CreateRequest) returns (CreateResponse) {}; 21 rpc Delete(DeleteRequest) returns (DeleteResponse) {}; 22 rpc List(ListRequest) returns (ListResponse) {}; 23 } 24 25 message ListAccountsRequest { 26 Options options = 1; 27 } 28 29 message ListAccountsResponse { 30 repeated Account accounts = 1; 31 } 32 33 message DeleteAccountRequest { 34 string id = 1; 35 Options options = 2; 36 } 37 38 message DeleteAccountResponse {} 39 40 message Token { 41 string access_token = 1; 42 string refresh_token = 2; 43 int64 created = 3; 44 int64 expiry = 4; 45 } 46 47 message Account { 48 string id = 1; 49 string type = 2; 50 map<string, string> metadata = 4; 51 repeated string scopes = 5; 52 string issuer = 6; 53 string secret = 7; 54 string name = 8; 55 } 56 57 message Resource{ 58 string name = 1; 59 string type = 2; 60 string endpoint = 3; 61 } 62 63 message GenerateRequest { 64 string id = 1; 65 map<string, string> metadata = 3; 66 repeated string scopes = 4; 67 string secret = 5; 68 string type = 6; 69 string provider = 7; 70 Options options = 8; 71 string name = 9; 72 } 73 74 message GenerateResponse { 75 Account account = 1; 76 } 77 78 message GrantRequest { 79 string scope = 1; 80 Resource resource = 2; 81 Options options = 3; 82 } 83 84 message GrantResponse {} 85 86 message RevokeRequest { 87 string scope = 1; 88 Resource resource = 2; 89 Options options = 3; 90 } 91 92 message RevokeResponse {} 93 94 message InspectRequest { 95 string token = 1; 96 Options options = 2; 97 } 98 99 message InspectResponse { 100 Account account = 1; 101 } 102 103 message TokenRequest { 104 string id = 1; 105 string secret = 2; 106 string refresh_token = 3; 107 int64 token_expiry = 4; 108 Options options = 5; 109 } 110 111 message TokenResponse { 112 Token token = 1; 113 } 114 115 enum Access { 116 UNKNOWN = 0; 117 GRANTED = 1; 118 DENIED = 2; 119 } 120 121 message Rule { 122 string id = 1; 123 string scope = 2; 124 Resource resource = 3; 125 Access access = 4; 126 int32 priority = 5; 127 } 128 129 message Options { 130 string namespace = 1; 131 } 132 133 message CreateRequest { 134 Rule rule = 1; 135 Options options = 2; 136 } 137 138 message CreateResponse {} 139 140 message DeleteRequest { 141 string id = 1; 142 Options options = 2; 143 } 144 145 message DeleteResponse {} 146 147 message ListRequest { 148 Options options = 2; 149 } 150 151 message ListResponse { 152 repeated Rule rules = 1; 153 } 154 155 message ChangeSecretRequest{ 156 string id = 1; 157 string old_secret = 2; 158 string new_secret = 3; 159 Options options = 4; 160 } 161 162 message ChangeSecretResponse{}