|
33 | 33 | from ..response import Response
|
34 | 34 | from ..response import ServiceError
|
35 | 35 | from ..saml_util import make_saml_response
|
| 36 | +from ..util import join_paths |
36 | 37 | from satosa.exception import SATOSAError
|
37 | 38 | import satosa.util as util
|
38 | 39 |
|
@@ -511,14 +512,18 @@ def _register_endpoints(self, providers):
|
511 | 512 | """
|
512 | 513 | url_map = []
|
513 | 514 |
|
514 |
| - backend_providers = "|".join(providers) |
| 515 | + backend_providers = "(" + "|".join(providers) + ")" |
515 | 516 | for endp_category in self.endpoints:
|
516 | 517 | for binding, endp in self.endpoints[endp_category].items():
|
517 | 518 | endp_path = urlparse(endp).path
|
518 | 519 | url_map.append(
|
519 | 520 | (
|
520 |
| - "^{}/({})/{}$".format(self.base_path, backend_providers, endp_path), |
521 |
| - functools.partial(self.handle_authn_request, binding_in=binding) |
| 521 | + "^{}$".format( |
| 522 | + join_paths(self.base_path, backend_providers, endp_path) |
| 523 | + ), |
| 524 | + functools.partial( |
| 525 | + self.handle_authn_request, binding_in=binding |
| 526 | + ), |
522 | 527 | )
|
523 | 528 | )
|
524 | 529 |
|
@@ -766,14 +771,20 @@ def _register_endpoints(self, providers):
|
766 | 771 | """
|
767 | 772 | url_map = []
|
768 | 773 |
|
769 |
| - backend_providers = "|".join(providers) |
| 774 | + backend_providers = "(" + "|".join(providers) + ")" |
770 | 775 | for endp_category in self.endpoints:
|
771 | 776 | for binding, endp in self.endpoints[endp_category].items():
|
772 | 777 | endp_path = urlparse(endp).path
|
773 | 778 | url_map.append(
|
774 | 779 | (
|
775 |
| - "^{}/({})/\S+/{}$".format(self.base_path, backend_providers, endp_path), |
776 |
| - functools.partial(self.handle_authn_request, binding_in=binding) |
| 780 | + "^{}$".format( |
| 781 | + join_paths( |
| 782 | + self.base_path, backend_providers, "\S+", endp_path |
| 783 | + ) |
| 784 | + ), |
| 785 | + functools.partial( |
| 786 | + self.handle_authn_request, binding_in=binding |
| 787 | + ), |
777 | 788 | )
|
778 | 789 | )
|
779 | 790 |
|
|
0 commit comments