thinkingmik / api-proxy-laravel Goto Github PK
View Code? Open in Web Editor NEWLaravel proxy helper package for javascript API calls
License: MIT License
Laravel proxy helper package for javascript API calls
License: MIT License
This is currently unusable on L5. When running the php artisan config:publish andreoli/api-proxy-laravel
command, I get the following error:
➜ project git:(oauth) ✗ php artisan config:publish andreoli/api-proxy-laravel
PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::error() in /home/vagrant/Code/project/vendor/andreoli/api-proxy-laravel/src/Andreoli/ApiProxy/ApiProxyServiceProvider.php on line 75
This is because L5 removed the Application::error()
method.
Hello,
First of all thanks for this great package !
I'm experiencing a problem implementing it with oauth2-server-laravel, here is the scenario :
I'm making a GET call to the proxy with appropriate params to obtain an access token (uri oauth/access_token).
The proxy forwards the request to the API in GET, but my API routes only contains a POST route to oauth/access_token. So a Laravel method not allowed exception is raised (debug on).
Instead of forwarding this exception, I get a fatal "Cannot use object of type GuzzleHttp\Stream\Stream as array" from the proxy.
This happens here in RequestManager :
$content = $proxyResponse->getContent();
$content = ProxyAux::addQueryValue($content, ProxyAux::COOKIE_URI, $this->uri);
ProxyAux::addQueryValue expects an array in first param, but a Guzzle stream is returned by getContent.
I'm on tag 1.0.0 but seeing master code it should behave the same.
I'm on tag 5.3.0 for guzzlehttp.
Thanks for your help !
is it possible to add support for guzzle 6.3.x. it seems you are using guzzle ~5.0 which is quite outdated.
Thank you
Is this package compatible with laravel 5?
I have added this proxy to handle our ember stuff. our API uses oauth2-server-laravel and we can get the resource Owner ID by calling $this->authorizer->getResourceOwnerId()
in the proper class.
However when our ember app logs in, we need to get the resource owner Id still, but when I call that from a function that is used through the proxy, I get 500 error:
Server error response [url] http://api.example.dev/v1/proxyUser [status code] 500 [reason phrase] Internal Server Error
/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
line: 89
Is there something different I need to do to grab data from the Authorizer when using the proxy?
Please add step to run composer update
. It may save somebody's time. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.