Returns an array of credential handlers
@return array
430486
public function getHandlers()
    {
        $handlers = array(
            'key' => array(
                'name' => $this->translation->text('API key'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'delete'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editKeyCredential')
                )
            ),
            'oauth' => array(
                'name' => $this->translation->text('OAuth client ID'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'delete'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editOauthCredential')
                )
            ),
            'service' => array(
                'name' => $this->translation->text('Service account key'),
                'handlers' => array(
                    'delete' => array(__CLASS__, 'deleteService'),
                    'edit' => array('gplcart\\modules\\gapi\\controllers\\Credential', 'editServiceCredential')
                )
            )
        );

        $this->hook->attach('module.gapi.credential.handlers', $handlers);
        return $handlers;
    }
1319505
public function getAuthCredentialsWithBearer()
    {
        $b64token = null;
        
        if (isset($_SERVER['HTTP_AUTHORIZATION'])) {

            if (strpos(strtolower($_SERVER['HTTP_AUTHORIZATION']), 'bearer ')===0) {

                $b64token = substr($_SERVER['HTTP_AUTHORIZATION'], 7);
            }
        }

        return $b64token;
    }
157685
public function getRequestCredentials()
    {
        if ($this->requestCredentials === null) {
            $this->requestCredentials = function () {
                $credentials = [];

                if (isset($_SERVER['PHP_AUTH_USER'])) {
                    $credentials['login'] = $_SERVER['PHP_AUTH_USER'];
                }

                if (isset($_SERVER['PHP_AUTH_PW'])) {
                    $credentials['password'] = $_SERVER['PHP_AUTH_PW'];
                }

                if (count($credentials) > 0) {
                    return $credentials;
                }
            };
        }

        $credentials = $this->requestCredentials;

        return $credentials();
    }
1350894
protected function returnHandlers()
    {
        // Create a handler stack that has all of the default middlewares attached
        $handler = HandlerStack::create();

        //Add the Authorization header to requests.
        $handler->push(Middleware::mapRequest(function (RequestInterface $request) {
            if ($this->getConfig('auth') == 'oauth2') {
                $token = $this->getAccessToken();

                if ($token !== null) {
                    $request = $request->withHeader('Authorization', 'Bearer '.$token->getToken());

                    return $request;
                }
            }

            return $request;
        }), 'add_oauth_header');

        $handler->before('add_oauth_header', $this->retry_modify_request(function ($retries, RequestInterface $request, ResponseInterface $response = null, $error = null) {
            if ($retries > 0) {
                return false;
            }
            if ($response instanceof ResponseInterface) {
                if (in_array($response->getStatusCode(), [400, 401])) {
                    return true;
                }
            }

            return false;
        },
            function (RequestInterface $request, ResponseInterface $response) {
                if ($response instanceof ResponseInterface) {
                    if (in_array($response->getStatusCode(), [400, 401])) {
                        $token = $this->acquireAccessToken();
                        $this->setAccessToken($token, 'Bearer');

                        $modify['set_headers']['Authorization'] = 'Bearer '.$token->getToken();

                        return Psr7\modify_request($request, $modify);
                    }
                }

                return $request;
            }
        ));

        return $handler;
    }
1293162
public static function getHandlerList()
    {
        $handlerList = array();
        $ini = eZINI::instance( 'http.ini' );
        if ( $ini->hasGroup( 'HTTPCacheHandlers' ) && $ini->hasVariable( 'HTTPCacheHandlers', 'Handlers' ) )
            $handlerList = $ini->variable( 'HTTPCacheHandlers', 'Handlers' );
        
        return $handlerList;
    }
324712
private function getOauthFields()
    {
        $this->oAuthFields = [
            'grant_type' => 'client_credentials',
            'scope' => $this->scope,
            'client_secret' => $this->mpClientSecret,
            'client_id' => $this->mpClientId,
        ];

        $this->fieldCount = count($this->oAuthFields);

        return $this->oAuthFields;
    }
1342749
public function getHandlers()
    {
        $handlers = [];
        foreach ($this->handlers as $key => $handler) {
            $handlers[$key] = $handler->getCallable();
        }

        return $handlers;
    }
