@redmix/api 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/auth/index.d.ts +51 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +129 -0
- package/dist/auth/parseJWT.d.ts +6 -0
- package/dist/auth/parseJWT.d.ts.map +1 -0
- package/dist/auth/parseJWT.js +57 -0
- package/dist/auth/verifiers/base64Sha1Verifier.d.ts +19 -0
- package/dist/auth/verifiers/base64Sha1Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/base64Sha1Verifier.js +77 -0
- package/dist/auth/verifiers/base64Sha256Verifier.d.ts +19 -0
- package/dist/auth/verifiers/base64Sha256Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/base64Sha256Verifier.js +77 -0
- package/dist/auth/verifiers/common.d.ts +104 -0
- package/dist/auth/verifiers/common.d.ts.map +1 -0
- package/dist/auth/verifiers/common.js +99 -0
- package/dist/auth/verifiers/index.d.ts +8 -0
- package/dist/auth/verifiers/index.d.ts.map +1 -0
- package/dist/auth/verifiers/index.js +38 -0
- package/dist/auth/verifiers/jwtVerifier.d.ts +26 -0
- package/dist/auth/verifiers/jwtVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/jwtVerifier.js +86 -0
- package/dist/auth/verifiers/secretKeyVerifier.d.ts +14 -0
- package/dist/auth/verifiers/secretKeyVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/secretKeyVerifier.js +40 -0
- package/dist/auth/verifiers/sha1Verifier.d.ts +25 -0
- package/dist/auth/verifiers/sha1Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/sha1Verifier.js +85 -0
- package/dist/auth/verifiers/sha256Verifier.d.ts +25 -0
- package/dist/auth/verifiers/sha256Verifier.d.ts.map +1 -0
- package/dist/auth/verifiers/sha256Verifier.js +85 -0
- package/dist/auth/verifiers/skipVerifier.d.ts +13 -0
- package/dist/auth/verifiers/skipVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/skipVerifier.js +37 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.d.ts +16 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.d.ts.map +1 -0
- package/dist/auth/verifiers/timestampSchemeVerifier.js +81 -0
- package/dist/bins/redwood.d.ts +3 -0
- package/dist/bins/redwood.d.ts.map +1 -0
- package/dist/bins/redwood.js +33 -0
- package/dist/bins/rwfw.d.ts +3 -0
- package/dist/bins/rwfw.d.ts.map +1 -0
- package/dist/bins/rwfw.js +33 -0
- package/dist/bins/tsc.d.ts +3 -0
- package/dist/bins/tsc.d.ts.map +1 -0
- package/dist/bins/tsc.js +30 -0
- package/dist/cache/clients/BaseClient.d.ts +11 -0
- package/dist/cache/clients/BaseClient.d.ts.map +1 -0
- package/dist/cache/clients/BaseClient.js +27 -0
- package/dist/cache/clients/InMemoryClient.d.ts +31 -0
- package/dist/cache/clients/InMemoryClient.d.ts.map +1 -0
- package/dist/cache/clients/InMemoryClient.js +100 -0
- package/dist/cache/clients/MemcachedClient.d.ts +16 -0
- package/dist/cache/clients/MemcachedClient.d.ts.map +1 -0
- package/dist/cache/clients/MemcachedClient.js +75 -0
- package/dist/cache/clients/RedisClient.d.ts +20 -0
- package/dist/cache/clients/RedisClient.d.ts.map +1 -0
- package/dist/cache/clients/RedisClient.js +79 -0
- package/dist/cache/errors.d.ts +4 -0
- package/dist/cache/errors.d.ts.map +1 -0
- package/dist/cache/errors.js +33 -0
- package/dist/cache/index.d.ts +35 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +171 -0
- package/dist/cors.d.ts +16 -0
- package/dist/cors.d.ts.map +1 -0
- package/dist/cors.js +93 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +38 -0
- package/dist/event.d.ts +3 -0
- package/dist/event.d.ts.map +1 -0
- package/dist/event.js +34 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts +4 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.d.ts.map +1 -0
- package/dist/functions/fixtures/apiGatewayProxyEvent.fixture.js +72 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/logger/index.d.ts +179 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +195 -0
- package/dist/transforms.d.ts +35 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +98 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/validations/errors.d.ts +101 -0
- package/dist/validations/errors.d.ts.map +1 -0
- package/dist/validations/errors.js +298 -0
- package/dist/validations/validations.d.ts +222 -0
- package/dist/validations/validations.d.ts.map +1 -0
- package/dist/validations/validations.js +351 -0
- package/dist/webhooks/index.d.ts +76 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +107 -0
- package/package.json +95 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Redmix
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# API
|
2
|
+
|
3
|
+
## Purpose and Vision
|
4
|
+
|
5
|
+
Redwood believes the future is serverless and multi-client. And `@redwoodjs/api` makes Redwood serverless and multi-client ready. Redwood has one API to rule them all. Your API is abstracted away from any one side of your application, so you can have as many sides as you need, and when you need them.
|
6
|
+
|
7
|
+
Right now, the `@redwoodjs/api` package exposes functions that help with logging, services, data fetching via Prisma, webhooks and authentication.
|
8
|
+
|
9
|
+
We also plan to make Functions platform-agnostic. At the moment, we're targeting AWS Lambda, but we aim to provide a single interface for other providers and build-time support when you've targeted them.
|
10
|
+
|
11
|
+
## Package Lead
|
12
|
+
|
13
|
+
[@peterp](https://github.com/peterp/)
|
14
|
+
[@dthyresson](https://github.com/dthyresson/)
|
15
|
+
|
16
|
+
### Logging
|
17
|
+
|
18
|
+
RedwoodJS provides an opinionated logger with sensible, practical defaults that grants you visibility into the JAMStack applications you're developing and have deployed -- with ease.
|
19
|
+
|
20
|
+
Logging in the serverless ecosystem is not trivial and neither is its configuration.
|
21
|
+
|
22
|
+
When choosing a Node.js logger to add to the framework, RedwoodJS required that it:
|
23
|
+
|
24
|
+
- Have a low-overhead, and be fast
|
25
|
+
- Output helpful, readable information in development
|
26
|
+
- Be highly configurable to set log levels, time formatting, and more
|
27
|
+
- Support key redaction to prevent passwords or tokens from leaking out
|
28
|
+
- Save to a file in local (or other) environments that can write to the file system
|
29
|
+
- Stream to third-party log and application monitoring services vital to production logging in serverless environments like [logFlare](https://logflare.app/) and [Datadog](https://www.datadoghq.com/)
|
30
|
+
- Hook into [Prisma logging](https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/logging) to give visibility into connection issues, slow queries, and any unexpected errors
|
31
|
+
- Have a solid Developer experience (DX) to get logging out-of-the-gate quickly
|
32
|
+
- Use a compact configuration to set how to log (its `options`) and where to log -- file, stdout, or remote transport stream -- (its `destination`)
|
33
|
+
|
34
|
+
With those criteria in mind, Redwood includes [pino](https://github.com/pinojs/pino) with its rich [features](https://github.com/pinojs/pino/blob/master/docs/api.md), [ecosystem](https://github.com/pinojs/pino/blob/master/docs/ecosystem.md) and [community](https://github.com/pinojs/pino/blob/master/docs/ecosystem.md#community).
|
35
|
+
|
36
|
+
Plus ... pino means 🌲 pine tree! How perfect is that for RedwoodJS?
|
37
|
+
|
38
|
+
Note: RedwoodJS logging is setup for its api side only. For browser and web side error reporting or exception handling, these features will be addressed in a future release.
|
39
|
+
|
40
|
+
For detailed logger configuration, see the RedwoodJS logger package [README](./src/logger/README.md).
|
41
|
+
|
42
|
+
## Contributing
|
43
|
+
|
44
|
+
`@redwoodjs/api` uses a few things you should be familiar with:
|
45
|
+
|
46
|
+
- [Prisma](https://www.prisma.io)
|
47
|
+
- [Pino](https://getpino.io)
|
48
|
+
|
49
|
+
Although this package depends, in the code-dependency sense, only on `@redwoodjs/internal`, it still hangs together with the others—notably, `@redwoodjs/web` and `@redwoodjs/api-server`. So, if you’re asking yourself “but when does my server run?” head over to `@redwoodjs/api-server`.
|
50
|
+
|
51
|
+
If you’re asking yourself “but where is my GraphQL Server” head over to `@redwoodjs/graphql-server`.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
export * from './parseJWT';
|
2
|
+
import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda';
|
3
|
+
import type { Decoded } from './parseJWT';
|
4
|
+
export type { Decoded };
|
5
|
+
export declare const AUTH_PROVIDER_HEADER = "auth-provider";
|
6
|
+
export declare const getAuthProviderHeader: (event: APIGatewayProxyEvent | Request) => string | null | undefined;
|
7
|
+
export interface AuthorizationHeader {
|
8
|
+
schema: 'Bearer' | 'Basic' | string;
|
9
|
+
token: string;
|
10
|
+
}
|
11
|
+
export type AuthorizationCookies = {
|
12
|
+
parsedCookie: Record<string, string | undefined>;
|
13
|
+
rawCookie: string;
|
14
|
+
type: string | undefined;
|
15
|
+
} | null;
|
16
|
+
export declare const parseAuthorizationCookie: (event: APIGatewayProxyEvent | Request) => AuthorizationCookies;
|
17
|
+
/**
|
18
|
+
* Split the `Authorization` header into a schema and token part.
|
19
|
+
*/
|
20
|
+
export declare const parseAuthorizationHeader: (event: APIGatewayProxyEvent | Request) => AuthorizationHeader;
|
21
|
+
/** @MARK Note that we do not send LambdaContext when making fetch requests
|
22
|
+
*
|
23
|
+
* This part is incomplete, as we need to decide how we will make the breaking change to
|
24
|
+
* 1. getCurrentUser
|
25
|
+
* 2. authDecoders
|
26
|
+
|
27
|
+
*/
|
28
|
+
export type AuthContextPayload = [
|
29
|
+
Decoded,
|
30
|
+
{
|
31
|
+
type: string;
|
32
|
+
} & AuthorizationHeader,
|
33
|
+
{
|
34
|
+
event: APIGatewayProxyEvent | Request;
|
35
|
+
context?: LambdaContext;
|
36
|
+
}
|
37
|
+
];
|
38
|
+
export type Decoder = (token: string, type: string, req: {
|
39
|
+
event: APIGatewayProxyEvent | Request;
|
40
|
+
context?: LambdaContext;
|
41
|
+
}) => Promise<Decoded>;
|
42
|
+
/**
|
43
|
+
* Get the authorization information from the request headers and request context.
|
44
|
+
* @returns [decoded, { type, schema, token }, { event, context }]
|
45
|
+
**/
|
46
|
+
export declare const getAuthenticationContext: ({ authDecoder, event, context, }: {
|
47
|
+
authDecoder?: Decoder | Decoder[];
|
48
|
+
event: APIGatewayProxyEvent | Request;
|
49
|
+
context: LambdaContext;
|
50
|
+
}) => Promise<undefined | AuthContextPayload>;
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts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AAO,CAAC,OAAO,CAAC,CAAA;AAErB;;;IAGI;AACJ,eAAO,MAAM,wBAAwB,qCAIlC;IACD,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAA;IACjC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAA;IACrC,OAAO,EAAE,aAAa,CAAA;CACvB,KAAG,OAAO,CAAC,SAAS,GAAG,kBAAkB,CA6DzC,CAAA"}
|
@@ -0,0 +1,129 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
27
|
+
mod
|
28
|
+
));
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
30
|
+
var auth_exports = {};
|
31
|
+
__export(auth_exports, {
|
32
|
+
AUTH_PROVIDER_HEADER: () => AUTH_PROVIDER_HEADER,
|
33
|
+
getAuthProviderHeader: () => getAuthProviderHeader,
|
34
|
+
getAuthenticationContext: () => getAuthenticationContext,
|
35
|
+
parseAuthorizationCookie: () => parseAuthorizationCookie,
|
36
|
+
parseAuthorizationHeader: () => parseAuthorizationHeader
|
37
|
+
});
|
38
|
+
module.exports = __toCommonJS(auth_exports);
|
39
|
+
__reExport(auth_exports, require("./parseJWT"), module.exports);
|
40
|
+
var cookie = __toESM(require("cookie"));
|
41
|
+
var import_event = require("../event");
|
42
|
+
const AUTH_PROVIDER_HEADER = "auth-provider";
|
43
|
+
const getAuthProviderHeader = (event) => {
|
44
|
+
const authProviderKey = Object.keys(event?.headers ?? {}).find(
|
45
|
+
(key) => key.toLowerCase() === AUTH_PROVIDER_HEADER
|
46
|
+
);
|
47
|
+
if (authProviderKey) {
|
48
|
+
return (0, import_event.getEventHeader)(event, authProviderKey);
|
49
|
+
}
|
50
|
+
return void 0;
|
51
|
+
};
|
52
|
+
const parseAuthorizationCookie = (event) => {
|
53
|
+
const cookieHeader = (0, import_event.getEventHeader)(event, "Cookie");
|
54
|
+
if (!cookieHeader) {
|
55
|
+
return null;
|
56
|
+
}
|
57
|
+
const parsedCookie = cookie.parse(cookieHeader);
|
58
|
+
return {
|
59
|
+
parsedCookie,
|
60
|
+
rawCookie: cookieHeader,
|
61
|
+
// When not unauthenticated, this will be null/undefined
|
62
|
+
// Remember that the cookie header could contain other (unrelated) values!
|
63
|
+
type: parsedCookie[AUTH_PROVIDER_HEADER]
|
64
|
+
};
|
65
|
+
};
|
66
|
+
const parseAuthorizationHeader = (event) => {
|
67
|
+
const parts = (0, import_event.getEventHeader)(event, "Authorization")?.split(" ");
|
68
|
+
if (parts?.length !== 2) {
|
69
|
+
throw new Error("The `Authorization` header is not valid.");
|
70
|
+
}
|
71
|
+
const [schema, token] = parts;
|
72
|
+
if (!schema.length || !token.length) {
|
73
|
+
throw new Error("The `Authorization` header is not valid.");
|
74
|
+
}
|
75
|
+
return { schema, token };
|
76
|
+
};
|
77
|
+
const getAuthenticationContext = async ({
|
78
|
+
authDecoder,
|
79
|
+
event,
|
80
|
+
context
|
81
|
+
}) => {
|
82
|
+
const cookieHeader = parseAuthorizationCookie(event);
|
83
|
+
const typeFromHeader = getAuthProviderHeader(event);
|
84
|
+
if (!typeFromHeader && !cookieHeader) {
|
85
|
+
return void 0;
|
86
|
+
}
|
87
|
+
let token;
|
88
|
+
let type;
|
89
|
+
let schema;
|
90
|
+
if (cookieHeader?.type) {
|
91
|
+
token = cookieHeader.rawCookie;
|
92
|
+
type = cookieHeader.type;
|
93
|
+
schema = "cookie";
|
94
|
+
} else if (typeFromHeader) {
|
95
|
+
const parsedAuthHeader = parseAuthorizationHeader(event);
|
96
|
+
token = parsedAuthHeader.token;
|
97
|
+
type = typeFromHeader;
|
98
|
+
schema = parsedAuthHeader.schema;
|
99
|
+
}
|
100
|
+
if (!token || !type || !schema) {
|
101
|
+
return void 0;
|
102
|
+
}
|
103
|
+
let authDecoders = [];
|
104
|
+
if (Array.isArray(authDecoder)) {
|
105
|
+
authDecoders = authDecoder;
|
106
|
+
} else if (authDecoder) {
|
107
|
+
authDecoders = [authDecoder];
|
108
|
+
}
|
109
|
+
let decoded = null;
|
110
|
+
let i = 0;
|
111
|
+
while (!decoded && i < authDecoders.length) {
|
112
|
+
decoded = await authDecoders[i](token, type, {
|
113
|
+
// @MARK: When called from middleware, the decoder will pass Request, not Lambda event
|
114
|
+
event,
|
115
|
+
context
|
116
|
+
});
|
117
|
+
i++;
|
118
|
+
}
|
119
|
+
return [decoded, { type, schema, token }, { event, context }];
|
120
|
+
};
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
122
|
+
0 && (module.exports = {
|
123
|
+
AUTH_PROVIDER_HEADER,
|
124
|
+
getAuthProviderHeader,
|
125
|
+
getAuthenticationContext,
|
126
|
+
parseAuthorizationCookie,
|
127
|
+
parseAuthorizationHeader,
|
128
|
+
...require("./parseJWT")
|
129
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parseJWT.d.ts","sourceRoot":"","sources":["../../src/auth/parseJWT.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;AA8DpD,eAAO,MAAM,QAAQ,UAAW;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,KAAG,GAKH,CAAA"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var parseJWT_exports = {};
|
20
|
+
__export(parseJWT_exports, {
|
21
|
+
parseJWT: () => parseJWT
|
22
|
+
});
|
23
|
+
module.exports = __toCommonJS(parseJWT_exports);
|
24
|
+
function isTokenWithRoles(token) {
|
25
|
+
return !!token.decoded?.roles;
|
26
|
+
}
|
27
|
+
function isTokenWithMetadata(token) {
|
28
|
+
const claim = token.namespace ? `${token.namespace}/app_metadata` : "app_metadata";
|
29
|
+
return !!token.decoded?.[claim];
|
30
|
+
}
|
31
|
+
const appMetadata = (token) => {
|
32
|
+
if (typeof token.decoded === "string") {
|
33
|
+
return {};
|
34
|
+
}
|
35
|
+
if (isTokenWithMetadata(token)) {
|
36
|
+
const claim = token.namespace ? `${token.namespace}/app_metadata` : "app_metadata";
|
37
|
+
return token.decoded?.[claim];
|
38
|
+
}
|
39
|
+
return {};
|
40
|
+
};
|
41
|
+
const roles = (token) => {
|
42
|
+
if (isTokenWithRoles(token)) {
|
43
|
+
return token.decoded.roles;
|
44
|
+
}
|
45
|
+
const metadata = appMetadata(token);
|
46
|
+
return metadata?.roles || metadata.authorization?.roles || [];
|
47
|
+
};
|
48
|
+
const parseJWT = (token) => {
|
49
|
+
return {
|
50
|
+
appMetadata: appMetadata(token),
|
51
|
+
roles: roles(token)
|
52
|
+
};
|
53
|
+
};
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
55
|
+
0 && (module.exports = {
|
56
|
+
parseJWT
|
57
|
+
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { WebhookVerifier, VerifyOptions } from './common';
|
2
|
+
export interface Base64Sha1Verifier extends WebhookVerifier {
|
3
|
+
type: 'base64Sha1Verifier';
|
4
|
+
}
|
5
|
+
export declare const verifySignature: ({ payload, secret, signature, }: {
|
6
|
+
payload: string | Record<string, unknown>;
|
7
|
+
secret: string;
|
8
|
+
signature: string;
|
9
|
+
}) => boolean;
|
10
|
+
/**
|
11
|
+
* Base64 SHA1 HMAC Payload Verifier
|
12
|
+
*
|
13
|
+
* Based on Svix's webhook payload verification, but using SHA1 instead
|
14
|
+
* @see https://docs.svix.com/receiving/verifying-payloads/how-manual
|
15
|
+
* @see https://github.com/svix/svix-webhooks/blob/main/javascript/src/index.ts
|
16
|
+
*/
|
17
|
+
declare const base64Sha1Verifier: (_options?: VerifyOptions) => Base64Sha1Verifier;
|
18
|
+
export default base64Sha1Verifier;
|
19
|
+
//# sourceMappingURL=base64Sha1Verifier.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base64Sha1Verifier.d.ts","sourceRoot":"","sources":["../../../src/auth/verifiers/base64Sha1Verifier.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE9D,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,IAAI,EAAE,oBAAoB,CAAA;CAC3B;AA0BD,eAAO,MAAM,eAAe,oCAIzB;IACD,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,KAAG,OA0BH,CAAA;AAED;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB,cAAe,aAAa,KAAG,kBAUtD,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var base64Sha1Verifier_exports = {};
|
20
|
+
__export(base64Sha1Verifier_exports, {
|
21
|
+
default: () => base64Sha1Verifier_default,
|
22
|
+
verifySignature: () => verifySignature
|
23
|
+
});
|
24
|
+
module.exports = __toCommonJS(base64Sha1Verifier_exports);
|
25
|
+
var import_crypto = require("crypto");
|
26
|
+
var import_common = require("./common");
|
27
|
+
function toNormalizedJsonString(payload) {
|
28
|
+
return JSON.stringify(payload).replace(/[^\\]\\u[\da-f]{4}/g, (s) => {
|
29
|
+
return s.slice(0, 3) + s.slice(3).toUpperCase();
|
30
|
+
});
|
31
|
+
}
|
32
|
+
const createSignature = ({
|
33
|
+
payload,
|
34
|
+
secret = import_common.DEFAULT_WEBHOOK_SECRET
|
35
|
+
}) => {
|
36
|
+
const algorithm = "sha1";
|
37
|
+
const hmac = (0, import_crypto.createHmac)(algorithm, Buffer.from(secret, "base64"));
|
38
|
+
payload = typeof payload === "string" ? payload : toNormalizedJsonString(payload);
|
39
|
+
const digest = hmac.update(payload).digest();
|
40
|
+
return digest.toString("base64");
|
41
|
+
};
|
42
|
+
const verifySignature = ({
|
43
|
+
payload,
|
44
|
+
secret = import_common.DEFAULT_WEBHOOK_SECRET,
|
45
|
+
signature
|
46
|
+
}) => {
|
47
|
+
try {
|
48
|
+
const webhookSignature = Buffer.from(signature || "", "base64");
|
49
|
+
const hmac = (0, import_crypto.createHmac)("sha1", Buffer.from(secret, "base64"));
|
50
|
+
payload = typeof payload === "string" ? payload : toNormalizedJsonString(payload);
|
51
|
+
const digest = hmac.update(payload).digest();
|
52
|
+
if (webhookSignature.length === digest.length && (0, import_crypto.timingSafeEqual)(digest, webhookSignature)) {
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
throw new import_common.WebhookVerificationError();
|
56
|
+
} catch (error) {
|
57
|
+
throw new import_common.WebhookVerificationError(
|
58
|
+
`${import_common.VERIFICATION_ERROR_MESSAGE}: ${error.message}`
|
59
|
+
);
|
60
|
+
}
|
61
|
+
};
|
62
|
+
const base64Sha1Verifier = (_options) => {
|
63
|
+
return {
|
64
|
+
sign: ({ payload, secret }) => {
|
65
|
+
return createSignature({ payload, secret });
|
66
|
+
},
|
67
|
+
verify: ({ payload, secret, signature }) => {
|
68
|
+
return verifySignature({ payload, secret, signature });
|
69
|
+
},
|
70
|
+
type: "base64Sha1Verifier"
|
71
|
+
};
|
72
|
+
};
|
73
|
+
var base64Sha1Verifier_default = base64Sha1Verifier;
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
75
|
+
0 && (module.exports = {
|
76
|
+
verifySignature
|
77
|
+
});
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import type { WebhookVerifier, VerifyOptions } from './common';
|
2
|
+
export interface Base64Sha256Verifier extends WebhookVerifier {
|
3
|
+
type: 'base64Sha256Verifier';
|
4
|
+
}
|
5
|
+
export declare const verifySignature: ({ payload, secret, signature, }: {
|
6
|
+
payload: string | Record<string, unknown>;
|
7
|
+
secret: string;
|
8
|
+
signature: string;
|
9
|
+
}) => boolean;
|
10
|
+
/**
|
11
|
+
* Base64 SHA256 HMAC Payload Verifier
|
12
|
+
*
|
13
|
+
* Based on Svix's webhook payload verification
|
14
|
+
* @see https://docs.svix.com/receiving/verifying-payloads/how-manual
|
15
|
+
* @see https://github.com/svix/svix-webhooks/blob/main/javascript/src/index.ts
|
16
|
+
*/
|
17
|
+
declare const base64Sha256Verifier: (_options?: VerifyOptions) => Base64Sha256Verifier;
|
18
|
+
export default base64Sha256Verifier;
|
19
|
+
//# sourceMappingURL=base64Sha256Verifier.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base64Sha256Verifier.d.ts","sourceRoot":"","sources":["../../../src/auth/verifiers/base64Sha256Verifier.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,IAAI,EAAE,sBAAsB,CAAA;CAC7B;AA0BD,eAAO,MAAM,eAAe,oCAIzB;IACD,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,KAAG,OA0BH,CAAA;AAED;;;;;;GAMG;AACH,QAAA,MAAM,oBAAoB,cACb,aAAa,KACvB,oBAUF,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
var base64Sha256Verifier_exports = {};
|
20
|
+
__export(base64Sha256Verifier_exports, {
|
21
|
+
default: () => base64Sha256Verifier_default,
|
22
|
+
verifySignature: () => verifySignature
|
23
|
+
});
|
24
|
+
module.exports = __toCommonJS(base64Sha256Verifier_exports);
|
25
|
+
var import_crypto = require("crypto");
|
26
|
+
var import_common = require("./common");
|
27
|
+
function toNormalizedJsonString(payload) {
|
28
|
+
return JSON.stringify(payload).replace(/[^\\]\\u[\da-f]{4}/g, (s) => {
|
29
|
+
return s.slice(0, 3) + s.slice(3).toUpperCase();
|
30
|
+
});
|
31
|
+
}
|
32
|
+
const createSignature = ({
|
33
|
+
payload,
|
34
|
+
secret = import_common.DEFAULT_WEBHOOK_SECRET
|
35
|
+
}) => {
|
36
|
+
const algorithm = "sha256";
|
37
|
+
const hmac = (0, import_crypto.createHmac)(algorithm, Buffer.from(secret, "base64"));
|
38
|
+
payload = typeof payload === "string" ? payload : toNormalizedJsonString(payload);
|
39
|
+
const digest = hmac.update(payload).digest();
|
40
|
+
return digest.toString("base64");
|
41
|
+
};
|
42
|
+
const verifySignature = ({
|
43
|
+
payload,
|
44
|
+
secret = import_common.DEFAULT_WEBHOOK_SECRET,
|
45
|
+
signature
|
46
|
+
}) => {
|
47
|
+
try {
|
48
|
+
const webhookSignature = Buffer.from(signature || "", "base64");
|
49
|
+
const hmac = (0, import_crypto.createHmac)("sha256", Buffer.from(secret, "base64"));
|
50
|
+
payload = typeof payload === "string" ? payload : toNormalizedJsonString(payload);
|
51
|
+
const digest = hmac.update(payload).digest();
|
52
|
+
if (webhookSignature.length === digest.length && (0, import_crypto.timingSafeEqual)(digest, webhookSignature)) {
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
throw new import_common.WebhookVerificationError();
|
56
|
+
} catch (error) {
|
57
|
+
throw new import_common.WebhookVerificationError(
|
58
|
+
`${import_common.VERIFICATION_ERROR_MESSAGE}: ${error.message}`
|
59
|
+
);
|
60
|
+
}
|
61
|
+
};
|
62
|
+
const base64Sha256Verifier = (_options) => {
|
63
|
+
return {
|
64
|
+
sign: ({ payload, secret }) => {
|
65
|
+
return createSignature({ payload, secret });
|
66
|
+
},
|
67
|
+
verify: ({ payload, secret, signature }) => {
|
68
|
+
return verifySignature({ payload, secret, signature });
|
69
|
+
},
|
70
|
+
type: "base64Sha256Verifier"
|
71
|
+
};
|
72
|
+
};
|
73
|
+
var base64Sha256Verifier_default = base64Sha256Verifier;
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
75
|
+
0 && (module.exports = {
|
76
|
+
verifySignature
|
77
|
+
});
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import type { Base64Sha1Verifier } from './base64Sha1Verifier';
|
2
|
+
import type { Base64Sha256Verifier } from './base64Sha256Verifier';
|
3
|
+
import type { JwtVerifier } from './jwtVerifier';
|
4
|
+
import type { SecretKeyVerifier } from './secretKeyVerifier';
|
5
|
+
import type { Sha1Verifier } from './sha1Verifier';
|
6
|
+
import type { Sha256Verifier } from './sha256Verifier';
|
7
|
+
import type { SkipVerifier } from './skipVerifier';
|
8
|
+
import type { TimestampSchemeVerifier } from './timestampSchemeVerifier';
|
9
|
+
export declare const verifierLookup: {
|
10
|
+
skipVerifier: (_options?: VerifyOptions) => SkipVerifier;
|
11
|
+
secretKeyVerifier: (_options?: VerifyOptions) => SecretKeyVerifier;
|
12
|
+
sha1Verifier: (_options?: VerifyOptions) => Sha1Verifier;
|
13
|
+
sha256Verifier: (_options?: VerifyOptions) => Sha256Verifier;
|
14
|
+
base64Sha1Verifier: (_options?: VerifyOptions) => Base64Sha1Verifier;
|
15
|
+
base64Sha256Verifier: (_options?: VerifyOptions) => Base64Sha256Verifier;
|
16
|
+
timestampSchemeVerifier: (options?: VerifyOptions) => TimestampSchemeVerifier;
|
17
|
+
jwtVerifier: (options?: VerifyOptions) => JwtVerifier;
|
18
|
+
};
|
19
|
+
export type SupportedVerifiers = SkipVerifier | SecretKeyVerifier | Sha1Verifier | Sha256Verifier | Base64Sha1Verifier | Base64Sha256Verifier | TimestampSchemeVerifier | JwtVerifier;
|
20
|
+
export type SupportedVerifierTypes = keyof typeof verifierLookup;
|
21
|
+
export declare const DEFAULT_WEBHOOK_SECRET: string;
|
22
|
+
export declare const VERIFICATION_ERROR_MESSAGE = "You don't have access to invoke this function.";
|
23
|
+
export declare const VERIFICATION_SIGN_MESSAGE = "Unable to sign payload";
|
24
|
+
/**
|
25
|
+
* @const {number} DEFAULT_TOLERANCE - Five minutes
|
26
|
+
*/
|
27
|
+
export declare const DEFAULT_TOLERANCE: number;
|
28
|
+
/**
|
29
|
+
* Class representing a WebhookError
|
30
|
+
* @extends Error
|
31
|
+
*/
|
32
|
+
declare class WebhookError extends Error {
|
33
|
+
/**
|
34
|
+
* Create a WebhookError.
|
35
|
+
* @param {string} message - The error message
|
36
|
+
* */
|
37
|
+
constructor(message: string);
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Class representing a WebhookVerificationError
|
41
|
+
* @extends WebhookError
|
42
|
+
*/
|
43
|
+
export declare class WebhookVerificationError extends WebhookError {
|
44
|
+
/**
|
45
|
+
* Create a WebhookVerificationError.
|
46
|
+
* @param {string} message - The error message
|
47
|
+
* */
|
48
|
+
constructor(message?: string);
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* Class representing a WebhookSignError
|
52
|
+
* @extends WebhookError
|
53
|
+
*/
|
54
|
+
export declare class WebhookSignError extends WebhookError {
|
55
|
+
/**
|
56
|
+
* Create a WebhookSignError.
|
57
|
+
* @param {string} message - The error message
|
58
|
+
* */
|
59
|
+
constructor(message?: string);
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* VerifyOptions
|
63
|
+
*
|
64
|
+
* Used when verifying a signature based on the verifier's requirements
|
65
|
+
*
|
66
|
+
* @param {string} signatureHeader - Optional Header that contains the signature
|
67
|
+
* to verify. Will default to DEFAULT_WEBHOOK_SIGNATURE_HEADER
|
68
|
+
* @param {(signature: string) => string} signatureTransformer - Optional
|
69
|
+
* function that receives the signature from the headers and returns a new
|
70
|
+
* signature to use in the Verifier
|
71
|
+
* @param {number} currentTimestampOverride - Optional timestamp to use as the
|
72
|
+
* "current" timestamp, in msec
|
73
|
+
* @param {number} eventTimestamp - Optional timestamp to use as the event
|
74
|
+
* timestamp, in msec. If this is provided the webhook verification will fail
|
75
|
+
* if the eventTimestamp is too far from the current time (or the time passed
|
76
|
+
* as the `currentTimestampOverride` option)
|
77
|
+
* @param {number} tolerance - Optional tolerance in msec
|
78
|
+
* @param {string} issuer - Options JWT issuer for JWTVerifier
|
79
|
+
*/
|
80
|
+
export interface VerifyOptions {
|
81
|
+
signatureHeader?: string;
|
82
|
+
signatureTransformer?: (signature: string) => string;
|
83
|
+
currentTimestampOverride?: number;
|
84
|
+
eventTimestamp?: number;
|
85
|
+
tolerance?: number;
|
86
|
+
issuer?: string;
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* WebhookVerifier is the interface for all verifiers
|
90
|
+
*/
|
91
|
+
export interface WebhookVerifier {
|
92
|
+
sign({ payload, secret, }: {
|
93
|
+
payload: string | Record<string, unknown>;
|
94
|
+
secret: string;
|
95
|
+
}): string;
|
96
|
+
verify({ payload, secret, signature, }: {
|
97
|
+
payload: string | Record<string, unknown>;
|
98
|
+
secret: string;
|
99
|
+
signature: string;
|
100
|
+
}): boolean | WebhookVerificationError;
|
101
|
+
type: SupportedVerifierTypes;
|
102
|
+
}
|
103
|
+
export {};
|
104
|
+
//# sourceMappingURL=common.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/auth/verifiers/common.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,uB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