Update website
This commit is contained in:
parent
a0b0d3dae7
commit
ae7ef6ad45
3151 changed files with 566766 additions and 48 deletions
14
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/CHANGELOG.md
vendored
Normal file
14
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/CHANGELOG.md
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
## Change Log
|
||||
|
||||
## [1.0.2] - 2018-10-10
|
||||
### Changed
|
||||
- Dropped support for PHP 5.4 & PHP 5.5
|
||||
- Test QRCode by decoding it
|
||||
|
||||
## [1.0.1] - 2018-10-10
|
||||
### Added
|
||||
- Add support for more image renderer back ends
|
||||
|
||||
## [1.0.0] - 2018-10-06
|
||||
### Added
|
||||
- Package created
|
7
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/LICENSE.md
vendored
Normal file
7
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/LICENSE.md
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
Copyright 2014-2018 Phil, Antonio Carlos Ribeiro and All Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
111
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/README.md
vendored
Normal file
111
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/README.md
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
# Google2FA QRCode
|
||||
|
||||
<p align="center">
|
||||
<a href="https://packagist.org/packages/pragmarx/google2fa-qrcode"><img alt="Latest Stable Version" src="https://img.shields.io/packagist/v/pragmarx/google2fa-qrcode.svg?style=flat-square"></a>
|
||||
<a href="LICENSE.md"><img alt="License" src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square"></a>
|
||||
<a href="https://scrutinizer-ci.com/g/antonioribeiro/google2fa/?branch=master"><img alt="Code Quality" src="https://img.shields.io/scrutinizer/g/antonioribeiro/google2fa.svg?style=flat-square"></a>
|
||||
<a href="https://travis-ci.org/antonioribeiro/google2fa"><img alt="Build" src="https://img.shields.io/travis/antonioribeiro/google2fa.svg?style=flat-square"></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://packagist.org/packages/pragmarx/google2fa-qrcode"><img alt="Downloads" src="https://img.shields.io/packagist/dt/pragmarx/google2fa-qrcode.svg?style=flat-square"></a>
|
||||
<a href="https://scrutinizer-ci.com/g/antonioribeiro/google2fa/?branch=master"><img alt="Coverage" src="https://img.shields.io/scrutinizer/coverage/g/antonioribeiro/google2fa.svg?style=flat-square"></a>
|
||||
<a href="https://styleci.io/repos/24296182"><img alt="StyleCI" src="https://styleci.io/repos/24296182/shield"></a>
|
||||
<a href="https://travis-ci.org/antonioribeiro/google2fa"><img alt="PHP" src="https://img.shields.io/badge/PHP-5.4%20--%207.2-brightgreen.svg?style=flat-square"></a>
|
||||
</p>
|
||||
|
||||
### QRCode For Google2FA
|
||||
|
||||
This is package is [Goole2FA](https://github.com/antonioribeiro/google2fa) integrated with a QRCode generator, providing an easy way to plot QRCode for your two factor authentication. For documentation related to Google2FA, please check the [documentation of the main package](https://github.com/antonioribeiro/google2fa).
|
||||
|
||||
## Requirements
|
||||
|
||||
- PHP 5.4+
|
||||
|
||||
## Installing
|
||||
|
||||
Use Composer to install it:
|
||||
|
||||
```
|
||||
composer require pragmarx/google2fa-qrcode
|
||||
```
|
||||
|
||||
## Using It
|
||||
|
||||
### Instantiate it directly
|
||||
|
||||
```php
|
||||
use PragmaRX\Google2FAQRCode\Google2FA;
|
||||
|
||||
$google2fa = new Google2FA();
|
||||
|
||||
return $google2fa->generateSecretKey();
|
||||
```
|
||||
|
||||
## Generating QRCodes
|
||||
|
||||
The securer way of creating QRCode is to do it yourself or using a library. First you have to install the BaconQrCode package, as stated above, then you just have to generate the inline string using:
|
||||
|
||||
```php
|
||||
$inlineUrl = $google2fa->getQRCodeInline(
|
||||
$companyName,
|
||||
$companyEmail,
|
||||
$secretKey
|
||||
);
|
||||
```
|
||||
|
||||
And use it in your blade template this way:
|
||||
|
||||
```html
|
||||
<img src="{{ $inlineUrl }}">
|
||||
```
|
||||
|
||||
```php
|
||||
$secretKey = $google2fa->generateSecretKey(16, $userId);
|
||||
```
|
||||
|
||||
## Show the QR Code to your user, via Google Apis
|
||||
|
||||
It's insecure to use it via Google Apis, so you have to enable it before using it.
|
||||
|
||||
```php
|
||||
$google2fa->setAllowInsecureCallToGoogleApis(true);
|
||||
|
||||
$google2fa_url = $google2fa->getQRCodeGoogleUrl(
|
||||
'YourCompany',
|
||||
$user->email,
|
||||
$user->google2fa_secret
|
||||
);
|
||||
|
||||
/// and in your view:
|
||||
|
||||
<img src="{{ $google2fa_url }}" alt="">
|
||||
```
|
||||
|
||||
And they should see and scan the QR code to their applications:
|
||||
|
||||

|
||||
|
||||
And to verify, you just have to:
|
||||
|
||||
```php
|
||||
$secret = $request->input('secret');
|
||||
|
||||
$valid = $google2fa->verifyKey($user->google2fa_secret, $secret);
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
The package tests were written with [PHPUnit](https://phpunit.de/).
|
||||
|
||||
## Authors
|
||||
|
||||
- [Antonio Carlos Ribeiro](http://twitter.com/iantonioribeiro)
|
||||
- [All Contributors](https://github.com/antonioribeiro/google2fa/graphs/contributors)
|
||||
|
||||
## License
|
||||
|
||||
Google2FAQRCode is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and issues are more than welcome.
|
36
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/composer.json
vendored
Normal file
36
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/composer.json
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "pragmarx/google2fa-qrcode",
|
||||
"description": "QR Code package for Google2FA",
|
||||
"keywords": ["authentication", "two factor authentication", "google2fa", "2fa", "QRCode", "qr code"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Antonio Carlos Ribeiro",
|
||||
"email": "acr@antoniocarlosribeiro.com",
|
||||
"role": "Creator & Designer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.4",
|
||||
"pragmarx/google2fa": ">=4.0",
|
||||
"bacon/bacon-qr-code": "~1.0|~2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4|~5|~6|~7",
|
||||
"khanamiryan/qrcode-detector-decoder": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PragmaRX\\Google2FAQRCode\\": "src/",
|
||||
"PragmaRX\\Google2FAQRCode\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"component": "package",
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
1903
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/composer.lock
generated
vendored
Normal file
1903
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/composer.lock
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
134
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/src/Google2FA.php
vendored
Normal file
134
admin/phpMyAdmin/vendor/pragmarx/google2fa-qrcode/src/Google2FA.php
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
<?php
|
||||
|
||||
namespace PragmaRX\Google2FAQRCode;
|
||||
|
||||
use BaconQrCode\Renderer\Image\Png;
|
||||
use BaconQrCode\Renderer\Image\RendererInterface;
|
||||
use BaconQrCode\Writer as BaconQrCodeWriter;
|
||||
use PragmaRX\Google2FA\Google2FA as Google2FAPackage;
|
||||
|
||||
use BaconQrCode\Renderer\ImageRenderer;
|
||||
use BaconQrCode\Renderer\Image\ImageBackEndInterface;
|
||||
use BaconQrCode\Renderer\Image\ImagickImageBackEnd;
|
||||
use BaconQrCode\Renderer\RendererStyle\RendererStyle;
|
||||
use BaconQrCode\Writer;
|
||||
|
||||
class Google2FA extends Google2FAPackage
|
||||
{
|
||||
/**
|
||||
* @var ImageBackEndInterface|RendererInterface|null $imageBackEnd
|
||||
*/
|
||||
protected $imageBackEnd;
|
||||
|
||||
/**
|
||||
* Google2FA constructor.
|
||||
*
|
||||
* @param ImageBackEndInterface|RendererInterface|null $imageBackEnd
|
||||
*/
|
||||
public function __construct($imageBackEnd = null)
|
||||
{
|
||||
if ($this->getBaconQRCodeVersion() === 1) {
|
||||
if ($imageBackEnd instanceof RendererInterface) {
|
||||
$this->imageBackEnd = $imageBackEnd;
|
||||
} else {
|
||||
$this->imageBackEnd = new Png();
|
||||
}
|
||||
} else {
|
||||
if ($imageBackEnd instanceof ImageBackEndInterface) {
|
||||
$this->imageBackEnd = $imageBackEnd;
|
||||
} else {
|
||||
$this->imageBackEnd = new ImagickImageBackEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a QR code data url to display inline.
|
||||
*
|
||||
* @param string $company
|
||||
* @param string $holder
|
||||
* @param string $secret
|
||||
* @param int $size
|
||||
* @param string $encoding Default to UTF-8
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQRCodeInline($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
|
||||
{
|
||||
return $this->getBaconQRCodeVersion() === 1
|
||||
? $this->getQRCodeInlineV1($company, $holder, $secret, $size, $encoding)
|
||||
: $this->getQRCodeInlineV2($company, $holder, $secret, $size, $encoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a QR code data url to display inline for Bacon QRCode v1
|
||||
*
|
||||
* @param string $company
|
||||
* @param string $holder
|
||||
* @param string $secret
|
||||
* @param int $size
|
||||
* @param string $encoding Default to UTF-8
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQRCodeInlineV1($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
|
||||
{
|
||||
$url = $this->getQRCodeUrl($company, $holder, $secret);
|
||||
|
||||
$renderer = $this->imageBackEnd;
|
||||
$renderer->setWidth($size);
|
||||
$renderer->setHeight($size);
|
||||
|
||||
$bacon = new BaconQrCodeWriter($renderer);
|
||||
$data = $bacon->writeString($url, $encoding);
|
||||
|
||||
if ($this->imageBackEnd instanceof Png) {
|
||||
return 'data:image/png;base64,'.base64_encode($data);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a QR code data url to display inline for Bacon QRCode v2
|
||||
*
|
||||
* @param string $company
|
||||
* @param string $holder
|
||||
* @param string $secret
|
||||
* @param int $size
|
||||
* @param string $encoding Default to UTF-8
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQRCodeInlineV2($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
|
||||
{
|
||||
$renderer = new ImageRenderer(
|
||||
(new RendererStyle($size))->withSize($size),
|
||||
$this->imageBackEnd
|
||||
);
|
||||
|
||||
$bacon = new Writer($renderer);
|
||||
|
||||
$data = $bacon->writeString(
|
||||
$this->getQRCodeUrl($company, $holder, $secret),
|
||||
$encoding
|
||||
);
|
||||
|
||||
if ($this->imageBackEnd instanceof ImagickImageBackEnd) {
|
||||
return 'data:image/png;base64,'.base64_encode($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Bacon QRCode current version
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getBaconQRCodeVersion()
|
||||
{
|
||||
return class_exists('BaconQrCode\Renderer\Image\Png') && class_exists('BaconQrCode\Writer')
|
||||
? 1
|
||||
: 2;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue