From 2a793bbd47aa95379779a1a21559cc18ff045e8f Mon Sep 17 00:00:00 2001 From: megdevs Date: Fri, 8 Dec 2023 16:53:46 +0000 Subject: [PATCH 1/4] geofence check endpoint --- proto/valorem/trade/v1/auth.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proto/valorem/trade/v1/auth.proto b/proto/valorem/trade/v1/auth.proto index 9498355..255a565 100644 --- a/proto/valorem/trade/v1/auth.proto +++ b/proto/valorem/trade/v1/auth.proto @@ -22,6 +22,9 @@ service Auth { // Invalidates the session for the request's sessionId rpc SignOut (Empty) returns (Empty); + + // Used to check if a given connection is geofenced. If access is restricted, returns true, otherwise false. + rpc Geofenced (Empty) returns (BoolResponse); } // Nonce response message containing the generated `nonce` string. @@ -40,4 +43,9 @@ message VerifyText { message SiweSession { H160 address = 1; H256 chain_id = 2; +} + +// BoolResponse message contains a single field of type bool. +message BoolResponse { + bool value = 1; } \ No newline at end of file From fa984da17ec69c00d077b34c5b1ca9df6ed83434 Mon Sep 17 00:00:00 2001 From: megdevs Date: Fri, 8 Dec 2023 17:35:25 +0000 Subject: [PATCH 2/4] ordering --- proto/valorem/trade/v1/auth.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/valorem/trade/v1/auth.proto b/proto/valorem/trade/v1/auth.proto index 255a565..7986a59 100644 --- a/proto/valorem/trade/v1/auth.proto +++ b/proto/valorem/trade/v1/auth.proto @@ -17,14 +17,14 @@ service Auth { // Used to check if a given connection is authenticated, returns the address which is authenticated for a nonce cookie rpc Authenticate (Empty) returns (H160); + // Used to check if a given connection is geofenced. If access is restricted, returns true, otherwise false. + rpc Geofenced (Empty) returns (BoolResponse); + // Returns the SIWE Session for the request's sessionId rpc Session (Empty) returns (SiweSession); // Invalidates the session for the request's sessionId rpc SignOut (Empty) returns (Empty); - - // Used to check if a given connection is geofenced. If access is restricted, returns true, otherwise false. - rpc Geofenced (Empty) returns (BoolResponse); } // Nonce response message containing the generated `nonce` string. From 0e76b5aeb6dadd4dc726749399d89d5ff0966dc6 Mon Sep 17 00:00:00 2001 From: megdevs Date: Fri, 8 Dec 2023 18:05:49 +0000 Subject: [PATCH 3/4] move bool response to types --- proto/valorem/trade/v1/auth.proto | 5 ----- proto/valorem/trade/v1/types.proto | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/proto/valorem/trade/v1/auth.proto b/proto/valorem/trade/v1/auth.proto index 7986a59..8b9bbbe 100644 --- a/proto/valorem/trade/v1/auth.proto +++ b/proto/valorem/trade/v1/auth.proto @@ -44,8 +44,3 @@ message SiweSession { H160 address = 1; H256 chain_id = 2; } - -// BoolResponse message contains a single field of type bool. -message BoolResponse { - bool value = 1; -} \ No newline at end of file diff --git a/proto/valorem/trade/v1/types.proto b/proto/valorem/trade/v1/types.proto index 86b702c..96380f3 100644 --- a/proto/valorem/trade/v1/types.proto +++ b/proto/valorem/trade/v1/types.proto @@ -41,5 +41,10 @@ message EthSignature { bytes v = 3; } +// BoolResponse message contains a single field of type bool. +message BoolResponse { + bool value = 1; +} + // The empty message message Empty {} \ No newline at end of file From dbd282ba1fde2b1fc3e63ede21129ead12cf207b Mon Sep 17 00:00:00 2001 From: megdevs Date: Sun, 10 Dec 2023 01:13:07 +0000 Subject: [PATCH 4/4] return bool directly --- proto/valorem/trade/v1/auth.proto | 3 ++- proto/valorem/trade/v1/types.proto | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/proto/valorem/trade/v1/auth.proto b/proto/valorem/trade/v1/auth.proto index 8b9bbbe..3e4aa69 100644 --- a/proto/valorem/trade/v1/auth.proto +++ b/proto/valorem/trade/v1/auth.proto @@ -1,6 +1,7 @@ syntax = "proto3"; import "types.proto"; +import "google/protobuf/wrappers.proto"; package valorem.trade.v1; @@ -18,7 +19,7 @@ service Auth { rpc Authenticate (Empty) returns (H160); // Used to check if a given connection is geofenced. If access is restricted, returns true, otherwise false. - rpc Geofenced (Empty) returns (BoolResponse); + rpc Geofenced (Empty) returns (google.protobuf.BoolValue); // Returns the SIWE Session for the request's sessionId rpc Session (Empty) returns (SiweSession); diff --git a/proto/valorem/trade/v1/types.proto b/proto/valorem/trade/v1/types.proto index 96380f3..86b702c 100644 --- a/proto/valorem/trade/v1/types.proto +++ b/proto/valorem/trade/v1/types.proto @@ -41,10 +41,5 @@ message EthSignature { bytes v = 3; } -// BoolResponse message contains a single field of type bool. -message BoolResponse { - bool value = 1; -} - // The empty message message Empty {} \ No newline at end of file