Skip to content

inigo-aldama/inmovilla-api-proxy-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inmovilla API Proxy Bundle

Latest Version PHP Symfony License

The inmovilla-api-proxy-bundle is a Symfony bundle designed to act as a proxy for Inmovilla API requests, addressing IP-based access restrictions. It simplifies the setup and configuration for integrating the inmovilla-api-proxy and inmovilla-api-client libraries in Symfony applications.


Features

  • Seamless integration with inmovilla-api-proxy.
  • Handles IP-based access restrictions for Inmovilla API.
  • Pre-configured Symfony services for easier implementation.
  • Compatible with Symfony 5.4 and 6.x.

Requirements

  • PHP: 7.4 or higher.
  • Symfony: 5.4 or higher.
  • Composer: For dependency management.

Installation

Install the bundle using Composer:

composer require inigo-aldama/inmovilla-api-proxy-bundle

Configuration

This bundle don't require extra configuration.
Follow instructions of inmovilla-api-client-bundle to configure the api client. This configuration will automatically create a service for the proxy that can be injected into your Symfony controllers or services.


Usage

Injecting the Proxy Service

You can inject the proxy service directly into your controllers or services:

namespace App\Controller;

use Inmovilla\ApiProxyBundle\Service\ProxyService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class ProxyController extends AbstractController
{
    private ProxyService $proxyService;

    public function __construct(ProxyService $proxyService)
    {
        $this->proxyService = $proxyService;
    }

    public function fetchProperties()
    {
        $response = $this->proxyService->handleRequest([
            'endpoint' => '/properties',
            'method' => 'GET',
            'parameters' => [],
        ]);

        return $this->json($response);
    }
}

Testing

Run PHPUnit tests to validate the functionality:

./vendor/bin/phpunit --testdox

Contribution

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to your branch (git push origin feature/new-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License.


Credits

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages