Compare commits
No commits in common. "33dd5190296b1d0639b746b2fe05b317e64d2ef7" and "0973cd31c37deb400302218dbc6cceb15a56da15" have entirely different histories.
33dd519029
...
0973cd31c3
8 changed files with 39 additions and 37 deletions
|
@ -1,10 +1,15 @@
|
|||
{
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"flashwave/index": "^0.2408.40014"
|
||||
"flashwave/index": "dev-master"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Oatmeal\\": "src"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
}
|
||||
}
|
||||
|
|
26
composer.lock
generated
26
composer.lock
generated
|
@ -4,30 +4,34 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "d5cb22679bb951d16ca033d549b45f20",
|
||||
"content-hash": "8be4aa570091b8e36082f761bd734626",
|
||||
"packages": [
|
||||
{
|
||||
"name": "flashwave/index",
|
||||
"version": "v0.2408.182001",
|
||||
"version": "dev-master",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://patchii.net/flash/index.git",
|
||||
"reference": "5a1fdcccedf818897a3468d5457875fabfb2ce28"
|
||||
"reference": "e4c8ed711e045cffe840ba10a239ede14b0b171f"
|
||||
},
|
||||
"require": {
|
||||
"ext-mbstring": "*",
|
||||
"php": ">=8.3"
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^1.11",
|
||||
"phpunit/phpunit": "^11.2"
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phpunit/phpunit": "^10.2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mysqli": "Support for the Index\\Data\\MariaDB namespace (both mysqlnd and libmysql are supported).",
|
||||
"ext-sqlite3": "Support for the Index\\Data\\SQLite namespace."
|
||||
},
|
||||
"default-branch": true,
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"index.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Index\\": "src"
|
||||
}
|
||||
|
@ -46,14 +50,16 @@
|
|||
],
|
||||
"description": "Composer package for the common library for my projects.",
|
||||
"homepage": "https://railgun.sh/index",
|
||||
"time": "2024-08-18T20:01:21+00:00"
|
||||
"time": "2024-04-10T23:40:14+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {
|
||||
"flashwave/index": 20
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": [],
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\Environment;
|
||||
use Index\Data\DbTools;
|
||||
|
||||
define('OAT_STARTUP', microtime(true));
|
||||
define('OAT_ROOT', __DIR__);
|
||||
define('OAT_DEBUG', is_file(OAT_ROOT . '/.debug'));
|
||||
|
@ -9,9 +12,9 @@ define('OAT_DIR_SOURCE', OAT_ROOT . '/src');
|
|||
|
||||
require_once OAT_ROOT . '/vendor/autoload.php';
|
||||
|
||||
error_reporting(OAT_DEBUG ? -1 : 0);
|
||||
mb_internal_encoding('UTF-8');
|
||||
date_default_timezone_set('GMT');
|
||||
Environment::setDebug(OAT_DEBUG);
|
||||
mb_internal_encoding('utf-8');
|
||||
date_default_timezone_set('utc');
|
||||
|
||||
$oatmeal = new OatmealContext((function() {
|
||||
$path = OAT_ROOT . '/.rng';
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\{CSRFP,UriBase64,XString};
|
||||
use Index\XString;
|
||||
use Index\Http\Routing\{HttpGet,HttpPost,RouteHandler};
|
||||
use Index\Security\CSRFP;
|
||||
use Index\Serialisation\UriBase64;
|
||||
|
||||
final class AuthzCodeRoutes extends RouteHandler {
|
||||
public function __construct(
|
||||
|
@ -56,7 +58,7 @@ final class AuthzCodeRoutes extends RouteHandler {
|
|||
<div>
|
||||
<label>
|
||||
<span>Scope:</span>
|
||||
<input type=text name=scope>
|
||||
<input type=text name=scope required>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -144,10 +146,9 @@ HTML;
|
|||
$query = [
|
||||
'response_type' => 'code',
|
||||
'client_id' => $clientId,
|
||||
'scope' => $scope,
|
||||
];
|
||||
|
||||
if($scope !== '')
|
||||
$query['scope'] = $scope;
|
||||
if($redirectUri !== '')
|
||||
$query['redirect_uri'] = $redirectUri;
|
||||
if($state !== '')
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpGet,HttpPost,RouteHandler};
|
||||
use Index\Security\CSRFP;
|
||||
|
||||
final class ClientCredsRoutes extends RouteHandler {
|
||||
public function __construct(
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpGet,HttpPost,RouteHandler};
|
||||
use Index\Security\CSRFP;
|
||||
|
||||
final class DeviceCodeRoutes extends RouteHandler {
|
||||
public function __construct(
|
||||
|
@ -53,7 +53,7 @@ final class DeviceCodeRoutes extends RouteHandler {
|
|||
<div>
|
||||
<label>
|
||||
<span>Scope:</span>
|
||||
<input type=text name=scope>
|
||||
<input type=text name=scope required>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
|
@ -93,10 +93,7 @@ HTML;
|
|||
$scope = (string)$content->getParam('scope');
|
||||
|
||||
$headers = [];
|
||||
$body = [];
|
||||
|
||||
if($scope !== '')
|
||||
$body['scope'] = $scope;
|
||||
$body = ['scope' => $scope];
|
||||
|
||||
if($clientSecret === '')
|
||||
$body['client_id'] = $clientId;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpRouter,IRouter,IRouteHandler};
|
||||
use Index\Security\CSRFP;
|
||||
|
||||
class OatmealContext {
|
||||
private CSRFP $csrfp;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace Oatmeal;
|
||||
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpGet,HttpPost,RouteHandler};
|
||||
use Index\Security\CSRFP;
|
||||
|
||||
final class RefreshTokenRoutes extends RouteHandler {
|
||||
public function __construct(
|
||||
|
@ -50,12 +50,6 @@ final class RefreshTokenRoutes extends RouteHandler {
|
|||
<input type=password name=client_secret>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<span>Scope:</span>
|
||||
<input type=text name=scope>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<span>Authentication:</span>
|
||||
<label>
|
||||
|
@ -107,7 +101,6 @@ HTML;
|
|||
$clientSecret = (string)$content->getParam('client_secret');
|
||||
$refreshToken = (string)$content->getParam('refresh_token');
|
||||
$auth = (string)$content->getParam('auth');
|
||||
$scope = (string)$content->getParam('scope');
|
||||
|
||||
$headers = [];
|
||||
$body = [
|
||||
|
@ -115,9 +108,6 @@ HTML;
|
|||
'refresh_token' => $refreshToken,
|
||||
];
|
||||
|
||||
if($scope !== '')
|
||||
$body['scope'] = $scope;
|
||||
|
||||
if($clientSecret === '')
|
||||
$body['client_id'] = $clientId;
|
||||
elseif($auth === 'body' || ($auth !== 'header' && mt_rand(0, 10) > 5)) {
|
||||
|
|
Loading…
Reference in a new issue