예제 #1
0
 /**
  * Registers configured external services to be proxied.
  *
  * @return Void
  */
 private function registerProxySources()
 {
     if (array_key_exists('swagger', $this->proxySourceConfiguration)) {
         foreach ($this->proxySourceConfiguration['swagger'] as $config) {
             $this->apiLoader->setOption($config);
         }
     }
 }
예제 #2
0
 /**
  * Finds configured external apis to be exposed via G2.
  *
  * @return array
  */
 private function registerThirdPartyServices()
 {
     $services = [];
     // getenv()... it's a workaround for run all tests on travis! will be removed!
     if (array_key_exists('swagger', $this->proxySourceConfiguration) && getenv('USER') !== 'travis' && getenv('HAS_JOSH_K_SEAL_OF_APPROVAL') !== true) {
         //@todo: this needs to be refactored in case there are other sources than swagger configuration files
         foreach ($this->proxySourceConfiguration['swagger'] as $thirdparty => $option) {
             $this->apiLoader->setOption($option);
             $services[$thirdparty] = $this->determineThirdPartyServices($this->apiLoader->getAllEndpoints(false, true));
         }
     }
     return $services;
 }