695408
public function getCertificatesAsArray()
    {
        // Iterate over certificates nodes and convert to an array
        $certificates = array();
        /** @var \AppserverIo\Appserver\Core\Api\Node\CertificateNode $certificateNode */
        foreach ($this->getCertificates() as $certificateNode) {
            // restructure to an array
            $certificates[] = array(
                'domain' => $certificateNode->getDomain(),
                'certPath' => $certificateNode->getCertPath()
            );
        }

        // return certificates array
        return $certificates;
    }
127958
public function parse($credential = array())
    {
        if (array_key_exists(self::PUBKEY_FILE, $credential)) {
            $type = self::PUBKEY_FILE;
            $data = $credential[self::PUBKEY_FILE];
        } elseif (array_key_exists(self::PASSWORD, $credential)) {
            $type = self::PASSWORD;
            $data = $credential[self::PASSWORD];
        } else {
            $type = self::NONE;
            $data = isset($credential[self::NONE]) ? $credential[self::NONE] : array();
        }

        return array($type, $data);
    }
1237631
protected function proxy() {
        if (!$this->context) {
            $this->context = new CredentialListContext(
                $this->version,
                $this->solution['trunkSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
794902
public function getCredentials()
    {
        $auth = $this->request->getHeader('Authorization');

        if (!$auth) {
            return null;
        }

        if ('basic ' !== strtolower(substr($auth, 0, 6))) {
            return null;
        }

        $credentials = explode(':', base64_decode(substr($auth, 6)), 2);

        if (2 !== count($credentials)) {
            return null;
        }

        return $credentials;
    }
578495
public function managerGetRegistrations()
    {
        $registrations = $this->getRegistrations();

        $regInfo = [];
        /** @var Registration $reg */
        foreach ($registrations as $reg) {
            $regInfo[] = [
                'id'                    => $reg->getId(),
                'invoke'                => $reg->getInvokeType(),
                'thruway_multiregister' => $reg->getAllowMultipleRegistrations(),
                'disclose_caller'       => $reg->getDiscloseCaller(),
                'session'               => $reg->getSession()->getSessionId(),
                'authid'                => $reg->getSession()->getAuthenticationDetails()->getAuthId(),
                'statistics'            => $reg->getStatistics()
            ];
        }
    }
614000
private function getPermissions(): array
    {
        $model = App::shortName(get_class($this->table), 'Model/Table', 'Table');

        $values = $this->getPermissionsByModel($model);
        if (empty($values)) {
            return [];
        }

        $primaryKey = $this->table->getPrimaryKey();
        Assert::string($primaryKey);

        return [$this->table->aliasField($primaryKey) . ' IN' => array_unique($values)];
    }
930680
public function getDeafultHandlers()
	{
		return [

			// return hash of input file

			'contenthash' => function ($file) {

				if ( ! isset($this->hasher))
				{
					$this->hasher = new Hasher;
				}

				return $this->hasher->file($file);
			},

			// return ext of input file

			'ext' => function ($file) {

				return $file->getClientOriginalExtension();
			}

		];
	}
794487
protected function getDefaultHandlers()
    {
        return array(
            '+' => new Handler\StatusResponse(),
            '-' => new Handler\ErrorResponse(),
            ':' => new Handler\IntegerResponse(),
            '$' => new Handler\BulkResponse(),
            '*' => new Handler\MultiBulkResponse(),
        );
    }
654464
public function getHandlers()
    {
        $commands = &gplcart_static('module.file_manager.handlers');

        if (isset($commands)) {
            return $commands;
        }

        $commands = (array) gplcart_config_get(__DIR__ . '/../config/commands.php');

        foreach ($commands as $id => &$command) {
            $command['command_id'] = $id;
        }

        $this->hook->attach('module.file_manager.handlers', $commands, $this);
        return $commands;
    }
1159308
public static function optionsAccessLevels(): array
    {
        return [
            Auth::PRIV_PRIVATE => I18N::translate('Show to visitors'),
            Auth::PRIV_USER    => I18N::translate('Show to members'),
            Auth::PRIV_NONE    => I18N::translate('Show to managers'),
            Auth::PRIV_HIDE    => I18N::translate('Hide from everyone'),
        ];
    }