Skip to content

Commit

Permalink
Merge pull request #22 from DSorlov/dev
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
DSorlov committed Mar 22, 2023
2 parents aeeabe2 + f1c9852 commit da64b1a
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 82 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 Daniel Sörlöv
Copyright (c) 2020-2023 Daniel Sörlöv

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 12 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ The format is based on [Keep a Changelog][keep-a-changelog]

## [Unreleased]

## [1.0.1] (2023-03-22)

### Added
- Updates to support new attributes in frejaeid
- New certificates to support rollover in 2023
- Bumped jsonwebtoken to 9.0.0

### Notable changes
- Field names in frejaeid under extras have been normalized
- Versions under 1.0.0 are no longer supported for security updates

## [1.0.0] (2021-06-05)

### Breaking changes
Expand Down Expand Up @@ -117,6 +128,7 @@ The format is based on [Keep a Changelog][keep-a-changelog]

[keep-a-changelog]: http://keepachangelog.com/en/1.0.0/
[Unreleased]: https://github.com/DSorlov/eid-provider/compare/master...dev
[1.0.1]: https://github.com/DSorlov/eid-provider/releases/tag/v1.0.0
[1.0.0]: https://github.com/DSorlov/eid-provider/releases/tag/v1.0.0
[0.2.1]: https://github.com/DSorlov/eid-provider/releases/tag/v0.2.1
[0.2.0]: https://github.com/DSorlov/eid-provider/releases/tag/v0.2.0
Expand Down
28 changes: 28 additions & 0 deletions clients/frejaeid/cert/prod_wSYLdhe93ToPR2X1UrNXxOg1juI.jwt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
MIIEvDCCAySgAwIBAgIUO7H1JLQ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KoZIhvcNAQELBQADggGBAH/lokazs32mk5QlUYTZBkoP5IOxuYbm8pbr/pgDfz/E
NEJ8OWycfDuS/fBBL59OwjOfWBlmFdDtUXoTYCjYjNVrIvfNOE62dAXN4RzqBq+c
Uoov6MDvYfARi1B3wWuAwbZ2swNRuh/NyNLB3RsfHXya/XjA3w2MYfIeytKdBvcS
LMOiwx4wxePtox8OuL0H6wAA8mmJdW0lCPyAyYiRRmP91DpLQwpXGCgN6MLJwpAA
t611z17VoZhYT6PaSHvhyV05q3o/ayRFAp2xTh7ZoAALsBcEeaSg27RuuxxHFDeW
6aqsZiUbkqEdBvaUcbN7s33O1gTLnPLhsTjMTtjwKfLCd+1jR32MQw1WdXXpgZRF
pIgy5DW9jrOeFGUOfc+wErAeykm+XlrsBC/I3/mRra1fLYnvLToTkHPfWl1jQYfA
E38EAlxcQpaV46znmReHq/xB+/yTWLboJO/UMgp8PyqCiumP4kXu7oLJ++48R+nu
kptNjrjW1RSy4YOYySFxuA==
-----END CERTIFICATE-----
24 changes: 24 additions & 0 deletions clients/frejaeid/cert/test_DiZbzBfysUm6-IwI-GtienEsbjc.jwt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID+zCCAuOgAwIBAgIUXB3gwjUzjQcd77CDrCgXXbeQPowwDQYJKoZIhvcNAQEL
BQAwgYMxCzAJBgNVBAYTAlNFMRIwEAYDVQQHEwlTdG9ja2hvbG0xFDASBgNVBGET
CzU1OTExMC00ODA2MR0wGwYDVQQKExRWZXJpc2VjIEZyZWphIGVJRCBBQjENMAsG
A1UECxMEVGVzdDEcMBoGA1UEAxMTUlNBIFRFU1QgSXNzdWluZyBDQTAeFw0yMzAy
MjMxMTQ4MThaFw0yNjAyMjMxMTQ4MThaMHUxIzAhBgNVBAMTGkZyZWphIGVJRCBU
RVNUIEpXUyBTaWduaW5nMRQwEgYDVQRhEws1NTkxMTAtNDgwNjENMAsGA1UECxME
VGVzdDEcMBoGA1UEChMTRnJlamEgZUlEIFN3ZWRlbiBBQjELMAkGA1UEBhMCU0Uw
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDiMthhWkZT9Ovye8qzJpL/
jHQODkVUUvQTvrE7uhG8rLKfya125XzIqfCAltazpfHS8e4o1cfET9PJ1YgsMlcE
UszMpgvDbBeBm28LipFUk1njXTtGV39+lQ88KLpTHKhRPRxEdmRpcMuX1tHD13a3
N0jwhcAWrFuZLsiheP1i7xNKda2Rontsg3prFPtzY4sW9kO1UQfOecay/MqIpGbs
uH7kQbIDrY18Z1TNX8YRc5E+K69gZTBl+pLjjpZy49P02HriKA3a8upU0QKSqio8
X1pkllBpXiIjib+Hxoze6xqnHfi3iHXidNjtxsam8b+gwwafKpSCFfl/rswTpPNR
AgMBAAGjdDByMA4GA1UdDwEB/wQEAwIGwDAMBgNVHRMBAf8EAjAAMB8GA1UdIwQY
MBaAFGp8ig+dcA4c2l8toDwmX4joFb+cMBIGA1UdIAQLMAkwBwYFKgMEBQowHQYD
VR0OBBYEFL10m8p9GIWlWojIKxoXROpmkDdfMA0GCSqGSIb3DQEBCwUAA4IBAQAU
YsxIpDi7iju0yvupfhrGDyJk8AX7aDmhpyYWx+EitDHqI9aqULH+9GxEFRCor+Y2
a0d7hzkRzSITma0bvS+evpd4QwIhRRf00RASqnY4g4J+8knFoT7AJ7r2oJpogrzR
8L7e5BJUnnDA9btBh01Jq5Rh4aY3azRHFeS9E26/NaRbZhOaE23r8EDGGt1oYGOA
DkC2ouiJgnELga7DnYjroCDXRfzTeb2lmQzjyAp+tjW1MO1fQuN5cElyJkxDRtAS
0TTGXdXux9UDCFjJL+ZaMJxOFdX9i2gQTlMitY8FzQ10pFiGt77h93TQjTS/Sfz1
K2wpZ6CXk/WQQs1aXOl7
-----END CERTIFICATE-----
36 changes: 27 additions & 9 deletions clients/frejaeid/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,40 @@ class FrejaEID extends BaseClient {
var fullname = '';
var id = userId;
var extras = {
jwt_token: result.json.details
jwtToken: result.json.details
};

if (decoded.requestedAttributes.dateOfBirth) extras.date_of_birth = decoded.requestedAttributes.dateOfBirth;
if (decoded.requestedAttributes.emailAddress) extras.primary_email = decoded.requestedAttributes.emailAddress;
if (decoded.requestedAttributes.allEmailAddresses) extras.email_addresses = decoded.requestedAttributes.allEmailAddresses;
if (decoded.requestedAttributes.allPhoneNumbers) extras.phone_numbers = decoded.requestedAttributes.allPhoneNumbers;
if (decoded.requestedAttributes.age) extras.age = decoded.requestedAttributes.age;
if (decoded.requestedAttributes.photo) extras.age = decoded.requestedAttributes.photo;
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.custom_identifier = decoded.requestedAttributes.customIdentifier;
if (decoded.requestedAttributes.registrationLevel) extras.registration_level = decoded.requestedAttributes.registrationLevel;
if (decoded.requestedAttributes.customIdentifier) extras.customIdentifier = decoded.requestedAttributes.customIdentifier;
if (decoded.requestedAttributes.registrationLevel) extras.registrationLevel = decoded.requestedAttributes.registrationLevel;

if (decoded.requestedAttributes.ssn) {
extras.ssn_number = decoded.requestedAttributes.ssn.ssn;
extras.ssn_country = decoded.requestedAttributes.ssn.country;
extras.ssnNumber = decoded.requestedAttributes.ssn.ssn;
extras.ssnCountry = decoded.requestedAttributes.ssn.country;
}

if (decoded.requestedAttributes.document) {
extras.documentType = decoded.requestedAttributes.document.type;
extras.documentCountry = decoded.requestedAttributes.document.country;
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: 1 addition & 1 deletion clients/frejaeid/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Client for direct API communication with Freja eID REST API (Freja eID AB).

| Information | |
| --- | --- |
| Version | 20210406 |
| Version | 20230322 |
| Status | Built-in |
| Author | Daniel Sörlöv <daniel@sorlov.com> |
| Client URL | https://github.com/DSorlov/eid-provider |
Expand Down
6 changes: 4 additions & 2 deletions clients/frejaeid/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ 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'))
'aRw9OLn2BhM7hxoc458cIXHfezw': fs.readFileSync(path.join(__dirname,'/cert','prod_aRw9OLn2BhM7hxoc458cIXHfezw.jwt')),
'wSYLdhe93ToPR2X1UrNXxOg1juI': fs.readFileSync(path.join(__dirname,'/cert','prod_wSYLdhe93ToPR2X1UrNXxOg1juI.jwt'))
},
minimumLevel: 'EXTENDED',
default_country: 'SE',
Expand All @@ -26,7 +27,8 @@ 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'))
'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',
password: 'test',
Expand Down
143 changes: 79 additions & 64 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "eid",
"version": "1.0.0",
"version": "1.0.1",
"description": "Module for simple integration to electronic identities",
"bundleDependencies": false,
"deprecated": false,
"main": "index.js",
"author": "Daniel Sörlöv",
"license": "MIT",
"dependencies": {
"jsonwebtoken": "^8.5.1"
"jsonwebtoken": "^9.0.0"
},
"repository": {
"type": "git",
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.0-green.svg)
![maintained](https://img.shields.io/maintenance/yes/2022.svg)
![version](https://img.shields.io/badge/version-1.0.1-green.svg)
![maintained](https://img.shields.io/maintenance/yes/2023.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
2 changes: 1 addition & 1 deletion security.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The following versions are supported for security updates.
| Version | Supported |
| ------- | ------------------ |
| 1.0.0+ | :white_check_mark: |
| 0.2.1 | :white_check_mark: |
| 0.2.1 | :x: |
| <0.2.0 | :x: |

## Reporting a Vulnerability
Expand Down

0 comments on commit da64b1a

Please sign in to comment.