wrap slo endpoints in try/catch pairs

This commit is contained in:
<bdauvergne@entrouvert.com> 1209045379 +0200 0001-01-01 00:00:00 +00:00
parent 1416db4063
commit b22c830c98
1 changed files with 28 additions and 10 deletions

View File

@ -65,21 +65,39 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch {
}
/** Profiles initiés par l'IdP */
function sloBrws() {
$profile = $this->getProfileObject();
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
$query_string = $this->getQueryString($http_method);
return $profile->processRequestSLO($http_method, $query_string);
try {
$profile = $this->getProfileObject();
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
$query_string = $this->getQueryString($http_method);
return $profile->processRequestSLO($http_method, $query_string);
} catch (LassoError $e) {
return $e->getCode();
} catch (Exception $e) {
return -1;
}
}
function sloSoap() {
$profile = $this->getProfileObject();
return $profile->processSOAPRequestSLO();
try {
$profile = $this->getProfileObject();
return $profile->processSOAPRequestSLO();
} catch (LassoError $e) {
return $e->getCode();
} catch (Exception $e) {
return -1;
}
}
/** Profiles initiés par le SP */
function sloReturn() {
$profile = $this->getProfileObject();
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
$query_string = $this->getQueryString($http_method);
return $profile->processResponseSLO($http_method, $query_string);
try {
$profile = $this->getProfileObject();
$http_method = $this->limitMethodBrws($this->identifyHttpMethod());
$query_string = $this->getQueryString($http_method);
return $profile->processResponseSLO($http_method, $query_string);
} catch (LassoError $e) {
return $e->getCode();
} catch (Exception $e) {
return -1;
}
}
function identifyHttpMethod() {
if (isset($_POST) && ( isset($_POST['SAMLResponse']) || isset($_POST['SAMLRequest']))) {