Structure init

This commit is contained in:
Artem Vasilev 2024-03-02 04:44:33 +03:00
commit e08f89aaef
19 changed files with 964 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.idea
lib_oauthserver/vendor

View File

@ -0,0 +1,13 @@
<?php
use Joomla\DI\ServiceProviderInterface;
\defined('_JEXEC') or die;
return new class implements ServiceProviderInterface {
public function register(\Joomla\DI\Container $container)
{
// TODO: Implement register() method.
}
};

View File

@ -0,0 +1,36 @@
<?php
namespace Webmasterskaya\Component\OauthServer\Administrator\Extension;
use Joomla\CMS\Association\AssociationServiceInterface;
use Joomla\CMS\Association\AssociationServiceTrait;
use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Component\Router\RouterServiceTrait;
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Psr\Container\ContainerInterface;
\defined('JPATH_PLATFORM') or die;
class Component extends MVCComponent implements
BootableExtensionInterface, AssociationServiceInterface, RouterServiceInterface
{
use AssociationServiceTrait;
use HTMLRegistryAwareTrait;
use RouterServiceTrait;
/**
* Booting the extension. This is the function to set up the environment of the extension like
* registering new class loaders, etc.
*
*
* @param \Psr\Container\ContainerInterface $container The container
*
* @throws \Exception
* @since 1.0.0
*/
public function boot(ContainerInterface $container): void
{
}
}

View File

@ -0,0 +1,21 @@
{
"name": "webmaserskaya/lib_oauthserver",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {
"Webmaserskaya\\Joomla\\OauthServer\\": "src/"
}
},
"authors": [
{
"name": "Artem Vasilev",
"email": "kern.usr@gmial.com"
}
],
"minimum-stability": "stable",
"require": {
"php": "^8.0",
"league/oauth2-server": "^8.5"
}
}

745
lib_oauthserver/composer.lock generated Normal file
View File

