@@ -200,7 +200,7 @@ def parse(self, xmlstr):
200
200
def load (self ):
201
201
self .parse (self .metadata )
202
202
203
- def _service (self , entity_id , typ , service , binding = None ):
203
+ def service (self , entity_id , typ , service , binding = None ):
204
204
""" Get me all services with a specified
205
205
entity ID and type, that supports the specified version of binding.
206
206
@@ -212,7 +212,7 @@ def _service(self, entity_id, typ, service, binding=None):
212
212
Or if no binding was specified a list of 2-tuples (binding, srv)
213
213
"""
214
214
215
- logger .debug ("_service (%s, %s, %s, %s)" % (entity_id , typ , service ,
215
+ logger .debug ("service (%s, %s, %s, %s)" % (entity_id , typ , service ,
216
216
binding ))
217
217
try :
218
218
srvs = []
@@ -239,7 +239,7 @@ def _service(self, entity_id, typ, service, binding=None):
239
239
res [srv ["binding" ]].append (srv )
240
240
except KeyError :
241
241
res [srv ["binding" ]] = [srv ]
242
- logger .debug ("_service => %s" % res )
242
+ logger .debug ("service => %s" % res )
243
243
return res
244
244
245
245
def ext_service (self , entity_id , typ , service , binding ):
@@ -272,7 +272,7 @@ def any(self, typ, service, binding=None):
272
272
"""
273
273
res = {}
274
274
for ent in self .keys ():
275
- bind = self ._service (ent , typ , service , binding )
275
+ bind = self .service (ent , typ , service , binding )
276
276
if bind :
277
277
res [ent ] = bind
278
278
@@ -287,7 +287,7 @@ def bindings(self, entity_id, typ, service):
287
287
:return:
288
288
"""
289
289
290
- return self ._service (entity_id , typ , service )
290
+ return self .service (entity_id , typ , service )
291
291
292
292
def attribute_requirement (self , entity_id , index = 0 ):
293
293
""" Returns what attributes the SP requires and which are optional
@@ -553,10 +553,10 @@ def imp(self, spec):
553
553
else :
554
554
self .load (key , val )
555
555
556
- def _service (self , entity_id , typ , service , binding = None ):
556
+ def service (self , entity_id , typ , service , binding = None ):
557
557
known_principal = False
558
558
for key , _md in self .metadata .items ():
559
- srvs = _md ._service (entity_id , typ , service , binding )
559
+ srvs = _md .service (entity_id , typ , service , binding )
560
560
if srvs :
561
561
return srvs
562
562
elif srvs is None :
@@ -592,37 +592,37 @@ def single_sign_on_service(self, entity_id, binding=None, typ="idpsso"):
592
592
593
593
if binding is None :
594
594
binding = BINDING_HTTP_REDIRECT
595
- return self ._service (entity_id , "idpsso_descriptor" ,
595
+ return self .service (entity_id , "idpsso_descriptor" ,
596
596
"single_sign_on_service" , binding )
597
597
598
598
def name_id_mapping_service (self , entity_id , binding = None , typ = "idpsso" ):
599
599
# IDP
600
600
if binding is None :
601
601
binding = BINDING_HTTP_REDIRECT
602
- return self ._service (entity_id , "idpsso_descriptor" ,
602
+ return self .service (entity_id , "idpsso_descriptor" ,
603
603
"name_id_mapping_service" , binding )
604
604
605
605
def authn_query_service (self , entity_id , binding = None ,
606
606
typ = "authn_authority" ):
607
607
# AuthnAuthority
608
608
if binding is None :
609
609
binding = BINDING_SOAP
610
- return self ._service (entity_id , "authn_authority_descriptor" ,
610
+ return self .service (entity_id , "authn_authority_descriptor" ,
611
611
"authn_query_service" , binding )
612
612
613
613
def attribute_service (self , entity_id , binding = None ,
614
614
typ = "attribute_authority" ):
615
615
# AttributeAuthority
616
616
if binding is None :
617
617
binding = BINDING_HTTP_REDIRECT
618
- return self ._service (entity_id , "attribute_authority_descriptor" ,
618
+ return self .service (entity_id , "attribute_authority_descriptor" ,
619
619
"attribute_service" , binding )
620
620
621
621
def authz_service (self , entity_id , binding = None , typ = "pdp" ):
622
622
# PDP
623
623
if binding is None :
624
624
binding = BINDING_SOAP
625
- return self ._service (entity_id , "pdp_descriptor" ,
625
+ return self .service (entity_id , "pdp_descriptor" ,
626
626
"authz_service" , binding )
627
627
628
628
def assertion_id_request_service (self , entity_id , binding = None , typ = None ):
@@ -631,7 +631,7 @@ def assertion_id_request_service(self, entity_id, binding=None, typ=None):
631
631
raise AttributeError ("Missing type specification" )
632
632
if binding is None :
633
633
binding = BINDING_SOAP
634
- return self ._service (entity_id , "%s_descriptor" % typ ,
634
+ return self .service (entity_id , "%s_descriptor" % typ ,
635
635
"assertion_id_request_service" , binding )
636
636
637
637
def single_logout_service (self , entity_id , binding = None , typ = None ):
@@ -640,35 +640,35 @@ def single_logout_service(self, entity_id, binding=None, typ=None):
640
640
raise AttributeError ("Missing type specification" )
641
641
if binding is None :
642
642
binding = BINDING_HTTP_REDIRECT
643
- return self ._service (entity_id , "%s_descriptor" % typ ,
643
+ return self .service (entity_id , "%s_descriptor" % typ ,
644
644
"single_logout_service" , binding )
645
645
646
646
def manage_name_id_service (self , entity_id , binding = None , typ = None ):
647
647
# IDP + SP
648
648
if binding is None :
649
649
binding = BINDING_HTTP_REDIRECT
650
- return self ._service (entity_id , "%s_descriptor" % typ ,
650
+ return self .service (entity_id , "%s_descriptor" % typ ,
651
651
"manage_name_id_service" , binding )
652
652
653
653
def artifact_resolution_service (self , entity_id , binding = None , typ = None ):
654
654
# IDP + SP
655
655
if binding is None :
656
656
binding = BINDING_HTTP_REDIRECT
657
- return self ._service (entity_id , "%s_descriptor" % typ ,
657
+ return self .service (entity_id , "%s_descriptor" % typ ,
658
658
"artifact_resolution_service" , binding )
659
659
660
660
def assertion_consumer_service (self , entity_id , binding = None , _ = "spsso" ):
661
661
# SP
662
662
if binding is None :
663
663
binding = BINDING_HTTP_POST
664
- return self ._service (entity_id , "spsso_descriptor" ,
664
+ return self .service (entity_id , "spsso_descriptor" ,
665
665
"assertion_consumer_service" , binding )
666
666
667
667
def attribute_consuming_service (self , entity_id , binding = None , _ = "spsso" ):
668
668
# SP
669
669
if binding is None :
670
670
binding = BINDING_HTTP_REDIRECT
671
- return self ._service (entity_id , "spsso_descriptor" ,
671
+ return self .service (entity_id , "spsso_descriptor" ,
672
672
"attribute_consuming_service" , binding )
673
673
674
674
def discovery_response (self , entity_id , binding = None , _ = "spsso" ):
0 commit comments