Opened 2 years ago

Last modified 13 months ago

#20542 assigned enhancement

Structure and modernize bridgedescs module

Reported by: iwakeh Owned by: metrics-team
Priority: Medium Milestone:
Component: Metrics/CollecTor Version:
Severity: Normal Keywords: metrics-2018
Cc: Actual Points:
Parent ID: #20518 Points:
Reviewer: Sponsor:

Description

  • All parsing should be delegated to metrics-lib code.
  • Create 'BridgeMain'.

Current picture:
BridgeSnapshotReader only has a constructor of more than 200 lines of code.
BridgeDescriptorParser actually only determines the descriptor type and
SanitizedBridgesWriter performes parsing and obfuscation.

			       +------------------------+
			       | SanitizedBridgesWriter |
			       +---o----+---------------+
			        --/   /-  	   \
			     --/    /-   	    \
		          --/ 	  /-   	 	     \
		       --/     	/-     	       	      \
		    --/	      /-  		+------+----------------+
	+----------+---------o---+       	|  BridgeSnapshotReader |
       	| BridgeDescriptorParser +--------------o-----------------------+
	+------------------------+

X o----------+ Y : X holds a Y reference somewhere


Child Tickets

TicketTypeStatusOwnerSummary
#20549enhancementclosedmetrics-teamMake bridge descriptor sanitization more maintainable and more modular
#20550enhancementassignedmetrics-teamImplement SanitizedBridgeExtraInfoDescriptor class that encapsulates the sanitizing logic for bridge extra-info descriptors

Change History (5)

comment:1 Changed 2 years ago by iwakeh

Owner: set to iwakeh
Status: newassigned

Outline:

The bridgedescs module

  1. reads descriptors supplied locally from a bridge auth (currently bifroest, formerly tonga, in future possibly more)
  2. verifies the auth-fingerprint
  3. parses and
  4. sanitizes the descriptors and
  5. adds them to the local storage
  6. keeping some statistics about the import.

A BridgeMain class should be added to facilitate this process.
The input tarballs need to be verified that they origin from a known and trusted authority.
The (compressed) tarballs should be parsed using metrics-lib DescriptorReader.
Each resulting Descriptor is sanitized by encapsulating it with SanitizedBridge*Descriptor extending Bridge*Descriptor (analogously to the *Persistence classes in o.t.c.persist package).
These SanitizedBridge*Descriptors can be written to the two storage location by using the appropriate *Persistence classes.

BridgeSnapshotReader can be reduced to simply find all input tars in the given directory and after verifying the supplying authority provide a list of valid tar (possibly compressed) files. It doesn't need to unpack or parse these files.

Parsing is accomplished using metrics-lib DescriptorReader; the resulting Descriptors are sanitized and stored as described above.

Thus, the two new classes SanitizedBridgeServerDescriptor and SanitizedBridgeExtraInfoDescriptor have to be implemented (cf. respective child tickets). After that the processing logic can be assembled in BridgeMain.
The 'stale descriptors check' (currently in SanitizedBridgesWriter) can be performed while processing the descriptors.

What did I overlook? What needs to be added?

comment:2 Changed 2 years ago by iwakeh

Status: assignedneeds_information

comment:3 Changed 17 months ago by karsten

Summary: structure bridgedescs and modernizeStructure and modernize bridgedescs module

Tweak summary.

comment:4 Changed 17 months ago by karsten

Keywords: metrics-2018 added

comment:5 Changed 13 months ago by iwakeh

Owner: changed from iwakeh to metrics-team
Status: needs_informationassigned

Move to metrics-team as these are not worked on by me during the next week.

Note: See TracTickets for help on using tickets.