
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
@adcp/eslint-plugin
Advanced tools
ESLint rules for AdCP adopters — flags credential-handling antipatterns at lint time. Build-time sibling to the SDK's `credentialPolicy: 'authInfo-only'` runtime guard.
Build-time lint rules for @adcp/sdk adopters. Catches the credential-handling antipatterns that the SDK's runtime guards already flag, but at code-write time — so the bug never ships.
npm i -D @adcp/eslint-plugin eslint
Flat config (eslint.config.js):
import adcp from '@adcp/eslint-plugin';
export default [
{
plugins: { '@adcp': adcp },
rules: {
'@adcp/no-credential-read-from-args': 'error',
},
},
];
Legacy .eslintrc:
{
"plugins": ["@adcp"],
"extends": ["plugin:@adcp/recommended"]
}
@adcp/no-credential-read-from-argsFlags reads of credential-shaped keys off the buyer-supplied args bag
inside extractContext / synthesizeFromArgs platform method
implementations.
// ❌ flagged
const platform = {
extractContext(args) {
return { token: args.snap_access_token };
},
};
// ✅ ok — re-derive bearers from authInfo + token cache
const platform = {
extractContext(args, ctx) {
return {
accountId: args.account_id, // non-secret upstream ID
token: tokenCache.get(ctx.authInfo), // secret comes from authInfo
};
},
};
Detection keys on method name, not interface type — duck-typed
definePlatform shapes and class methods that don't implements the
interface explicitly are both covered.
Credential-name patterns are imported directly from
@adcp/sdk/server's
DEFAULT_CREDENTIAL_PATTERNS. The runtime guard
(credentialPolicy: 'authInfo-only') and this rule share one regex set —
adding a pattern to the SDK surfaces it here automatically.
additionalPatternsAdopters who extend the runtime matcher with credentialPolicy.patterns.extend
can mirror the same strings here for lint parity:
// eslint.config.js
import adcp from '@adcp/eslint-plugin';
export default [
{
plugins: { '@adcp': adcp },
rules: {
'@adcp/no-credential-read-from-args': [
'error',
{ additionalPatterns: ['platform_session_key', 'vendor_bearer'] },
],
},
},
];
// matching runtime config — keep the two lists in sync
createAdcpServer({
credentialPolicy: {
mode: 'authInfo-only',
patterns: DEFAULT_CREDENTIAL_PATTERNS.extend(['platform_session_key', 'vendor_bearer']),
},
});
Each entry is compiled as new RegExp(pattern, 'i') and appended to
DEFAULT_CREDENTIAL_PATTERNS. A fully-replaceable credentialPolicy.matcher
function has no lint analogue — see Known gaps.
This rule is a code-write-time nudge, not the security boundary. The SDK's
runtime guard (credentialPolicy: 'authInfo-only') is what enforces the
contract on the wire. The patterns below intentionally pass the linter
because catching them at AST time would require cross-function or
control-flow analysis and the false-positive cost is too high; the
runtime guard catches all of them at dispatch.
const a = args; a.access_token (the rule only scans
reads rooted at the args parameter name).const ctx = { ...args }; ctx.access_token (same — ctx
isn't args).extractField(args, 'access_token') (the
credential string lives in a sibling-function argument; cross-function
scope is out of scope).args[someVar] (the rule
can't statically evaluate the key).extractContext — only the body of the flagged method itself is
scanned; helpers it calls are not (cross-function scope).credentialPolicy.matcher — function matchers
can't be expressed as a regex pattern list, so additionalPatterns
can't mirror them. If you replace the matcher entirely at runtime,
add explicit additionalPatterns entries here for the names you want
flagged at lint time.For all of the above, rely on credentialPolicy: 'authInfo-only' at the
request boundary — it doesn't care how the read was spelled in source.
The SDK already enforces credential discipline at the request boundary via
createAdcpServer({ credentialPolicy: 'authInfo-only' }), which rejects
incoming requests that smuggle credential-shaped keys through the args
bag. That runtime guard catches mistakes at dispatch time.
This plugin catches the same class of mistake earlier — at code-write time, in the editor, in CI, before the code is deployed. Same regex set, different boundary.
See docs/guides/CTX-METADATA-SAFETY.md
for the broader credential-discipline guidance.
Phase 1 (this release) ships the no-credential-read-from-args rule.
Phase 2 (tracked in
#1541)
will add an adcp doctor CLI subcommand that wraps the linter for
adopters who don't already run ESLint, and a suggestion-level
prefer-authinfo-credential-channel rule with autofix hints.
FAQs
ESLint rules for AdCP adopters — flags credential-handling antipatterns at lint time. Build-time sibling to the SDK's `credentialPolicy: 'authInfo-only'` runtime guard.
The npm package @adcp/eslint-plugin receives a total of 23 weekly downloads. As such, @adcp/eslint-plugin popularity was classified as not popular.
We found that @adcp/eslint-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.