minvws / puzi-auth-bundle
Symfony authentication middleware for UZI passes.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 9
Forks: 0
Open Issues: 2
Type:symfony-bundle
Requires
- php: >=7.3
- minvws/puzi-php: ^0.5
- symfony/framework-bundle: ^3.4.23|^4.3|^4.4|^5.0
- symfony/security-core: ^3.4.23|^4.3|^4.4|^5.0
Requires (Dev)
- mockery/mockery: ^1.4
- phpstan/phpstan: ^0.12.80
- phpstan/phpstan-symfony: ^0.12.22
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-06 12:11:20 UTC
README
UZI authentication bundle for Symfony
Proficient UZI pass reader in php.
The UZI card is part of an authentication mechanism for medical staff and doctors working in the Netherlands. The cards are distributed by the CIBG. More information and the relevant client software can be found at www.uziregister.nl (in Dutch).
pUZI is a simple and functional module which allows you to use the UZI cards as authentication mechanism. It consists of:
- a reader that reads the data on the card and gives an UziUser object in return.
- a validator that will check the given UziUser against a set of types and roles.
- a symfony guard authenticator that allows authentication based on UZI cards (this repository).
For documentation, software and to apply for an UZI card, please check out www.uziregister.nl.
pUZI is available under the EU PL licence. It was created early 2021 during the COVID19 campaign as part of the vaccination registration project BRBA for the ‘Ministerie van Volksgezondheid, Welzijn & Sport, programma Realisatie Digitale Ondersteuning.’
Questions and contributions are welcome via GitHub.
Requirements
- Symfony 4 or higher
Apache config (or NginX equivalent):
SSLEngine on SSLProtocol -all +TLSv1.3 SSLHonorCipherOrder on SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 SSLVerifyClient require SSLVerifyDepth 3 SSLCACertificateFile /path/to/uziCA.crt SSLOptions +StdEnvVars +ExportCertData
Installation
Composer
composer require minvws/puzi-auth-bundle
Usage
Step 1: install bundle with composer:
composer require minvws/puzi-auth-bundle
Step 2: create a configuration file:
# config/packages/puzi_auth.yaml
puzi_auth:
strict_ca_check: true
allowed_types:
- !php/const MinVWS\PUZI\UziConstants::UZI_TYPE_NAMED_EMPLOYEE
- !php/const MinVWS\PUZI\UziConstants::UZI_TYPE_CARE_PROVIDER
allowed_roles:
- !php/const MinVWS\PUZI\UziConstants::UZI_ROLE_DOCTOR
Step 3: add the guard to your security.yml
:
firewalls:
main:
guard:
authenticators:
- puzi_auth.security.guard.authenticator
stateless: true
At this point, an authenticated user will be of the MinVWS\PUZI\AuthBundle\Security\User\UziUser
class. You
can fetch any information about the UZI card itself with $this->getUser()->getUzi()
.
Uses
puzi-php - Proficient UZI pass reader in PHP
phpseclib - PHP Secure Communications Library
Contributing
-
Fork the Project
-
Ensure you have Composer installed (see Composer Download Instructions)
-
Install Development Dependencies
composer install
-
Create a Feature Branch
-
(Recommended) Run the Test Suite
vendor/bin/phpunit
-
(Recommended) Check whether your code conforms to our Coding Standards by running
vendor/bin/phpstan analyse vendor/bin/phpcs
-
Send us a Pull Request