You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

verify-rsa-jwt-cloudflare-worker

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verify-rsa-jwt-cloudflare-worker - npm Package Compare versions

Comparing version

to
1.4.0

7

dist/hono-middleware.d.ts
import type { Context, MiddlewareHandler } from "hono";
import type { GeneralKeyValueStore, Jwks, VerificationResult } from ".";
export type VerifyRsaJwtConfig = {
getCookieByKey?: GetCookieByKey;
jwksUri?: string;

@@ -12,1 +13,7 @@ jwks?: Jwks;

export declare function getPayloadFromContext(ctx: Context): any;
interface GetCookie {
(c: Context, key: string): string | undefined;
}
export type GetCookieByKey = (ctx: Context) => string | undefined;
export declare function createGetCookieByKey(getCookie: GetCookie, key: string): GetCookieByKey;
export {};

8

dist/hono-middleware.js

@@ -5,3 +5,4 @@ import { getJwks, useKVStore, verify } from ".";

return async (ctx, next) => {
const jwtToken = ctx.req.header("Authorization")?.replace(/Bearer\s+/i, "");
const jwtToken = ctx.req.header("Authorization")?.replace(/Bearer\s+/i, "") ||
config?.getCookieByKey?.(ctx);
if (!jwtToken || jwtToken.length === 0) {

@@ -34,1 +35,6 @@ return new Response("Bad Request", { status: 400 });

}
export function createGetCookieByKey(getCookie, key) {
return function getCookieByKey(ctx) {
return getCookie(ctx, key);
};
}

3

dist/index.d.ts
/// <reference types="@cloudflare/workers-types" />
export { getJwks } from "./get-jwks";
export type { Jwks } from "./get-jwks";
export { getPayloadFromContext, verifyRsaJwt } from "./hono-middleware";
export type { VerifyRsaJwtConfig } from "./hono-middleware";
export { createGetCookieByKey, getPayloadFromContext, verifyRsaJwt, type GetCookieByKey, type VerifyRsaJwtConfig, } from "./hono-middleware";
export { useKVStore } from "./use-kv-store";

@@ -7,0 +6,0 @@ export type { GeneralKeyValueStore, KVNamespaceOrKeyValueStore, KVStore, } from "./use-kv-store";

export { getJwks } from "./get-jwks";
export { getPayloadFromContext, verifyRsaJwt } from "./hono-middleware";
export { createGetCookieByKey, getPayloadFromContext, verifyRsaJwt, } from "./hono-middleware";
export { useKVStore } from "./use-kv-store";
export { verify } from "./verify";

@@ -5,3 +5,3 @@ {

"author": "Wataru Oguchi",
"version": "1.3.6",
"version": "1.4.0",
"license": "MIT",

@@ -8,0 +8,0 @@ "repository": {