Opened 6 years ago

Closed 6 years ago

#4695 enhancement closed fixed (fixed)

plugin registration for extensions to endpoints.serverFromString and endpoints.clientFromString

Reported by: Glyph Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch: branches/endpoints-plugins-4695
branch-diff, diff-cov, branch-cov, buildbot
Author: glyph

Description (last modified by Glyph)

Originally #4473 specified a plugin API, but that was biting off more than a single ticket could chew by a wide margin. This ticket is to complete that work.

As originally specified:

(serverFromString and clientFromString) should be implemented in terms of a pluggable API, like the one in twisted.cred.strcred, so that third parties can supply their own Twisted transports and built-in protocols can be invoked using them.

Change History (13)

comment:1 Changed 6 years ago by Glyph

Description: modified (diff)

comment:2 Changed 6 years ago by Glyph

Author: glyph
Branch: branches/endpoints-plugins-4695

(In [30304]) Branching to 'endpoints-plugins-4695'

comment:3 Changed 6 years ago by Glyph

Keywords: review added
Owner: Glyph deleted

comment:4 Changed 6 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to Glyph
  1. The class docstring for IStreamClientEndpointStringParser ends with "plugin method" but probably means "prefix method"
  2. Why is prefix a method and not just an attribute?
  3. The unrecognized prefix case of clientFromString is untested and probably should more closely resemble the behavior of serverFromString in that case - currently the caller will get TypeError: 'NoneType' object is not callable.
  4. Needs a news fragment

comment:5 Changed 6 years ago by Glyph

(In [30338]) plugin -> prefix re #4695 point 1

comment:6 Changed 6 years ago by Glyph

(In [30339]) re #4695 review point 4: NEWS file

comment:7 Changed 6 years ago by Glyph

(In [30340]) re #4695 review point 2: make prefix an attribute instead of a method

comment:8 Changed 6 years ago by Glyph

(In [30342]) re #4695 review point 3: failing test for unrecognized client prefix

comment:9 Changed 6 years ago by Glyph

(In [30343]) re #4695 review point 3: make the test for unrecognized prefix pass.

comment:10 Changed 6 years ago by Glyph

Keywords: review added
Owner: Glyph deleted

Build results (see link above) ready with the usual potpourri of Windows failures; I think that addresses all the points of feedback.

comment:11 Changed 6 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to Glyph
  1. The first line of endpoints.py belongs somewhere else

Otherwise, great, please merge!

comment:12 Changed 6 years ago by Glyph

Resolution: fixed
Status: newclosed

(In [30348]) Merge endpoints-plugins-4695.

Author: glyph

Reviewer: exarkun

Fixes: #4695

Add plugin interfaces to allow third parties to implement their own client and server endpoint types, and have them be parsed by clientFromString, serverFromString, and strports.service().

comment:13 Changed 6 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.