authenticateBearerWithTelemetry (services/authTelemetry.server.ts)

trigger.dev · apps/webapp/app/services/authTelemetry.server.ts · typescript · Apache-2.0
auth

Bearer authentication middleware with telemetry, supporting run tokens and RBAC.

// Source: https://github.com/triggerdotdev/trigger.dev | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { getMeter } from "@internal/tracing";
import { isAdditionalApiKey } from "@trigger.dev/core/v3/apiKeys";
import { isPublicJWT } from "@trigger.dev/core/v3/jwt";
import type { BearerAuthOptions } from "@trigger.dev/plugins";
import type {
  BearerCredentialKind,
  BearerLookupPath,
  HostBearerAuthResult,
  RbacResource,
} from "@trigger.dev/rbac";
import { authenticateRunToken } from "~/services/oidc/runTokenAuth.server";
import { isRunTokenFormat } from "~/services/oidc/runTokenVerify";
import { rbac } from "~/services/rbac.server";
import { singleton } from "~/utils/si

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key