Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
Signed-off-by: FFMMM <[email protected]>
  • Loading branch information
FFMMM committed Dec 2, 2021
1 parent 468a401 commit f7081c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions agent/agent_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,7 @@ func (s *HTTPHandlers) AgentConnectCALeafCert(resp http.ResponseWriter, req *htt
args.MaxQueryTime = qOpts.MaxQueryTime
args.Token = qOpts.Token

// TODO(ffmmmm): maybe set MustRevalidate in ConnectCALeafRequest (as part of CacheInfo())
// We don't want non-blocking queries to return expired leaf certs
// or leaf certs not valid under the current CA. So always revalidate
// the leaf cert on non-blocking queries (ie when MinQueryIndex == 0)
Expand Down
6 changes: 2 additions & 4 deletions agent/agent_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5837,16 +5837,14 @@ func TestAgentConnectCALeafCert_good(t *testing.T) {

// Test caching for the leaf cert
{
for fetched := 0; fetched < 4; fetches++ {

for fetched := 0; fetched < 4; fetched++ {

// Fetch it again
resp := httptest.NewRecorder()
obj2, err := a.srv.AgentConnectCALeafCert(resp, req)
require.NoError(err)
require.Equal(obj, obj2)

fetched++
}
}
})
Expand Down

0 comments on commit f7081c1

Please sign in to comment.