composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
28 lines
814 B
PHP
28 lines
814 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Rest\BasicAccess;
|
|
|
|
use MediaWiki\Rest\Handler;
|
|
use MediaWiki\Rest\RequestInterface;
|
|
|
|
/**
|
|
* An implementation of BasicAuthorizerInterface which creates a request-local
|
|
* object (a request authorizer) to do the actual authorization.
|
|
*
|
|
* @internal
|
|
*/
|
|
abstract class BasicAuthorizerBase implements BasicAuthorizerInterface {
|
|
public function authorize( RequestInterface $request, Handler $handler ) {
|
|
return $this->createRequestAuthorizer( $request, $handler )->authorize();
|
|
}
|
|
|
|
/**
|
|
* Create a BasicRequestAuthorizer to authorize the request.
|
|
*
|
|
* @param RequestInterface $request
|
|
* @param Handler $handler
|
|
* @return BasicRequestAuthorizer
|
|
*/
|
|
abstract protected function createRequestAuthorizer( RequestInterface $request,
|
|
Handler $handler ): BasicRequestAuthorizer;
|
|
}
|