Skip to content

Commit

Permalink
fix: responses issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aoudiamoncef committed Jun 23, 2023
1 parent d69cff6 commit 3175620
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
34 changes: 31 additions & 3 deletions doc/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,13 @@ <h3 id="massa.api.v1.GetBootstrapBlacklistResponse">GetBootstrapBlacklistRespons
</thead>
<tbody>

<tr>
<td>id</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Request id </p></td>
</tr>

<tr>
<td>ips</td>
<td><a href="#string">string</a></td>
Expand Down Expand Up @@ -823,6 +830,13 @@ <h3 id="massa.api.v1.GetBootstrapWhitelistResponse">GetBootstrapWhitelistRespons
</thead>
<tbody>

<tr>
<td>id</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Request id </p></td>
</tr>

<tr>
<td>ips</td>
<td><a href="#string">string</a></td>
Expand Down Expand Up @@ -871,6 +885,13 @@ <h3 id="massa.api.v1.GetPeersWhitelistResponse">GetPeersWhitelistResponse</h3>
</thead>
<tbody>

<tr>
<td>id</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Request id </p></td>
</tr>

<tr>
<td>ips</td>
<td><a href="#string">string</a></td>
Expand Down Expand Up @@ -1064,6 +1085,13 @@ <h3 id="massa.api.v1.SignMessagesResponse">SignMessagesResponse</h3>
</thead>
<tbody>

<tr>
<td>id</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>Request id </p></td>
</tr>

<tr>
<td>public_key</td>
<td><a href="#string">string</a></td>
Expand Down Expand Up @@ -1103,14 +1131,14 @@ <h3 id="massa.api.v1.MassaPrivateService">MassaPrivateService</h3>
<td>AddToBootstrapBlacklist</td>
<td><a href="#massa.api.v1.AddToBootstrapBlacklistRequest">AddToBootstrapBlacklistRequest</a></td>
<td><a href="#massa.api.v1.AddToBootstrapBlacklistResponse">AddToBootstrapBlacklistResponse</a></td>
<td><p>Add IP addresses to node bootstrap whitelist.</p></td>
<td><p>Add IP addresses to node bootstrap blacklist</p></td>
</tr>

<tr>
<td>AddToBootstrapWhitelist</td>
<td><a href="#massa.api.v1.AddToBootstrapWhitelistRequest">AddToBootstrapWhitelistRequest</a></td>
<td><a href="#massa.api.v1.AddToBootstrapWhitelistResponse">AddToBootstrapWhitelistResponse</a></td>
<td><p>Add IP addresses to node bootstrap whitelist.</p></td>
<td><p>Add IP addresses to node bootstrap whitelist</p></td>
</tr>

<tr>
Expand Down Expand Up @@ -1146,7 +1174,7 @@ <h3 id="massa.api.v1.MassaPrivateService">MassaPrivateService</h3>
<td>GetBootstrapWhitelistAllowAll</td>
<td><a href="#massa.api.v1.GetBootstrapWhitelistAllowAllRequest">GetBootstrapWhitelistAllowAllRequest</a></td>
<td><a href="#massa.api.v1.GetBootstrapWhitelistAllowAllResponse">GetBootstrapWhitelistAllowAllResponse</a></td>
<td><p>Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file.</p></td>
<td><p>Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file</p></td>
</tr>

