Expand description
lockdocs Pro “private sources”: read packages and docs from the private registries and git hosts the user has already configured, with the user’s own credentials, each sent only to the host it belongs to.
Nothing here decides whether the caller may use Pro: the binary checks the
licence and sets Options::private. This module only knows two things: how
to find the user’s existing configuration (.npmrc, uv/pip config,
.cargo/config.toml, GOPROXY, ~/.netrc, token variables,
git credential fill), and how to keep a credential on its own host:
- a
Credentialcarries the exact origin (scheme, host, port) it was configured for, andCreds::for_urlreturns it only for that origin; Httpfollows redirects itself, one hop at a time, and asksCredsagain for every hop, so a redirect to another host loses the header;AuthandCredentialprint as***, and every error that reaches the user passes throughCreds::redact.
Modules§
- cargo
- Cargo alternate registries (sparse protocol), from
.cargo/config.toml,$CARGO_HOME/credentials.toml,CARGO_REGISTRIES_<NAME>_*variables, the registryCargo.lockrecorded per package and theregistry = "name"key ofCargo.tomldependencies. - git
- Git hosts (GitHub, GitHub Enterprise, GitLab, Bitbucket, any https git
host): where a repository’s archive lives, and the credential for exactly
that host: a token variable, else what
git credential fillreturns. - go
- Go private modules:
GOPROXY,GOPRIVATE,GONOPROXY,GONOSUMDB(from the environment or thego envfile) and~/.netrc. A module a private proxy serves is read from that proxy; a private module without one is read straight from its git host at the version’s tag, likegodoes. - npm
- npm private registries, from the user’s own
.npmrcfiles andNPM_CONFIG_*variables, and frompackage-lock.json’s recorded URLs. - pypi
- Python private indexes, from uv (
uv.toml,[[tool.uv.index]],UV_INDEX_*), pip (PIP_INDEX_URL,PIP_EXTRA_INDEX_URL,pip.conf), credentials in the URL,UV_INDEX_<NAME>_USERNAME/_PASSWORDor~/.netrc, and the indexuv.lockrecorded per package.
Structs§
- Candidate
- One place a package may be read from.
- Credential
- A secret bound to one origin (and optionally a path prefix on it).
- Creds
- The credentials in play for one operation.
- Env
- The process environment, or a fixed one for tests.
- Http
- Origin
- Scheme, host and port: the unit a credential is bound to.
- Plan
- Private
Required - A request needed a private source and the licence does not cover it.
- Reply
- Url
- A parsed http(s) URL. Only what credential binding needs.
Enums§
Constants§
- FEATURE
- The feature name a Pro-less call reports in the
pro_requiredanswer.
Functions§
- fetch_
into - Run the plan: private candidates first (when
allowed), then hand over to the public path. Withoutallowed, a definitively private package fails at once withPrivateRequired, without any network. - needs_
private - Does reading
depneed a private source for sure (no network)? - netrc_
for - The netrc credential for
url’s host, bound to that URL’s origin. - parse_
netrc machine HOST login L password Pentries (anddefault) of a netrc file.- plan
- Where
depwould be read from, per the user’s own configuration and lockfiles. - strip_
userinfo https://user:pw@host/xbecomeshttps://***@host/x.