@ -0,0 +1,745 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "99504adfe2d28f30254fe17d8bd1fede",
"packages": [
{
"name": "defuse/php-encryption",
"version": "v2.4.0",
"source": {
"type": "git",
"url": "https://github.com/defuse/php-encryption.git",
"reference": "f53396c2d34225064647a05ca76c1da9d99e5828"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/defuse/php-encryption/zipball/f53396c2d34225064647a05ca76c1da9d99e5828",
"reference": "f53396c2d34225064647a05ca76c1da9d99e5828",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"paragonie/random_compat": ">= 2",
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5|^6|^7|^8|^9|^10",
"yoast/phpunit-polyfills": "^2.0.0"
},
"bin": [
"bin/generate-defuse-key"
],
"type": "library",
"autoload": {
"psr-4": {
"Defuse\\Crypto\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Hornby",
"email": "taylor@defuse.ca",
"homepage": "https://defuse.ca/"
},
{
"name": "Scott Arciszewski",
"email": "info@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "Secure PHP Encryption Library",
"keywords": [
"aes",
"authenticated encryption",
"cipher",
"crypto",
"cryptography",
"encrypt",
"encryption",
"openssl",
"security",
"symmetric key cryptography"
],
"support": {
"issues": "https://github.com/defuse/php-encryption/issues",
"source": "https://github.com/defuse/php-encryption/tree/v2.4.0"
},
"time": "2023-06-19T06:10:36+00:00"
},
{
"name": "lcobucci/clock",
"version": "3.2.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/clock.git",
"reference": "6f28b826ea01306b07980cb8320ab30b966cd715"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715",
"reference": "6f28b826ea01306b07980cb8320ab30b966cd715",
"shasum": ""
},
"require": {
"php": "~8.2.0 || ~8.3.0",
"psr/clock": "^1.0"
},
"provide": {
"psr/clock-implementation": "1.0"
},
"require-dev": {
"infection/infection": "^0.27",
"lcobucci/coding-standard": "^11.0.0",
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.25",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.13",
"phpstan/phpstan-strict-rules": "^1.5.1",
"phpunit/phpunit": "^10.2.3"
},
"type": "library",
"autoload": {
"psr-4": {
"Lcobucci\\Clock\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Luís Cobucci",
"email": "lcobucci@gmail.com"
}
],
"description": "Yet another clock abstraction",
"support": {
"issues": "https://github.com/lcobucci/clock/issues",
"source": "https://github.com/lcobucci/clock/tree/3.2.0"
},
"funding": [
{
"url": "https://github.com/lcobucci",
"type": "github"
},
{
"url": "https://www.patreon.com/lcobucci",
"type": "patreon"
}
],
"time": "2023-11-17T17:00:27+00:00"
},
{
"name": "lcobucci/jwt",
"version": "5.2.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/jwt.git",
"reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/0ba88aed12c04bd2ed9924f500673f32b67a6211",
"reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"ext-sodium": "*",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"psr/clock": "^1.0"
},
"require-dev": {
"infection/infection": "^0.27.0",
"lcobucci/clock": "^3.0",
"lcobucci/coding-standard": "^11.0",
"phpbench/phpbench": "^1.2.9",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.7",
"phpstan/phpstan-deprecation-rules": "^1.1.3",
"phpstan/phpstan-phpunit": "^1.3.10",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.2.6"
},
"suggest": {
"lcobucci/clock": ">= 3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Lcobucci\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Luís Cobucci",
"email": "lcobucci@gmail.com",
"role": "Developer"
}
],
"description": "A simple library to work with JSON Web Token and JSON Web Signature",
"keywords": [
"JWS",
"jwt"
],
"support": {
"issues": "https://github.com/lcobucci/jwt/issues",
"source": "https://github.com/lcobucci/jwt/tree/5.2.0"
},
"funding": [
{
"url": "https://github.com/lcobucci",
"type": "github"
},
{
"url": "https://www.patreon.com/lcobucci",
"type": "patreon"
}
],
"time": "2023-11-20T21:17:42+00:00"
},
{
"name": "league/event",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/event.git",
"reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119",
"reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"henrikbjorn/phpspec-code-coverage": "~1.0.1",
"phpspec/phpspec": "^2.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-4": {
"League\\Event\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Event package",
"keywords": [
"emitter",
"event",
"listener"
],
"support": {
"issues": "https://github.com/thephpleague/event/issues",
"source": "https://github.com/thephpleague/event/tree/master"
},
"time": "2018-11-26T11:52:41+00:00"
},
{
"name": "league/oauth2-server",
"version": "8.5.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/oauth2-server.git",
"reference": "ab7714d073844497fd222d5d0a217629089936bc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/ab7714d073844497fd222d5d0a217629089936bc",
"reference": "ab7714d073844497fd222d5d0a217629089936bc",
"shasum": ""
},
"require": {
"defuse/php-encryption": "^2.3",
"ext-openssl": "*",
"lcobucci/clock": "^2.2 || ^3.0",
"lcobucci/jwt": "^4.3 || ^5.0",
"league/event": "^2.2",
"league/uri": "^6.7 || ^7.0",
"php": "^8.0",
"psr/http-message": "^1.0.1 || ^2.0"
},
"replace": {
"league/oauth2server": "*",
"lncd/oauth2": "*"
},
"require-dev": {
"laminas/laminas-diactoros": "^3.0.0",
"phpstan/phpstan": "^0.12.57",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpunit/phpunit": "^9.6.6",
"roave/security-advisories": "dev-master"
},
"type": "library",
"autoload": {
"psr-4": {
"League\\OAuth2\\Server\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alex Bilbie",
"email": "hello@alexbilbie.com",
"homepage": "http://www.alexbilbie.com",
"role": "Developer"
},
{
"name": "Andy Millington",
"email": "andrew@noexceptions.io",
"homepage": "https://www.noexceptions.io",
"role": "Developer"
}
],
"description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.",
"homepage": "https://oauth2.thephpleague.com/",
"keywords": [
"Authentication",
"api",
"auth",
"authorisation",
"authorization",
"oauth",
"oauth 2",
"oauth 2.0",
"oauth2",
"protect",
"resource",
"secure",
"server"
],
"support": {
"issues": "https://github.com/thephpleague/oauth2-server/issues",
"source": "https://github.com/thephpleague/oauth2-server/tree/8.5.4"
},
"funding": [
{
"url": "https://github.com/sephster",
"type": "github"
}
],
"time": "2023-08-25T22:35:12+00:00"
},
{
"name": "league/uri",
"version": "7.4.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri.git",
"reference": "bf414ba956d902f5d98bf9385fcf63954f09dce5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/bf414ba956d902f5d98bf9385fcf63954f09dce5",
"reference": "bf414ba956d902f5d98bf9385fcf63954f09dce5",
"shasum": ""
},
"require": {
"league/uri-interfaces": "^7.3",
"php": "^8.1"
},
"conflict": {
"league/uri-schemes": "^1.0"
},
"suggest": {
"ext-bcmath": "to improve IPV4 host parsing",
"ext-fileinfo": "to create Data URI from file contennts",
"ext-gmp": "to improve IPV4 host parsing",
"ext-intl": "to handle IDN host with the best performance",
"jeremykendall/php-domain-parser": "to resolve Public Suffix and Top Level Domain",
"league/uri-components": "Needed to easily manipulate URI objects components",
"php-64bit": "to improve IPV4 host parsing",
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "7.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
"homepage": "https://uri.thephpleague.com",
"keywords": [
"data-uri",
"file-uri",
"ftp",
"hostname",
"http",
"https",
"middleware",
"parse_str",
"parse_url",
"psr-7",
"query-string",
"querystring",
"rfc3986",
"rfc3987",
"rfc6570",
"uri",
"uri-template",
"url",
"ws"
],
"support": {
"docs": "https://uri.thephpleague.com",
"forum": "https://thephpleague.slack.com",
"issues": "https://github.com/thephpleague/uri-src/issues",
"source": "https://github.com/thephpleague/uri/tree/7.4.0"
},
"funding": [
{
"url": "https://github.com/sponsors/nyamsprod",
"type": "github"
}
],
"time": "2023-12-01T06:24:25+00:00"
},
{
"name": "league/uri-interfaces",
"version": "7.4.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-interfaces.git",
"reference": "bd8c487ec236930f7bbc42b8d374fa882fbba0f3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/bd8c487ec236930f7bbc42b8d374fa882fbba0f3",
"reference": "bd8c487ec236930f7bbc42b8d374fa882fbba0f3",
"shasum": ""
},
"require": {
"ext-filter": "*",
"php": "^8.1",
"psr/http-factory": "^1",
"psr/http-message": "^1.1 || ^2.0"
},
"suggest": {
"ext-bcmath": "to improve IPV4 host parsing",
"ext-gmp": "to improve IPV4 host parsing",
"ext-intl": "to handle IDN host with the best performance",
"php-64bit": "to improve IPV4 host parsing",
"symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "7.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "Common interfaces and classes for URI representation and interaction",
"homepage": "https://uri.thephpleague.com",
"keywords": [
"data-uri",
"file-uri",
"ftp",
"hostname",
"http",
"https",
"parse_str",
"parse_url",
"psr-7",
"query-string",
"querystring",
"rfc3986",
"rfc3987",
"rfc6570",
"uri",
"url",
"ws"
],
"support": {
"docs": "https://uri.thephpleague.com",
"forum": "https://thephpleague.slack.com",
"issues": "https://github.com/thephpleague/uri-src/issues",
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.4.0"
},
"funding": [
{
"url": "https://github.com/sponsors/nyamsprod",
"type": "github"
}
],
"time": "2023-11-24T15:40:42+00:00"
},
{
"name": "paragonie/random_compat",
"version": "v9.99.100",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
"shasum": ""
},
"require": {
"php": ">= 7"
},
"require-dev": {
"phpunit/phpunit": "4.*|5.*",
"vimeo/psalm": "^1"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paragon Initiative Enterprises",
"email": "security@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
"keywords": [
"csprng",
"polyfill",
"pseudorandom",
"random"
],
"support": {
"email": "info@paragonie.com",
"issues": "https://github.com/paragonie/random_compat/issues",
"source": "https://github.com/paragonie/random_compat"
},
"time": "2020-10-15T08:29:30+00:00"
},
{
"name": "psr/clock",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/clock.git",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Clock\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for reading the clock.",
"homepage": "https://github.com/php-fig/clock",
"keywords": [
"clock",
"now",
"psr",
"psr-20",
"time"
],
"support": {
"issues": "https://github.com/php-fig/clock/issues",
"source": "https://github.com/php-fig/clock/tree/1.0.0"
},
"time": "2022-11-25T14:36:26+00:00"
},
{
"name": "psr/http-factory",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "e616d01114759c4c489f93b099585439f795fe35"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35",
"reference": "e616d01114759c4c489f93b099585439f795fe35",
"shasum": ""
},
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-factory/tree/1.0.2"
},
"time": "2023-04-10T20:10:41+00:00"
},
{
"name": "psr/http-message",
"version": "2.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/2.0"
},
"time": "2023-04-04T09:54:51+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.6.0"
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="system" method="upgrade">
<name>PLG_SYSTEM_OAUTHSERVER</name>
<description>PLG_SYSTEM_OAUTHSERVER_DESCRIPTION</description>
<author>Artem Vasilev</author>
<authorEmail>kern.usr@gmial.com</authorEmail>
<authorUrl>https://webmasterskaya.xyz</authorUrl>
<creationDate>March 2024</creationDate>
<copyright>Copyright (C) 2024 Webmasterskaya. All rights reserved.</copyright>
<license>MIT; see LICENSE.txt</license>
<version>RELEASE_VERSION</version>
<namespace path="src">Webmasterskaya\Plugin\System\OauthServer</namespace>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.plg_system_oauthserver.ini</language>
<language tag="en-GB">en-GB/en-GB.plg_system_oauthserver.sys.ini</language>
<language tag="ru-RU">ru-RU/ru-RU.plg_system_oauthserver.ini</language>
<language tag="ru-RU">ru-RU/ru-RU.plg_system_oauthserver.sys.ini</language>
</languages>
<files>
<folder plugin="oauthserver">services</folder>
<folder>src</folder>
</files>
</extension>