<tr>
Expand Down
10 changes: 7 additions & 3 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ GetBootstrapBlacklistResponse holds the response from GetBootstrapBlacklist

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | Request id |
| ips | [string](#string) | repeated | Bootstrap blacklisted IP addresses |


Expand Down Expand Up @@ -293,6 +294,7 @@ GetBootstrapWhitelistResponse holds the response from GetBootstrapWhitelist

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | Request id |
| ips | [string](#string) | repeated | Bootstrap whitelisted IP addresses |


Expand Down Expand Up @@ -323,6 +325,7 @@ GetPeersWhitelistResponse holds the response from GetPeersWhitelist

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | Request id |
| ips | [string](#string) | repeated | Whitelisted IP addresses |


Expand Down Expand Up @@ -474,6 +477,7 @@ SignMessagesResponse holds the response from SignMessages

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | Request id |
| public_key | [string](#string) | | Public key that signed the message |
| signatures | [string](#string) | repeated | Signatures |

Expand All @@ -495,13 +499,13 @@ Massa private gRPC service

| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| AddToBootstrapBlacklist | [AddToBootstrapBlacklistRequest](#massa-api-v1-AddToBootstrapBlacklistRequest) | [AddToBootstrapBlacklistResponse](#massa-api-v1-AddToBootstrapBlacklistResponse) | Add IP addresses to node bootstrap whitelist. |
| AddToBootstrapWhitelist | [AddToBootstrapWhitelistRequest](#massa-api-v1-AddToBootstrapWhitelistRequest) | [AddToBootstrapWhitelistResponse](#massa-api-v1-AddToBootstrapWhitelistResponse) | Add IP addresses to node bootstrap whitelist. |
| AddToBootstrapBlacklist | [AddToBootstrapBlacklistRequest](#massa-api-v1-AddToBootstrapBlacklistRequest) | [AddToBootstrapBlacklistResponse](#massa-api-v1-AddToBootstrapBlacklistResponse) | Add IP addresses to node bootstrap blacklist |
| AddToBootstrapWhitelist | [AddToBootstrapWhitelistRequest](#massa-api-v1-AddToBootstrapWhitelistRequest) | [AddToBootstrapWhitelistResponse](#massa-api-v1-AddToBootstrapWhitelistResponse) | Add IP addresses to node bootstrap whitelist |
| AddToPeersWhitelist | [AddToPeersWhitelistRequest](#massa-api-v1-AddToPeersWhitelistRequest) | [AddToPeersWhitelistResponse](#massa-api-v1-AddToPeersWhitelistResponse) | Add IP addresses to node peers whitelist. No confirmation to expect. Note: If the ip was unknown it adds it to the known peers, otherwise it updates the peer type |
| AddStakingSecretKeys | [AddStakingSecretKeysRequest](#massa-api-v1-AddStakingSecretKeysRequest) | [AddStakingSecretKeysResponse](#massa-api-v1-AddStakingSecretKeysResponse) | Add staking secret keys to wallet |
| GetBootstrapBlacklist | [GetBootstrapBlacklistRequest](#massa-api-v1-GetBootstrapBlacklistRequest) | [GetBootstrapBlacklistResponse](#massa-api-v1-GetBootstrapBlacklistResponse) | Get node bootstrap blacklist IP addresses |
| GetBootstrapWhitelist | [GetBootstrapWhitelistRequest](#massa-api-v1-GetBootstrapWhitelistRequest) | [GetBootstrapWhitelistResponse](#massa-api-v1-GetBootstrapWhitelistResponse) | Get node bootstrap whitelist IP addresses |
| GetBootstrapWhitelistAllowAll | [GetBootstrapWhitelistAllowAllRequest](#massa-api-v1-GetBootstrapWhitelistAllowAllRequest) | [GetBootstrapWhitelistAllowAllResponse](#massa-api-v1-GetBootstrapWhitelistAllowAllResponse) | Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file. |
| GetBootstrapWhitelistAllowAll | [GetBootstrapWhitelistAllowAllRequest](#massa-api-v1-GetBootstrapWhitelistAllowAllRequest) | [GetBootstrapWhitelistAllowAllResponse](#massa-api-v1-GetBootstrapWhitelistAllowAllResponse) | Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file |
| GetPeersWhitelist | [GetPeersWhitelistRequest](#massa-api-v1-GetPeersWhitelistRequest) | [GetPeersWhitelistResponse](#massa-api-v1-GetPeersWhitelistResponse) | Get node peers whitelist IP addresses |
| RemoveFromBootstrapBlacklist | [RemoveFromBootstrapBlacklistRequest](#massa-api-v1-RemoveFromBootstrapBlacklistRequest) | [RemoveFromBootstrapBlacklistResponse](#massa-api-v1-RemoveFromBootstrapBlacklistResponse) | Remove from bootstrap blacklist given IP addresses |
| RemoveFromBootstrapWhitelist | [RemoveFromBootstrapWhitelistRequest](#massa-api-v1-RemoveFromBootstrapWhitelistRequest) | [RemoveFromBootstrapWhitelistResponse](#massa-api-v1-RemoveFromBootstrapWhitelistResponse) | Remove from bootstrap whitelist given IP addresses |
Expand Down
24 changes: 16 additions & 8 deletions proto/apis/massa/api/v1/private.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ option swift_prefix = "MAPI";

// Massa private gRPC service
service MassaPrivateService {
// Add IP addresses to node bootstrap whitelist.
// Add IP addresses to node bootstrap blacklist
rpc AddToBootstrapBlacklist(AddToBootstrapBlacklistRequest) returns (AddToBootstrapBlacklistResponse) {
option (google.api.http) = {
post: "/v1/add_to_boostrap_blacklist"
body: "*"
};
}

// Add IP addresses to node bootstrap whitelist.
// Add IP addresses to node bootstrap whitelist
rpc AddToBootstrapWhitelist(AddToBootstrapWhitelistRequest) returns (AddToBootstrapWhitelistResponse) {
option (google.api.http) = {
post: "/v1/add_to_boostrap_whitelist"
Expand Down Expand Up @@ -66,7 +66,7 @@ service MassaPrivateService {
};
}

// Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file.
// Allow everyone to bootstrap from the node by removing bootstrap whitelist configuration file
rpc GetBootstrapWhitelistAllowAll(GetBootstrapWhitelistAllowAllRequest) returns (GetBootstrapWhitelistAllowAllResponse) {
option (google.api.http) = {
post: "/v1/get_bootstrap_whitelist_allow_all"
Expand Down Expand Up @@ -175,8 +175,10 @@ message GetBootstrapBlacklistRequest {

// GetBootstrapBlacklistResponse holds the response from GetBootstrapBlacklist
message GetBootstrapBlacklistResponse {
// Request id
string id = 1;
// Bootstrap blacklisted IP addresses
repeated string ips = 1;
repeated string ips = 2;
}

// GetBootstrapWhitelistRequest holds the request for GetBootstrapWhitelist
Expand All @@ -187,8 +189,10 @@ message GetBootstrapWhitelistRequest {

// GetBootstrapWhitelistResponse holds the response from GetBootstrapWhitelist
message GetBootstrapWhitelistResponse {
// Request id
string id = 1;
// Bootstrap whitelisted IP addresses
repeated string ips = 1;
repeated string ips = 2;
}

// GetBootstrapWhitelistAllowAllRequest holds the request for GetBootstrapWhitelistAllowAll
Expand All @@ -205,8 +209,10 @@ message GetPeersWhitelistRequest {

// GetPeersWhitelistResponse holds the response from GetPeersWhitelist
message GetPeersWhitelistResponse {
// Request id
string id = 1;
// Whitelisted IP addresses
repeated string ips = 1;
repeated string ips = 2;
}

// RemoveFromBootstrapBlacklistRequest holds the request for RemoveFromBootstrapBlacklist
Expand Down Expand Up @@ -255,10 +261,12 @@ message SignMessagesRequest {

// SignMessagesResponse holds the response from SignMessages
message SignMessagesResponse {
// Request id
string id = 1;
// Public key that signed the message
string public_key = 1;
string public_key = 2;
// Signatures
repeated string signatures = 2;
repeated string signatures = 3;
}

// ShutdownNodeRequest holds the request for ShutdownNode
Expand Down

0 comments on commit 3175620

Please sign in to comment.