Upgrade to 3.7.0

This commit is contained in:
Bastian Allgeier
2022-06-27 10:02:22 +02:00
parent 0751a6510d
commit 1c22148d7b
674 changed files with 5052 additions and 3082 deletions

61
kirby/src/Http/Request/Auth.php Executable file
View File

@@ -0,0 +1,61 @@
<?php
namespace Kirby\Http\Request;
/**
* Base class for auth types
*
* @package Kirby Http
* @author Lukas Bestle <lukas@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://opensource.org/licenses/MIT
*/
abstract class Auth
{
/**
* Raw authentication data after the first space
* in the `Authorization` header
*
* @var string
*/
protected $data;
/**
* Constructor
*
* @param string $data
*/
public function __construct(string $data)
{
$this->data = $data;
}
/**
* Converts the object to a string
*
* @return string
*/
public function __toString(): string
{
return ucfirst($this->type()) . ' ' . $this->data();
}
/**
* Returns the raw authentication data after the
* first space in the `Authorization` header
*
* @return string
*/
public function data(): string
{
return $this->data;
}
/**
* Returns the name of the auth type (lowercase)
*
* @return string
*/
abstract public function type(): string;
}