Expose custom agent parameter?
See original GitHub issueSince purest
allows for it, I would love to get the same support for grant
. That would allow me to control the whole oauth + user profile fetching flow.
Namely, I want to use this with a proxy agent like: https://github.com/TooTallNate/node-proxy-agent
This is necessary as nodejs core still haven’t expose an overridable http.globalAgent
api yet, sorry for nagging you on this: https://github.com/nodejs/node/issues/23281
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Creating custom agent types
You can create custom agent and resource types. They have their own diagrams where you can add parameters, statecharts, functions, etc.
Read more >Custom parameters
A custom parameter is a reference to information on your website or mobile app, and collects data exposed on the front-end of the...
Read more >Changing Build Parameter Type and UI Appearance
The parameter's specification defines how its controls are presented and validated in the Run Custom Build dialog.
Read more >Clarity on teamcity parameters and its types
There're predefined parameters exposing server build properties, agent properties, agent build properties etc. These parameters are passed to the build as ...
Read more >AWS Systems Manager Parameter Store
You want to use data/parameters across AWS services without exposing the values as plaintext in commands, functions, agent logs, or CloudTrail logs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👋 @bitinn I was thinking about this issue, and while I may never expose the underlying HTTP library, I think it will be possible to … well, monkey-patch it:
Just make sure you execute this code after Grant has been required.
The
options
argument expects request-compose options that in turn can be any HTTP option from the underlying Node Core API, includingagent
.Let me know what do you think!
@simov, Here are the steps to create a full Feathersjs server with Microsoft Azure OAuth (on Ubuntu 20.04). This shows the code I tried to add to monkey patch the options variable that didn’t work.
sudo npm install -g @feathersjs/cli
mkdir granttest && cd granttest
feathers generate app
default.json
and add the following oauth section (the local section is shown for reference):authentication.js
and make it look like the following (I added only two lines for azure. The rest was auto generated):authentication-azure.js
in the same folder asauthentication.js
. Add the following code to it. This is the code I am trying to patch. You will see my code changes near the top. Yes I know I’m not doing anything with the variableproxyAddr
. I removed a bunch of code that didn’t do anything but left this here.And, if you want to test with Microsoft env vars, a quick hack is to modify the run script in
package.json
. Note, you’ll have to modify the values of the tenant_id, client_id, and client_secret from your Azure configuration for you app ID and set the redirect back to http://localhost:3030/Now run the server with
npm run dev
and visithttp://localhost:3030/oauth/microsoft
from your browser .I tried all sorts of different ways to get ahold of the options variable so I could change the proxy but nothing I tried worked. I use VSCode for my testing and used it to debug through the code. If you have any ideas on how to get this to work it would be greatly appreciated. My work proxies all internet access. I want to proxy my feathersjs app with CNTLM on my local box out to the internet because we use an authenticated proxy that has username/password info for Windows. Essentially proxy the proxy. The proxy wreaks havoc with applications that don’t know how to be configured and use the proxy appropriately. The Grant library completely fails since it doesn’t expose the proxy options. This all (Grant library plus FeathersJS) works fine on my laptop at home where there is no proxy. Thank you in advance.