Skip to content

Commit

Permalink
Merge pull request #27 from DSorlov/dev
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
DSorlov authored Feb 25, 2024
2 parents 5784ff6 + 28d7263 commit b0f09ee
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 89 deletions.
15 changes: 14 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,25 @@
The format is based on [Keep a Changelog][keep-a-changelog]
<!-- and this project adheres to [Semantic Versioning][semantic-versioning]. -->

## [1.1.0] (2024-02-25)

### Removed
- Removed old certificates from frejaeid
- Fixed versioning missmatch

### Fixed
- Freja eID Photo seems broken but implemented the filehash
- Freja eID Covid Certificates feature removed
- Broken bankid qr-code generation have been fixed

### Changes
- In Freja eID both email and phone number object arrays have been flattened to string arrays

## [1.0.3] (2023-05-26)

### Added
- Fixed error handling in baseclient.js


## [1.0.2] (2023-04-05)

### Added
Expand Down
4 changes: 2 additions & 2 deletions clients/bankid/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BankID extends BaseClient {

this.clientInfo = {
name: "BankID",
version: "20210406",
version: "20240225",
author: "Daniel Sörlöv <[email protected]>",
url: "https://github.com/DSorlov/eid-provider",
methods: ['auth','sign']
Expand Down Expand Up @@ -158,7 +158,7 @@ class BankID extends BaseClient {
qrStartSecret: result.json.qrStartSecret,
qrStartToken: result.json.qrStartToken,
qrAuthTime: Date(),
qrCodeString: createQRCodeString
qrCodeString: this.createQRCodeString(result.json)
});
} else {
return this._createInitializationMessage(result.json.orderRef, {
Expand Down
28 changes: 0 additions & 28 deletions clients/frejaeid/cert/prod_aRw9OLn2BhM7hxoc458cIXHfezw.jwt

This file was deleted.

24 changes: 0 additions & 24 deletions clients/frejaeid/cert/test_2LQIrINOzwWAVDhoYybqUcXXmVs.jwt

This file was deleted.

33 changes: 18 additions & 15 deletions clients/frejaeid/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FrejaEID extends BaseClient {

this.clientInfo = {
name: "FrejaEID",
version: "20230415",
version: "20240225",
author: "Daniel Sörlöv <[email protected]>",
url: "https://github.com/DSorlov/eid-provider",
methods: ['auth','sign']
Expand Down Expand Up @@ -149,15 +149,27 @@ class FrejaEID extends BaseClient {
};

if (decoded.requestedAttributes.age) extras.age = decoded.requestedAttributes.age;
if (decoded.requestedAttributes.photo) extras.age = decoded.requestedAttributes.photo;
if (decoded.requestedAttributes.photoFileInfo) extras.photo = decoded.requestedAttributes.photoFileInfo.fileHash;
if (decoded.requestedAttributes.dateOfBirth) extras.dateOfBirth = decoded.requestedAttributes.dateOfBirth;
if (decoded.requestedAttributes.emailAddress) extras.primaryEmail = decoded.requestedAttributes.emailAddress;
if (decoded.requestedAttributes.allEmailAddresses) extras.emailAddresses = decoded.requestedAttributes.allEmailAddresses;
if (decoded.requestedAttributes.allPhoneNumbers) extras.phoneNumbers = decoded.requestedAttributes.allPhoneNumbers;
if (decoded.requestedAttributes.addresses) extras.addresses = decoded.requestedAttributes.addresses;
if (decoded.requestedAttributes.customIdentifier) extras.customIdentifier = decoded.requestedAttributes.customIdentifier;
if (decoded.requestedAttributes.relyingPartyUserId) extras.relyingPartyUserId = decoded.requestedAttributes.relyingPartyUserId;
if (decoded.requestedAttributes.registrationLevel) extras.registrationLevel = decoded.requestedAttributes.registrationLevel;


if (decoded.requestedAttributes.allEmailAddresses) {
extras.emailAddresses = [];
decoded.requestedAttributes.allEmailAddresses.forEach((emailObject)=>{
extras.emailAddresses.push(emailObject.emailAddress);
})
}
if (decoded.requestedAttributes.allPhoneNumbers) {
extras.phoneNumbers = [];
decoded.requestedAttributes.allPhoneNumbers.forEach((phoneObject)=>{
extras.phoneNumbers.push(phoneObject.phoneNumber);
})
}

if (decoded.requestedAttributes.ssn) {
extras.ssnNumber = decoded.requestedAttributes.ssn.ssn;
extras.ssnCountry = decoded.requestedAttributes.ssn.country;
Expand All @@ -169,16 +181,7 @@ class FrejaEID extends BaseClient {
extras.documentNumber = decoded.requestedAttributes.document.serialNumber;
extras.documentExpiration = decoded.requestedAttributes.document.expirationDate;
}

if (decoded.requestedAttributes.covidCertificates) {
if (decoded.requestedAttributes.covidCertificates.allowed == "true") {
extras.covidVaccines = decoded.requestedAttributes.covidCertificates.vaccines.certificate;
extras.covidTests = decoded.requestedAttributes.covidCertificates.tests.certificate;
extras.covidRecovery = decoded.requestedAttributes.covidCertificates.recovery.certificate;
}
}



if (decoded.requestedAttributes.basicUserInfo) {
firstname = decoded.requestedAttributes.basicUserInfo ? decoded.requestedAttributes.basicUserInfo.name : '',
lastname = decoded.requestedAttributes.basicUserInfo ? decoded.requestedAttributes.basicUserInfo.surname : '',
Expand Down
2 changes: 0 additions & 2 deletions clients/frejaeid/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = function(options) {
password: '',
ca_cert: fs.readFileSync(path.join(__dirname,'/cert','prod.ca')),
jwt_cert: {
'aRw9OLn2BhM7hxoc458cIXHfezw': fs.readFileSync(path.join(__dirname,'/cert','prod_aRw9OLn2BhM7hxoc458cIXHfezw.jwt')),
'wSYLdhe93ToPR2X1UrNXxOg1juI': fs.readFileSync(path.join(__dirname,'/cert','prod_wSYLdhe93ToPR2X1UrNXxOg1juI.jwt'))
},
minimumLevel: 'EXTENDED',
Expand All @@ -28,7 +27,6 @@ module.exports = function(options) {
client_cert: fs.readFileSync(path.join(__dirname,'/cert','test.pfx')),
ca_cert: fs.readFileSync(path.join(__dirname,'/cert','test.ca')),
jwt_cert: {
'2LQIrINOzwWAVDhoYybqUcXXmVs': fs.readFileSync(path.join(__dirname,'/cert','test_2LQIrINOzwWAVDhoYybqUcXXmVs.jwt')),
'DiZbzBfysUm6-IwI-GtienEsbjc': fs.readFileSync(path.join(__dirname,'/cert','test_DiZbzBfysUm6-IwI-GtienEsbjc.jwt'))
},
minimumLevel: 'EXTENDED',
Expand Down
64 changes: 50 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eid",
"version": "1.0.3",
"version": "1.1.0",
"description": "Module for simple integration to electronic identities",
"bundleDependencies": false,
"deprecated": false,
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![NPM version](https://img.shields.io/npm/v/eid.svg?style=flat)
![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)
![version](https://img.shields.io/badge/version-1.0.3-green.svg)
![maintained](https://img.shields.io/maintenance/yes/2023.svg)
![version](https://img.shields.io/badge/version-1.1.0-green.svg)
![maintained](https://img.shields.io/maintenance/yes/2024.svg)
[![maintainer](https://img.shields.io/badge/maintainer-dsorlov-blue.svg)](https://github.com/DSorlov)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://img.shields.io/github/license/DSorlov/eid)

Expand Down

0 comments on commit b0f09ee

Please sign in to comment.