View File

@ -0,0 +1,13 @@
<?php
use Joomla\DI\ServiceProviderInterface;
\defined('_JEXEC') or die;
return new class implements ServiceProviderInterface {
public function register(\Joomla\DI\Container $container)
{
// TODO: Implement register() method.
}
};

View File

@ -0,0 +1,61 @@
<?php
namespace Webmasterskaya\Plugin\System\OauthServer\Extension;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Uri\Uri;
use Joomla\Event\SubscriberInterface;
class Plugin extends CMSPlugin implements SubscriberInterface
{
/**
* Affects constructor behavior. If true, language files will be loaded automatically.
*
* @var boolean
* @since 3.1
*/
protected $autoloadLanguage = false;
/**
* The application object
*
* @var CMSApplicationInterface
*
* @since 4.2.0
*/
private $application;
public static function getSubscribedEvents(): array
{
return ['onAfterInitialise' => 'onAfterInitialise'];
}
public function onAfterInitialise(): void
{
if (!$this->app->isClient('site')) {
return;
}
$uri = Uri::getInstance();
$path = $uri->getPath();
// Адрес сервера аутентификации должен быть статичным,
// чтобы гарантировать 100% доступность сервера
if (str_starts_with($path, '/login/oauth/') === false) {
return;
}
$parts = explode('/', $path);
if(empty($parts[2])){
// TODO: Проверить, как стандартный роутер обработает этот вопрос и как отреагируют приложения на 404 от Joomla
return;
}
$option = 'com_oauthserver';
$task = $parts[2];
// TODO: Ставим в input option, task и view и запускаем компонент com_oauthserver
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="user" method="upgrade">
<name>PLG_USER_OAUTHSERVER</name>
<description>PLG_USER_OAUTHSERVER_DESCRIPTION</description>
<author>Artem Vasilev</author>
<authorEmail>kern.usr@gmial.com</authorEmail>
<authorUrl>https://webmasterskaya.xyz</authorUrl>
<creationDate>March 2024</creationDate>
<copyright>Copyright (C) 2024 Webmasterskaya. All rights reserved.</copyright>
<license>MIT; see LICENSE.txt</license>
<version>RELEASE_VERSION</version>
<namespace path="src">Webmasterskaya\Plugin\USER\OauthServer</namespace>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.plg_user_oauthserver.ini</language>
<language tag="en-GB">en-GB/en-GB.plg_user_oauthserver.sys.ini</language>
<language tag="ru-RU">ru-RU/ru-RU.plg_user_oauthserver.ini</language>
<language tag="ru-RU">ru-RU/ru-RU.plg_user_oauthserver.sys.ini</language>
</languages>
<files>
<folder plugin="oauthserver">services</folder>
<folder>src</folder>
</files>
</extension>

View File

@ -0,0 +1,13 @@
<?php
use Joomla\DI\ServiceProviderInterface;
\defined('_JEXEC') or die;
return new class implements ServiceProviderInterface {
public function register(\Joomla\DI\Container $container)
{
// TODO: Implement register() method.
}
};

View File

@ -0,0 +1,14 @@
<?php
namespace Webmasterskaya\Plugin\User\OauthServer\Extension;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Event\SubscriberInterface;
class Plugin extends CMSPlugin implements SubscriberInterface
{
public static function getSubscribedEvents(): array
{
// TODO: Implement getSubscribedEvents() method.
}
}