Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into v5-rc1
Browse files Browse the repository at this point in the history
* origin/main:
  Add ECH and OONI Run related columns to obs_web, obs_web_ctrl and obs_http_middlebox tables (#100)
  • Loading branch information
hellais committed Nov 20, 2024
2 parents 9082b5f + f4869da commit 7daa1e3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oonidata/src/oonidata/models/dataformats.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ class TLSHandshake(BaseModel):
peer_certificates: Optional[List[BinaryData]] = None

server_name: Optional[str] = None
outer_server_name: Optional[str] = None
echconfig: Optional[str] = None

tags: Optional[List[str]] = None
tls_version: Optional[str] = None
Expand Down
5 changes: 5 additions & 0 deletions oonidata/src/oonidata/models/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MeasurementMeta:
measurement_uid: str
input: Optional[str]
report_id: str
ooni_run_link_id: str

measurement_start_time: datetime

Expand Down Expand Up @@ -114,6 +115,8 @@ class TLSObservation:
failure: Failure

server_name: str
outer_server_name: str
echconfig: str
version: str
cipher_suite: str

Expand Down Expand Up @@ -280,6 +283,8 @@ class WebObservation:
tls_failure: Optional[Failure] = None

tls_server_name: Optional[str] = None
tls_outer_server_name: Optional[str] = None
tls_echconfig: Optional[str] = None
tls_version: Optional[str] = None
tls_cipher_suite: Optional[str] = None
tls_is_certificate_valid: Optional[bool] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def measurement_to_tls_observation(
tlso = TLSObservation(
timestamp=make_timestamp(msmt_meta.measurement_start_time, tls_h.t),
server_name=tls_h.server_name if tls_h.server_name else "",
outer_server_name=tls_h.outer_server_name if tls_h.outer_server_name else "",
echconfig=tls_h.echconfig if tls_h.echconfig else "",
version=tls_h.tls_version if tls_h.tls_version else "",
cipher_suite=tls_h.cipher_suite if tls_h.cipher_suite else "",
end_entity_certificate_san_list=[],
Expand Down Expand Up @@ -714,10 +716,12 @@ def make_measurement_meta(msmt: BaseMeasurement, bucket_date: str) -> Measuremen
if isinstance(input_, list):
input_ = ":".join(input_)

annotations = msmt.annotations or {}
return MeasurementMeta(
measurement_uid=msmt.measurement_uid,
report_id=msmt.report_id,
input=input_,
ooni_run_link_id=str(annotations.get("ooni_run_link_id", "")),
software_name=msmt.software_name,
software_version=msmt.software_version,
test_name=msmt.test_name,
Expand Down

0 comments on commit 7daa1e3

Please sign in to comment.