@@ -139,22 +139,22 @@ def __send_connected(self, eb: EventBus):
139139 for key , val in self .probe_config ["spp" ].get ("probe_metadata" ).items ():
140140 probe_metadata [key ] = val
141141
142+ # add probe auth headers (if present)
143+ headers = {}
144+ if self .probe_config ["spp" ].get ("authentication" ) is not None :
145+ for key , val in self .probe_config ["spp" ].get ("authentication" ).items ():
146+ headers [key ] = val
147+
142148 # send probe connected event
143149 reply_address = str (uuid .uuid4 ())
144- eb .send (address = "spp.platform.status.probe-connected" , body = {
150+ eb .send (address = "spp.platform.status.probe-connected" , headers = headers , body = {
145151 "instanceId" : self .probe_config ["spp" ]["probe_id" ],
146152 "connectionTime" : round (time .time () * 1000 ),
147153 "meta" : probe_metadata
148154 }, reply_handler = lambda msg : self .__register_remotes (eb , reply_address , msg ["body" ]))
149155
150156 def __register_remotes (self , eb , reply_address , status ):
151157 eb .unregister_handler (reply_address )
152- eb .register_handler (
153- address = "spp.probe.command.live-instrument-remote" ,
154- handler = lambda msg : self .instrument_remote .handle_instrument_command (
155- LiveInstrumentCommand .from_json (json .dumps (msg ["body" ]))
156- )
157- )
158158 eb .register_handler (
159159 address = "spp.probe.command.live-instrument-remote:" + self .probe_config ["spp" ]["probe_id" ],
160160 handler = lambda msg : self .instrument_remote .handle_instrument_command (
0 commit comments