定制 minvws/puzi-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

minvws/puzi-php

Composer 安装命令:

composer require minvws/puzi-php

包简介

PHP library to read data from an UZI pass.

README 文档

README

pUZI logo

pUZI php

PHP

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:

  1. a reader that interprets the PKCS11 data the card middleware provides to the webserver and returns an UziUser object in return (this repository).
  2. middleware (currently only for the Laravel framework) that allows authentication and user creation based on UZI cards.

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

  • PHP >= 7.4

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-php

Manual

Add the following to your composer.json and then run composer install.

{
    "require": {
        "minvws/puzi-php": "^v2.0"
    }
}

Usage

// Request from your framework/controller
$uzi = new \MinVWS\PUZI\UziReader();
$user = $uzi->getDataFromRequest($request);
print $user->getUziNumber();

// In case of no request (deprecated):
$uzi = new \MinVWS\PUZI\UziReader();
$user = $uzi->getData();

print $user->getUziNumber();
var_dump($user->toArray());
array(9) {
  'agb_code' =>
  string(8) "00000000"
  'card_type' =>
  string(1) "N"
  'given_name' =>
  string(4) "john"
  'oid_ca' =>
  string(25) "2.16.528.1.1003.1.3.5.5.2"
  'role' =>
  string(6) "01.015"
  'subscriber_number' =>
  string(6) "90000111"
  'sur_name' =>
  string(12) "doe-11111111"
  'uzi_number' =>
  string(8) "11111111"
  'uzi_version' =>
  string(1) "1"
  'serial_number' =>
  string(8) "11111111"
}

This package also allows validation of the request:

$allowedTypes = [
    UziConstants::UZI_TYPE_CARE_PROVIDER,
    UziConstants::UZI_TYPE_NAMED_EMPLOYEE,
];
$allowedRoles = [
    UziConstants::UZI_ROLE_DOCTOR,    
    UziConstants::UZI_ROLE_PHARMACIST,    
];

$validator = new UziValidator(new UziReader(), true, $allowedTypes, $allowedRoles);
if ($validator->isValid($request)) {
    print "Validated as doctor or pharmasist";
}

You can use either isValid(), which returns a boolean, or validate() which throws an exception when not correctly validated.

Uses

Used by

Alternatives

Contributing

  1. Fork the Project

  2. Ensure you have Composer installed (see Composer Download Instructions)

  3. Install Development Dependencies

    composer install
  4. Create a Feature Branch

  5. (Recommended) Run the Test Suite

    vendor/bin/phpunit
  6. (Recommended) Check whether your code conforms to our Coding Standards by running

    vendor/bin/phpstan analyse
    vendor/bin/psalm
    vendor/bin/phpcs
  7. Send us a Pull Request

pUZI

minvws/puzi-php 适用场景与选型建议

minvws/puzi-php 是一款 基于 Shell 开发的 Composer 扩展包,目前已累计 8.47k 次下载、GitHub Stars 达 8, 最近一次更新时间为 2021 年 03 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「security」 「cryptography」 「crypto」 「signature」 「x509」 「x.509」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 minvws/puzi-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 minvws/puzi-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 minvws/puzi-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 26
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 11
  • Forks: 5
  • 开发语言: Shell

其他信息

  • 授权协议: EUPL-1.2
  • 更新时间: 2021-03-08