fasjson.web.extensions package

Submodules

fasjson.web.extensions.flask_ipacfg module

class fasjson.web.extensions.flask_ipacfg.IPAConfig(app=None)[source]

Bases: object

init_app(app)[source]
prefix = 'FASJSON_IPA'
fasjson.web.extensions.flask_ipacfg.query_srv(qname, resolver=None, **kwargs)[source]

Query SRV records and sort reply according to RFC 2782

Parameters:

qname – query name, _service._proto.domain.

Returns:

list of dns.rdtypes.IN.SRV.SRV instances

fasjson.web.extensions.flask_ipacfg.sort_prio_weight(records)[source]

RFC 2782 sorting algorithm for SRV and URI records

RFC 2782 defines a sorting algorithms for SRV records, that is also used for sorting URI records. Records are sorted by priority and than randomly shuffled according to weight.

This implementation also removes duplicate entries.

Module contents