Skip to content

Commit

Permalink
fix: conformance to Avviso SPID n.41 v.2
Browse files Browse the repository at this point in the history
  • Loading branch information
damikael committed Jan 17, 2023
1 parent 3897754 commit 8e28fe2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
15 changes: 13 additions & 2 deletions src/test/1.3.17.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ class Test_1_3_17 extends TestMetadata {
constructor(metadata) {
super(metadata);
this.num = "1.3.17";
this.description = "The metadata CAN contain the claim id_token_encryption_alg_values_supported";
this.validation = "self";
this.description = "The metadata MUST NOT contain the claim id_token_encryption_alg_values_supported (Avviso SPID n.41 v.2)";
this.validation = "automatic";
}

async exec() {
super.exec();

if(this.metadata.configuration.id_token_encryption_alg_values_supported!=null
&& this.metadata.configuration.id_token_encryption_alg_values_supported!='') {

// if optional
//this.notes = "the claim id_token_encryption_alg_values_supported is not present";
//return true;

this.notes = this.metadata.configuration.id_token_encryption_alg_values_supported;
throw("the claim id_token_encryption_alg_values_supported is present");
}

this.notes = this.metadata.configuration.id_token_encryption_alg_values_supported;
return true;

Expand Down
15 changes: 13 additions & 2 deletions src/test/1.3.18.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,24 @@ class Test_1_3_18 extends TestMetadata {
constructor(metadata) {
super(metadata);
this.num = "1.3.18";
this.description = "The metadata CAN contain the claim id_token_encryption_enc_values_supported";
this.validation = "self";
this.description = "The metadata MUST NOT contain the claim id_token_encryption_enc_values_supported (Avviso SPID n.41 v.2)";
this.validation = "automatic";
}

async exec() {
super.exec();

if(this.metadata.configuration.id_token_encryption_enc_values_supported!=null
&& this.metadata.configuration.id_token_encryption_enc_values_supported!='') {

// if optional
//this.notes = "the claim id_token_encryption_enc_values_supported is not present";
//return true;

this.notes = this.metadata.configuration.id_token_encryption_enc_values_supported;
throw("the claim id_token_encryption_enc_values_supported is present");
}

this.notes = this.metadata.configuration.id_token_encryption_enc_values_supported;
return true;

Expand Down
16 changes: 8 additions & 8 deletions src/test/1.3.23.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ class Test_1_3_23 extends TestMetadata {
constructor(metadata) {
super(metadata);
this.num = "1.3.23";
this.description = "The metadata CAN contain the claim request_object_encryption_alg_values_supported";
this.validation = "self";
this.description = "The metadata MUST NOT contain the claim request_object_encryption_alg_values_supported (Avviso SPID n.41 v.2)";
this.validation = "automatic";
}

async exec() {
super.exec();

if(this.metadata.configuration.request_object_encryption_alg_values_supported==null
|| this.metadata.configuration.request_object_encryption_alg_values_supported=='') {
if(this.metadata.configuration.request_object_encryption_alg_values_supported!=null
&& this.metadata.configuration.request_object_encryption_alg_values_supported!='') {

// the encryption of request object is optional
this.notes = "the claim request_object_encryption_alg_values_supported is not present";
return true;
//this.notes = "the claim request_object_encryption_alg_values_supported is not present";
//return true;

//this.notes = this.metadata.configuration.request_object_encryption_alg_values_supported;
//throw("the claim request_object_encryption_alg_values_supported is not present");
this.notes = this.metadata.configuration.request_object_encryption_alg_values_supported;
throw("the claim request_object_encryption_alg_values_supported is present");
}

this.notes = this.metadata.configuration.request_object_encryption_alg_values_supported;
Expand Down
16 changes: 8 additions & 8 deletions src/test/1.3.24.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ class Test_1_3_24 extends TestMetadata {
constructor(metadata) {
super(metadata);
this.num = "1.3.24";
this.description = "The metadata MUST contain the claim request_object_encryption_enc_values_supported";
this.validation = "self";
this.description = "The metadata MUST NOT contain the claim request_object_encryption_enc_values_supported (Avviso SPID n.41 v.2)";
this.validation = "automatic";
}

async exec() {
super.exec();

if(this.metadata.configuration.request_object_encryption_enc_values_supported==null
|| this.metadata.configuration.request_object_encryption_enc_values_supported=='') {
if(this.metadata.configuration.request_object_encryption_enc_values_supported!=null
&& this.metadata.configuration.request_object_encryption_enc_values_supported!='') {

// the encryption of request object is optional
this.notes = "the claim request_object_encryption_enc_values_supported is not present";
return true;
//this.notes = "the claim request_object_encryption_enc_values_supported is not present";
//return true;

//this.notes = this.metadata.configuration.request_object_encryption_enc_values_supported;
//throw("the claim request_object_encryption_enc_values_supported is not present");
this.notes = this.metadata.configuration.request_object_encryption_enc_values_supported;
throw("the claim request_object_encryption_enc_values_supported is present");
}

this.notes = this.metadata.configuration.request_object_encryption_enc_values_supported;
Expand Down

0 comments on commit 8e28fe2

Please sign in to comment.