inigo-aldama / inmovilla-api-proxy-bundle
A Symfony bundle to proxy Inmovilla API requests, handling IP-based access restrictions.
Installs: 30
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.4 || ^8.0
- guzzlehttp/guzzle: ^7.0
- inigo-aldama/inmovilla-api-client-bundle: ^1.0
- inigo-aldama/inmovilla-api-proxy: ^1.0
- symfony/framework-bundle: ^5.4 || ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.5
README
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
- Fork the repository.
- Create a new branch (
git checkout -b feature/new-feature
). - Commit your changes (
git commit -m 'Add new feature'
). - Push to your branch (
git push origin feature/new-feature
). - Open a pull request.
License
This project is licensed under the MIT License.
Credits
- Author: Iñigo Aldama Gómez
- GitHub Repository: inmovilla-api-proxy-bundle