Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • perun/perun-proxyidp/v1/simplesamlphp-module-cesnet
1 result
Show changes
Commits on Source (4)
## [4.2.2](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/compare/v4.2.1...v4.2.2) (2023-11-28)
### Bug Fixes
* 🐛 Potential Undefined array key in ComputeLoa.php ([e5cc064](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/commit/e5cc064200fce223c4d560f84b1def21245b7919))
* 🐛 potential Undefined array keys in IsCesnetEligible ([f7b3bf4](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/commit/f7b3bf4ab20e2835ed1170a7f09fc1d75c8aafcc))
## [4.2.1](https://gitlab.ics.muni.cz/perun-proxy-aai/simplesamlphp/simplesamlphp-module-cesnet/compare/v4.2.0...v4.2.1) (2023-11-28)
......
......@@ -40,7 +40,7 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter
{
parent::__construct($config, $reserved);
if (isset($config['attrName'])) {
if (!empty($config['attrName'])) {
$this->attrName = $config['attrName'];
} else {
$this->attrName = self::DEFAULT_ATTR_NAME;
......@@ -51,13 +51,13 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter
{
assert('is_array($request)');
if (isset($request['Attributes'][$this->attrName])) {
if (!empty($request['Attributes'][$this->attrName])) {
return;
}
$this->metadata = MetaDataStorageHandler::getMetadataHandler();
$sourceIdpMeta = $this->metadata->getMetaData($request['saml:sp:IdP'], 'saml20-idp-remote');
if (isset($sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category'])) {
if (!empty($sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category'])) {
$entityCategoryAttributes = $sourceIdpMeta['EntityAttributes']['http://macedir.org/entity-category'];
} else {
Logger::error('cesnet:ComputeLoA - There are no element with name \'EntityAttributes\' '
......@@ -66,7 +66,7 @@ class ComputeLoA extends \SimpleSAML\Auth\ProcessingFilter
$entityCategoryAttributes = [];
}
if (isset($request['Attributes']['eduPersonScopedAffiliation'])) {
if (!empty($request['Attributes']['eduPersonScopedAffiliation'])) {
$this->eduPersonScopedAffiliation = $request['Attributes']['eduPersonScopedAffiliation'];
} else {
Logger::error(
......
......@@ -85,7 +85,7 @@ class IsCesnetEligible extends ProcessingFilter
{
parent::__construct($config, $reserved);
$conf = Configuration::loadFromArray($config);
if (!isset($config[self::RPC_ATTRIBUTE_NAME]) || empty($config[self::RPC_ATTRIBUTE_NAME])) {
if (empty($config[self::RPC_ATTRIBUTE_NAME])) {
throw new Exception(
'cesnet:IsCesnetEligible - missing mandatory configuration option \'' . self::RPC_ATTRIBUTE_NAME . '\'.'
);
......@@ -96,13 +96,13 @@ class IsCesnetEligible extends ProcessingFilter
$this->cesnetLdapConnector = (new AdapterLdap(self::CONFIG_FILE_NAME))->getConnector();
$this->rpcAdapter = Adapter::getInstance(Adapter::RPC);
if (isset($config[self::ATTR_NAME]) && !empty($config[self::ATTR_NAME])) {
if (!empty($config[self::ATTR_NAME])) {
$this->returnAttrName = $config['attrName'];
}
if (
isset($config[self::INTERFACE_PROPNAME], $config[self::LDAP_ATTRIBUTE_NAME]) &&
$config[self::INTERFACE_PROPNAME] === self::LDAP && !empty($config[self::LDAP_ATTRIBUTE_NAME])
($config[self::INTERFACE_PROPNAME] ?? self::RPC) === self::LDAP
&& !empty($config[self::LDAP_ATTRIBUTE_NAME])
) {
$this->interface = $config[self::INTERFACE_PROPNAME];
$this->ldapAttrName = $config[self::LDAP_ATTRIBUTE_NAME];
......@@ -119,7 +119,7 @@ class IsCesnetEligible extends ProcessingFilter
$conf->getString(self::PERUN_USER_SPONSORING_ORGANIZATIONS_ATTR_NAME, null);
$this->userAffiliationsAttrName = $conf->getString(self::PERUN_USER_AFFILIATIONS_ATTR_NAME, null);
if (!isset($this->userAffiliationsAttrName, $this->userSponsoringOrganizationsAttrName)) {
if (empty($this->userAffiliationsAttrName) || empty($this->userSponsoringOrganizationsAttrName)) {
Logger::warning(
'cesnet:IsCesnetEligible - One of attributes [' . $this->userAffiliationsAttrName . ', ' .
$this->userSponsoringOrganizationsAttrName . '] wasn\'t set!'
......@@ -129,7 +129,7 @@ class IsCesnetEligible extends ProcessingFilter
public function process(&$request)
{
if (isset($request['perun']['user'])) {
if (!empty($request['perun']['user'])) {
$user = $request['perun']['user'];
} else {
Logger::debug(
......@@ -140,7 +140,7 @@ class IsCesnetEligible extends ProcessingFilter
}
$this->idpEntityId = $request['saml:sp:IdP'];
if (isset($request['Attributes']['eduPersonScopedAffiliation'])) {
if (!empty($request['Attributes']['eduPersonScopedAffiliation'])) {
$this->eduPersonScopedAffiliation
= $request['Attributes']['eduPersonScopedAffiliation'];
} else {
......@@ -153,7 +153,7 @@ class IsCesnetEligible extends ProcessingFilter
if (!empty($user)) {
if ($this->interface === self::LDAP) {
$attrs = $this->adapter->getUserAttributes($user, [$this->ldapAttrName]);
if (isset($attrs[$this->ldapAttrName][0])) {
if (!empty($attrs[$this->ldapAttrName][0])) {
$this->cesnetEligibleLastSeenValue = $attrs[$this->ldapAttrName][0];
}
} else {
......
......@@ -61,7 +61,7 @@ class IsEinfraCZEligible extends ProcessingFilter
public function process(&$request)
{
$userScopedAffiliations = [];
if (isset($request['Attributes'][$this->userAffiliationAttr])) {
if (!empty($request['Attributes'][$this->userAffiliationAttr])) {
$userScopedAffiliations
= $request['Attributes'][$this->userAffiliationAttr];
} else {
......