
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@plasius/api
Advanced tools
Public generic API helper package.
dist/**withSession middlewaredocs/**, legal/**)@plasius/api is intentionally a generic helper package.src/**, local settings, and generated OpenAPI artifacts).npm run pack:check also fails if public code roots (src/**, tests/**, demo/**) contain forbidden private/product identifiers.applyBaselineSecurityHeaders(headers)isHttpsRequest(request)isInsecureLocalRequest(request)shouldEnforceHttps()ensureSession(request, options?)getSessionIdFromRequest(request, cookieName?)createSessionCookie(sessionId, options?)withSession middleware is implemented using these helpers and keeps secure defaults (HttpOnly, Secure, SameSite=Lax, Path=/).withValidatedParam({ paramName, validate, contextKey? })en-GB error translations through apiEnGbTranslations.@plasius/translations and include a stable errorKey.x-plasius-error-key response header.import {
apiErrorTranslationKeys,
createApiErrorResponse,
} from "@plasius/api";
const response = createApiErrorResponse(404, apiErrorTranslationKeys.notFound);
CORS_ALLOWED_ORIGINS or ALLOWED_ORIGINS: comma-separated trusted browser origins for credentialed CORS. Credentialed wildcard CORS is rejected by default.HMAC_SECRET: required before request IP addresses are hashed for privacy-preserving request logs.RATE_LIMIT_HMAC_SECRET: required for rate-limit identity hashing. If omitted, HMAC_SECRET is used.AUTH_COOKIE_SAME_SITE or COOKIE_SAME_SITE: optional cookie SameSite override. Defaults to Lax; use None only for HTTPS deployments that genuinely require cross-site cookies.PUBLIC_BASE_URL, FRONTEND_DOMAIN, or DOMAIN: configured deployment origin used before request-derived URL data for cookie security decisions.TRUST_PROXY_HEADERS: opt-in flag for using forwarded host/proto/IP headers. Leave unset unless the deployment edge strips and rewrites those headers.RATE_LIMIT_FAIL_OPEN: optional override for production rate-limit backend outages. Production fails closed by default.npm install @plasius/api
@plasius/api@plasius/api/middlewareimport {
applyBaselineSecurityHeaders,
isHttpsRequest,
shouldEnforceHttps,
} from "@plasius/api";
import { withCors, withRateLimiting, withMiddleware } from "@plasius/api/middleware";
import { withValidatedParam } from "@plasius/api/middleware";
const requireUserId = withValidatedParam({
paramName: "id",
validate: (rawValue) =>
typeof rawValue === "string" && rawValue.trim()
? { ok: true, value: rawValue.trim() }
: { ok: false, error: "Invalid user ID" },
});
npm ci
npm run build
npm test
npm run pack:check
npm run build compiles the public package entrypoint to dist/.
CHANGELOG.md under Unreleased.npm ci && npm run clean && npm run build && npm test && npm run pack:check.package.json version.vX.Y.Z).npm publish.SECURITY.mdCODE_OF_CONDUCT.mddocs/adrslegalApache-2.0
FAQs
Generic public API security and middleware helpers.
We found that @plasius/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.