nodejs / nodejs/undici

Support for custom proxy auth schemes

Open
#3,282 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement interceptors
Dominant language
JavaScript
Stars
7.7k
Forks
880
Avg merge
2d 16h
Merged PRs (30d)
68

Description

This would solve...

Support custom proxy auth schemes, such as Kerberos/Negotiate.

The implementation should look like...

Some ability to supply a callback or interceptor or anything really that can handle custom authentication schemes to a proxy. Such as Negotiate/Kerberos

I have also considered...

Currently trying to figure out how to do it by myself, but undici is quite complicated to figure out how to do so.

Basically, we need to catch a 407 from the proxy and if the Proxy-Authenticate header includes the scheme we want to handle, then we need to retry the request with a dynamic authorization header, e.g. using the kerberos package, possibly multiple times for a correct implementation.

Additional context

Kind of like what Microsoft hacked together for the stock http/https module here: https://github.com/microsoft/vscode/blob/9c2b9327e5cdce9583ef6cfe5072102b150cf7cb/src/vs/workbench/api/node/proxyResolver.ts#L131-L165 and via @vscode/proxy-agent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the referenced VS Code proxyResolver.ts implementation and the @vscode/proxy-agent context, then inspect undici's proxy request and authentication entry points. Done would mean a defined extension mechanism can detect a matching Proxy-Authenticate scheme, generate dynamic authorization, and retry 407 responses as required.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authentication, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.