MCPcopy Create free account
hub / github.com/apache/trafficserver / verify_session

Function verify_session

plugins/traffic_dump/post_process.py:156–175  ·  view source on GitHub ↗

Function to verify that a session looks complete. A valid session contains a valid list of transactions. Args: transaction (json object) fabricate_proxy_requests (bool) Whether the post-processor should fabricate proxy requests if they don't exist because the

(session, fabricate_proxy_requests=False)

Source from the content-addressed store, hash-verified

154
155
156def verify_session(session, fabricate_proxy_requests=False):
157 """ Function to verify that a session looks complete.
158
159 A valid session contains a valid list of transactions.
160
161 Args:
162 transaction (json object)
163 fabricate_proxy_requests (bool) Whether the post-processor should
164 fabricate proxy requests if they don't exist because the proxy served
165 the response locally.
166
167 Raises:
168 VerifyError if there is a problem with the session.
169 """
170 if not session:
171 raise VerifySessionError('Session not found.')
172 if "transactions" not in session or not session["transactions"]:
173 raise VerifySessionError('No transactions found in session.')
174 for transaction in session["transactions"]:
175 verify_transaction(transaction, fabricate_proxy_requests)
176
177
178def write_sessions(sessions, filename, indent):

Callers 1

readAndCombineFunction · 0.85

Calls 2

VerifySessionErrorClass · 0.85
verify_transactionFunction · 0.85

Tested by

no test coverage detected