Skip to content

Commit

Permalink
Merge pull request #220 from nunzionapoli/Agg_private
Browse files Browse the repository at this point in the history
feat: aggiunta profili aggregatori servizi privati
  • Loading branch information
damikael authored May 25, 2022
2 parents 997af38 + 5af8cc0 commit 0818791
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions spid-validator/server/api/metadata-sp.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ module.exports = function(app, checkAuthorisation, getEntityDir, database) {
if(metadataParser.isMetadataForAgPublicLite()) profile = "spid-sp-ag-public-lite";
if(metadataParser.isMetadataForOpPublicFull()) profile = "spid-sp-op-public-full";
if(metadataParser.isMetadataForOpPublicLite()) profile = "spid-sp-op-public-lite";
if(metadataParser.isMetadataForAgPrivateFull()) profile = "spid-sp-ag-private-full";
if(metadataParser.isMetadataForAgPrivateLite()) profile = "spid-sp-ag-private-lite";

switch(cmd) {
case "strict": file = getEntityDir(entity_id) + "/sp-metadata-strict.json"; break;
Expand Down
18 changes: 16 additions & 2 deletions spid-validator/server/lib/saml-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class MetadataParser {
isMetadataForAggregated() {
let contactPerson = this.getSPIDContactPerson();

let assertLength = (contactPerson.length==2);
// let assertLength = (contactPerson.length==2); !!!non valido per gli aggregatori privati
let assertAggregator = false;
let assertAggregated = false;

Expand All @@ -411,7 +411,8 @@ class MetadataParser {
assertAggregated = assertAggregated || (contactPerson[n].entityType=="spid:aggregated");
}

return assertLength && assertAggregator && assertAggregated;
// return assertLength && assertAggregator && assertAggregated;
return assertAggregator && assertAggregated;
}

isMetadataForOperator() {
Expand Down Expand Up @@ -460,6 +461,19 @@ class MetadataParser {
return this.isMetadataForOperator() && checkActivityCode;
}

isMetadataForAgPrivateFull() {
let entityId = this.getServiceProviderEntityId();
let checkActivityCode = entityId.indexOf('pri-ag-full') > -1;
return this.isMetadataForAggregated() && checkActivityCode;
}

isMetadataForAgPrivateLite() {
let entityId = this.getServiceProviderEntityId();
let checkActivityCode = entityId.indexOf('pri-ag-lite') > -1;
return this.isMetadataForAggregated() && checkActivityCode;
}


}


Expand Down

0 comments on commit 0818791

Please sign in to comment.