github.com/argoproj/argo-cd@v1.8.7/server/account/account.proto (about)

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