2017 © Pedro Peláez
 

library sf-proxy-bundle

Symfony proxy bundle

image

jc-src/sf-proxy-bundle

Symfony proxy bundle

  • Friday, September 22, 2017
  • by jacobchristensen79
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

JcSrc SfProxyBundle

Inner Working

Intented as a simple configurable Proxy service. Configure if needed own classes to manipulate in 3 steps the data or even the request., (*1)

Configuration is Compiled for faster response and validation., (*2)

Adding to Symfony

composer require 'jc-src/sf-proxy-bundle', (*3)

Add to Kernel: app/AppKernel.php, (*4)

    public function registerBundles()
    {
        $bundles = [
            ...
            new \JcSrc\SfProxyBundle\JcSrcSfProxyBundle(),
            ...
        ];
    }

Define Routing: app/config/routing.yml, (*5)

jcsrc_proxy:
    resource: "@JcSrcSfProxyBundle/Resources/config/routing.yml"
    prefix:   /proxy

Url

Endpoint api /proxy/{proxy_name}/{service}?queryparams=values., (*6)

proxy name Unique ID for a service. service Will be appended: uri + serviceEndpoint + service -> proxy. queryparams Just an optional sample, (*7)

Configuration description
parameters:
    jcsrc.proxy.sources:
        proxy1:  # unique ID, called in url: proxy_name
            uri: # http full qualified domain url
            apiKey: # optional api key, by default passed as apiKey=value in query params
            queryStringTemplate: # optional mapping from request queryParams to proxy params
            serviceEndpoint: # optional append to uri on requesting data
            preProcessorService: # optional, valid service id. implement Interface for pre process request data.
            proxyProcessorService: # optional, valid service id. implement Interface for execute proxy request
            postProcessorService: # optional, valid service id. implement Interface for post manipulate result
An example for full proxy config
parameters:
    jcsrc.proxy.sources:
        proxy1:
            uri: 'http://gateway.proxy.com'
            apiKey: xxCCff8723
            queryStringTemplate: 'field1={queryParam1}'
            serviceEndpoint: /docs
            preProcessorService: 'valid.service.id.step.1'
            proxyProcessorService: 'valid.service.id.step.2'
            postProcessorService: 'valid.service.id.step.3'

The Versions

22/09 2017

dev-develop

dev-develop

Symfony proxy bundle

  Sources   Download

GPL

The Requires

 

15/09 2017

dev-master

9999999-dev

Symfony proxy bundle

  Sources   Download

GPL

The Requires

  • php ~5.6