github.com/argoproj/argo-cd/v2@v2.10.9/server/account/account.proto (about) 1 syntax = "proto3"; 2 option go_package = "github.com/argoproj/argo-cd/v2/pkg/apiclient/account"; 3 4 // Account Service 5 // 6 // Account Service API updates Argo CD account settings 7 8 package account; 9 10 import "google/api/annotations.proto"; 11 12 message UpdatePasswordRequest { 13 string newPassword = 1; 14 string currentPassword = 2; 15 string name = 3; 16 } 17 18 message UpdatePasswordResponse {} 19 20 message CanIRequest { 21 string resource = 1; 22 string action = 2; 23 string subresource = 3; 24 } 25 26 message CanIResponse { 27 string value = 1; 28 } 29 30 message GetAccountRequest { 31 string name = 1; 32 } 33 34 message Account { 35 string name = 1; 36 bool enabled = 2; 37 repeated string capabilities = 3; 38 repeated Token tokens = 4; 39 } 40 41 message AccountsList { 42 repeated Account items = 1; 43 } 44 45 message Token { 46 string id = 1; 47 int64 issuedAt = 2; 48 int64 expiresAt = 3; 49 } 50 51 message TokensList { 52 repeated Token items = 1; 53 } 54 55 message CreateTokenRequest { 56 string name = 1; 57 // expiresIn represents a duration in seconds 58 int64 expiresIn = 2; 59 string id = 3; 60 } 61 62 message CreateTokenResponse { 63 string token = 1; 64 } 65 66 message DeleteTokenRequest { 67 string name = 1; 68 string id = 2; 69 } 70 71 message ListAccountRequest { 72 } 73 74 message EmptyResponse {} 75 76 service AccountService { 77 78 // CanI checks if the current account has permission to perform an action 79 rpc CanI(CanIRequest) returns (CanIResponse) { 80 option (google.api.http).get = "/api/v1/account/can-i/{resource}/{action}/{subresource=**}"; 81 } 82 83 // UpdatePassword updates an account's password to a new value 84 rpc UpdatePassword(UpdatePasswordRequest) returns (UpdatePasswordResponse) { 85 option (google.api.http) = { 86 put: "/api/v1/account/password" 87 body: "*" 88 }; 89 } 90 91 // ListAccounts returns the list of accounts 92 rpc ListAccounts(ListAccountRequest) returns (AccountsList) { 93 option (google.api.http).get = "/api/v1/account"; 94 } 95 96 // GetAccount returns an account 97 rpc GetAccount(GetAccountRequest) returns (Account) { 98 option (google.api.http).get = "/api/v1/account/{name}"; 99 } 100 101 // CreateToken creates a token 102 rpc CreateToken(CreateTokenRequest) returns (CreateTokenResponse) { 103 option (google.api.http) = { 104 post: "/api/v1/account/{name}/token" 105 body: "*" 106 }; 107 } 108 109 // DeleteToken deletes a token 110 rpc DeleteToken(DeleteTokenRequest) returns (EmptyResponse) { 111 option (google.api.http).delete = "/api/v1/account/{name}/token/{id}"; 112 } 113 }