diff --git a/src/client/spark_api/api/Result.cs b/src/client/spark_api/api/Result.cs index b77386675..5a473c0e0 100644 --- a/src/client/spark_api/api/Result.cs +++ b/src/client/spark_api/api/Result.cs @@ -26,6 +26,7 @@ namespace bts.api.core case ApiError.ServerDisconnect: return "Server disconnected."; case ApiError.MissingMethod: return "Method not found."; case ApiError.ServerFault: return "Server error."; + case ApiError.AccessDenied: return "Access denied"; default: return "Unknown error"; } } diff --git a/src/lib/api/apicore.proto b/src/lib/api/apicore.proto index 97313b89e..2d609c2b6 100644 --- a/src/lib/api/apicore.proto +++ b/src/lib/api/apicore.proto @@ -7,9 +7,16 @@ message PingPong { bytes payload = 1; } +// *** wire protocol *** +// 1 byte - header size +// RequestHeader +// T Request + message RequestHeader { int32 request_id = 1; int32 method = 2; + string token = 3; + string service_id = 4; } enum ApiError { @@ -19,6 +26,7 @@ enum ApiError { MISSING_METHOD = 3; SERVER_FAULT = 4; UNEXPECTED_RESPONSE = 5; + ACCESS_DENIED = 6; } message ResponseHeader { @@ -26,6 +34,7 @@ message ResponseHeader { ApiError code = 2; } + // Some Useful buffers for use as arguments/returns message VoidMessage {} diff --git a/src/lib/api/public/Result.h b/src/lib/api/public/Result.h index a0aa3c38b..64ff8549b 100644 --- a/src/lib/api/public/Result.h +++ b/src/lib/api/public/Result.h @@ -26,6 +26,7 @@ class Result case ApiError::MISSING_METHOD: return "Method not found."; case ApiError::SERVER_FAULT: return "Server error."; case ApiError::UNEXPECTED_RESPONSE: return "Internal error"; + case ApiError::ACCESS_DENIED: return "Access denied"; default: return "Unknown error"; } }