Upgrade to 3.7.1

This commit is contained in:
Bastian Allgeier
2022-07-12 13:33:21 +02:00
parent 7931eb5e47
commit 1ad1eaf387
377 changed files with 63981 additions and 63824 deletions

View File

@@ -16,70 +16,70 @@ use Kirby\Toolkit\Str;
*/
class BasicAuth extends Auth
{
/**
* @var string
*/
protected $credentials;
/**
* @var string
*/
protected $credentials;
/**
* @var string
*/
protected $password;
/**
* @var string
*/
protected $password;
/**
* @var string
*/
protected $username;
/**
* @var string
*/
protected $username;
/**
* @param string $token
*/
public function __construct(string $data)
{
parent::__construct($data);
/**
* @param string $token
*/
public function __construct(string $data)
{
parent::__construct($data);
$this->credentials = base64_decode($data);
$this->username = Str::before($this->credentials, ':');
$this->password = Str::after($this->credentials, ':');
}
$this->credentials = base64_decode($data);
$this->username = Str::before($this->credentials, ':');
$this->password = Str::after($this->credentials, ':');
}
/**
* Returns the entire unencoded credentials string
*
* @return string
*/
public function credentials(): string
{
return $this->credentials;
}
/**
* Returns the entire unencoded credentials string
*
* @return string
*/
public function credentials(): string
{
return $this->credentials;
}
/**
* Returns the password
*
* @return string|null
*/
public function password(): ?string
{
return $this->password;
}
/**
* Returns the password
*
* @return string|null
*/
public function password(): ?string
{
return $this->password;
}
/**
* Returns the authentication type
*
* @return string
*/
public function type(): string
{
return 'basic';
}
/**
* Returns the authentication type
*
* @return string
*/
public function type(): string
{
return 'basic';
}
/**
* Returns the username
*
* @return string|null
*/
public function username(): ?string
{
return $this->username;
}
/**
* Returns the username
*
* @return string|null
*/
public function username(): ?string
{
return $this->username;
}
}

View File

@@ -15,23 +15,23 @@ use Kirby\Http\Request\Auth;
*/
class BearerAuth extends Auth
{
/**
* Returns the authentication token
*
* @return string
*/
public function token(): string
{
return $this->data;
}
/**
* Returns the authentication token
*
* @return string
*/
public function token(): string
{
return $this->data;
}
/**
* Returns the auth type
*
* @return string
*/
public function type(): string
{
return 'bearer';
}
/**
* Returns the auth type
*
* @return string
*/
public function type(): string
{
return 'bearer';
}
}

View File

@@ -16,33 +16,33 @@ use Kirby\Http\Request\Auth;
*/
class SessionAuth extends Auth
{
/**
* Tries to return the session object
*
* @return \Kirby\Session\Session
*/
public function session()
{
return App::instance()->sessionHandler()->getManually($this->data);
}
/**
* Tries to return the session object
*
* @return \Kirby\Session\Session
*/
public function session()
{
return App::instance()->sessionHandler()->getManually($this->data);
}
/**
* Returns the session token
*
* @return string
*/
public function token(): string
{
return $this->data;
}
/**
* Returns the session token
*
* @return string
*/
public function token(): string
{
return $this->data;
}
/**
* Returns the authentication type
*
* @return string
*/
public function type(): string
{
return 'session';
}
/**
* Returns the authentication type
*
* @return string
*/
public function type(): string
{
return 'session';
}
}