@@ -75,8 +75,7 @@ func (b *Broker) startBrokerListener() error {
7575}
7676
7777type MatchRequest struct {
78- Connection policy.Connection
79- ConnectionHash string
78+ Connection policy.Connection
8079}
8180
8281type MatchResponse struct {
@@ -93,17 +92,17 @@ func (b *Broker) Match(input MatchRequest, output *MatchResponse) error {
9392 defer b .lock .Unlock ()
9493
9594 // Check if agent already exists for this connection hash
96- if entry , exists := b .agents [input .ConnectionHash ]; exists {
95+ if entry , exists := b .agents [input .Connection . Hash ]; exists {
9796 // Check if agent's certificate is still valid (with buffer)
9897 if time .Now ().Add (expiryBuffer ).Before (entry .expiresAt ) {
99- b .log .Debug ("found existing valid agent" , "hash" , input .ConnectionHash , "expires" , entry .expiresAt )
98+ b .log .Debug ("found existing valid agent" , "hash" , input .Connection . Hash , "expires" , entry .expiresAt )
10099 output .Allow = true
101100 return nil
102101 }
103102 // Agent expired - clean it up
104- b .log .Debug ("cleaning up expired agent" , "hash" , input .ConnectionHash , "expired" , entry .expiresAt )
103+ b .log .Debug ("cleaning up expired agent" , "hash" , input .Connection . Hash , "expired" , entry .expiresAt )
105104 entry .agent .Close ()
106- delete (b .agents , input .ConnectionHash )
105+ delete (b .agents , input .Connection . Hash )
107106 }
108107
109108 // Check if we have an auth token, if not authenticate
@@ -126,7 +125,7 @@ func (b *Broker) Match(input MatchRequest, output *MatchResponse) error {
126125 // TODO(epithet-25): Create agent with credential
127126
128127 // For now, just return false (no agent available)
129- b .log .Debug ("no valid agent found for connection" , "hash" , input .ConnectionHash , "host" , input .Connection .RemoteHost )
128+ b .log .Debug ("no valid agent found for connection" , "hash" , input .Connection . Hash , "host" , input .Connection .RemoteHost )
130129 output .Allow = false
131130 return nil
132131}
0 commit comments