Skip to content

Commit 5f6fd6d

Browse files
committed
Fix system-wide device listing tool. Adds echo-like feature to Access service : MyUserAccess.
1 parent ccf1187 commit 5f6fd6d

15 files changed

Lines changed: 195 additions & 223 deletions

src/protos/pirogue_admin_api/access.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ service Access {
6868
Returns the updated UserAccess.
6969
*/
7070
rpc SetUserAccessPermissions (PermissionChanges) returns (UserAccess);
71+
/*
72+
Get user access details given the authentication token used by the caller of this method.
73+
Returns the caller UserAccess.
74+
*/
75+
rpc MyUserAccess (google.protobuf.Empty) returns (UserAccess);
7176
}
7277

7378
message MethodAccess {

src/protos/pirogue_admin_api/network.proto

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ service Network {
2020
Returns the VPNPeer details.
2121
*/
2222
rpc GetVPNPeer (google.protobuf.Int32Value) returns (VPNPeer) {}
23+
/*
24+
Get VPN peer configuration used to setup a new VPN client.
25+
Returns the VPNPeer configuration content
26+
*/
2327
rpc GetVPNPeerConfig (google.protobuf.Int32Value) returns (google.protobuf.StringValue) {}
28+
/* Add a new VPN Peer */
2429
rpc AddVPNPeer (VPNPeerAddRequest) returns (VPNPeer) {}
30+
/* Delete a VPN Peer given the its ID. */
2531
rpc DeleteVPNPeer (google.protobuf.Int32Value) returns (VPNPeer) {}
2632

2733
/*
@@ -35,21 +41,28 @@ service Network {
3541
*/
3642
rpc SetWifiConfiguration (WifiConfiguration) returns (google.protobuf.Empty) {}
3743

38-
/* External access */
44+
/* Enable External access */
3945
rpc EnableExternalPublicAccess (PublicAccessRequest) returns (google.protobuf.Empty) {}
46+
/* Disable External access */
4047
rpc DisableExternalPublicAccess (google.protobuf.Empty) returns (google.protobuf.Empty) {}
4148

42-
/* 'Firewall' */
49+
/* Open a Port on the Isolated interface */
4350
rpc OpenIsolatedPort (IsolatedPort) returns (google.protobuf.Empty) {}
51+
/* Open a Port on the Isolated interface */
4452
rpc CloseIsolatedPort (ClosePortRequest) returns (google.protobuf.Empty) {}
53+
/* Open opened Ports on the Isolated interface */
4554
rpc ListIsolatedOpenPorts (google.protobuf.Empty) returns (IsolatedPortList) {}
55+
56+
/* List Connected Devices to the Isolated Interface */
57+
rpc ListConnectedDevices (google.protobuf.Empty) returns (DeviceList) {}
4658
}
4759

4860
message VPNPeer {
4961
int32 idx = 1;
5062
string comment = 2;
5163
string public_key = 3;
5264
optional string private_key = 4;
65+
optional string ipv4_address = 5;
5366
}
5467

5568
message VPNPeerAddRequest {
@@ -83,4 +96,13 @@ message IsolatedPortList {
8396

8497
message ClosePortRequest {
8598
optional uint32 port = 1;
99+
}
100+
101+
message Device {
102+
string ip_addr = 1;
103+
optional int32 peer_idx = 2;
104+
}
105+
106+
message DeviceList {
107+
repeated Device devices = 1;
86108
}

src/protos/pirogue_admin_api/services.proto

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@ import "google/protobuf/empty.proto";
66
import "google/protobuf/wrappers.proto";
77

88
service Services {
9-
/* Dashboard */
9+
/* Get Dashboard Configuration */
1010
rpc GetDashboardConfiguration (google.protobuf.Empty) returns (DashboardConfiguration) {}
11+
/* Get Dashboard Configuration */
1112
rpc SetDashboardConfiguration (DashboardConfiguration) returns (google.protobuf.Empty) {}
1213

13-
/* Suricata */
14+
/* List Suricata Rules Sources */
1415
rpc ListSuricataRulesSources (google.protobuf.Empty) returns (SuricataRulesSources) {}
15-
/*rpc UpdateSuricataRulesSources (google.protobuf.Empty) returns (google.protobuf.StringValue) {}*/
16+
/* Add Suricata Rules Sources */
1617
rpc AddSuricataRulesSource (SuricataRulesSource) returns (google.protobuf.Empty) {}
18+
/* Delete Suricata Rules Sources */
1719
rpc DeleteSuricataRulesSource (google.protobuf.StringValue) returns (google.protobuf.Empty) {}
1820

19-
/* Device Monitoring */
21+
/* List Active Device Monitorings */
2022
rpc ListDeviceMonitorings (google.protobuf.Empty) returns (DeviceMonitorings) {}
23+
/* Add Device Monitorings */
2124
rpc AddDeviceMonitoring (DeviceMonitoring) returns (google.protobuf.Empty) {}
25+
/* Delete Device Monitorings */
2226
rpc DeleteDeviceMonitoring (google.protobuf.StringValue) returns (google.protobuf.Empty) {}
27+
/* Get Device Monitorings Template */
2328
rpc GetDeviceMonitoringTemplate (google.protobuf.Empty) returns (DeviceMonitoring) {}
2429
}
2530

src/protos/pirogue_admin_api/system.proto

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,16 @@ service System {
1212
rpc GetStatus (google.protobuf.Empty) returns (Status) {}
1313

1414
rpc GetConfiguration (google.protobuf.Empty) returns (Configuration) {}
15-
/*rpc ApplyConfiguration (ApplyRequest) returns (google.protobuf.Empty) {}*/
1615

1716
rpc GetConfigurationTree (google.protobuf.Empty) returns (ConfigurationTree) {}
1817

1918
rpc GetPackagesInfo (google.protobuf.Empty) returns (PackagesInfo) {}
2019

2120
rpc GetHostname (google.protobuf.Empty) returns (google.protobuf.StringValue) {}
22-
rpc SetHostname (google.protobuf.StringValue) returns (google.protobuf.Empty) {}
23-
24-
/*rpc GetDomainName (google.protobuf.Empty) returns (google.protobuf.StringValue) {}*/
25-
/*rpc SetDomainName (google.protobuf.StringValue) returns (google.protobuf.Empty) {}*/
2621

2722
rpc GetLocale (google.protobuf.Empty) returns (google.protobuf.StringValue) {}
28-
rpc SetLocale (google.protobuf.StringValue) returns (google.protobuf.Empty) {}
29-
rpc GetTimezone (google.protobuf.Empty) returns (google.protobuf.StringValue) {}
30-
rpc SetTimezone (google.protobuf.StringValue) returns (google.protobuf.Empty) {}
31-
32-
rpc ListConnectedDevices (google.protobuf.Empty) returns (DeviceList) {}
3323

34-
/* rpc EnrollColanderServer (google.protobuf.Empty) returns (google.protobuf.Empty) {} */
24+
rpc GetTimezone (google.protobuf.Empty) returns (google.protobuf.StringValue) {}
3525

3626
}
3727

@@ -97,11 +87,3 @@ message PackageInfo {
9787
message PackagesInfo {
9888
repeated PackageInfo packages = 1;
9989
}
100-
101-
message Device {
102-
string name = 1;
103-
}
104-
105-
message DeviceList {
106-
repeated Device devices = 1;
107-
}

src/python/debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
python3-pirogue-admin-api (2.0.6) bookworm; urgency=medium
2+
3+
* Fix system-wide device listing tool
4+
* Adds echo-like feature to Access service : MyUserAccess
5+
6+
-- Christophe Andral <christophe@andral.fr> Tue, 14 Apr 2026 09:40:16 +0200
7+
18
python3-pirogue-admin-api (2.0.5) bookworm; urgency=medium
29

310
* Device Monitoring management

src/python/pirogue_admin_api/access_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/python/pirogue_admin_api/access_pb2_grpc.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ def __init__(self, channel):
7373
request_serializer=pirogue__admin__api_dot_access__pb2.PermissionChanges.SerializeToString,
7474
response_deserializer=pirogue__admin__api_dot_access__pb2.UserAccess.FromString,
7575
)
76+
self.MyUserAccess = channel.unary_unary(
77+
'/pirogue.admin.access.Access/MyUserAccess',
78+
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
79+
response_deserializer=pirogue__admin__api_dot_access__pb2.UserAccess.FromString,
80+
)
7681

7782

7883
class AccessServicer(object):
@@ -181,6 +186,15 @@ def SetUserAccessPermissions(self, request, context):
181186
context.set_details('Method not implemented!')
182187
raise NotImplementedError('Method not implemented!')
183188

189+
def MyUserAccess(self, request, context):
190+
"""
191+
Get user access details given the authentication token used by the caller of this method.
192+
Returns the caller UserAccess.
193+
"""
194+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
195+
context.set_details('Method not implemented!')
196+
raise NotImplementedError('Method not implemented!')
197+
184198

185199
def add_AccessServicer_to_server(servicer, server):
186200
rpc_method_handlers = {
@@ -239,6 +253,11 @@ def add_AccessServicer_to_server(servicer, server):
239253
request_deserializer=pirogue__admin__api_dot_access__pb2.PermissionChanges.FromString,
240254
response_serializer=pirogue__admin__api_dot_access__pb2.UserAccess.SerializeToString,
241255
),
256+
'MyUserAccess': grpc.unary_unary_rpc_method_handler(
257+
servicer.MyUserAccess,
258+
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
259+
response_serializer=pirogue__admin__api_dot_access__pb2.UserAccess.SerializeToString,
260+
),
242261
}
243262
generic_handler = grpc.method_handlers_generic_handler(
244263
'pirogue.admin.access.Access', rpc_method_handlers)
@@ -437,3 +456,20 @@ def SetUserAccessPermissions(request,
437456
pirogue__admin__api_dot_access__pb2.UserAccess.FromString,
438457
options, channel_credentials,
439458
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
459+
460+
@staticmethod
461+
def MyUserAccess(request,
462+
target,
463+
options=(),
464+
channel_credentials=None,
465+
call_credentials=None,
466+
insecure=False,
467+
compression=None,
468+
wait_for_ready=None,
469+
timeout=None,
470+
metadata=None):
471+
return grpc.experimental.unary_unary(request, target, '/pirogue.admin.access.Access/MyUserAccess',
472+
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
473+
pirogue__admin__api_dot_access__pb2.UserAccess.FromString,
474+
options, channel_credentials,
475+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

0 commit comments

Comments
 (0)