@reventlessdev/reventless-local 3.0.0-alpha.221 → 3.0.0-alpha.222
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.222 (2026-08-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **core:** one contract for which refusal a platform gave ([7705c13](https://github.com/ReventlessDev/reventless-core/commit/7705c13ec63f41a3a659bc98cfb45b880fd5b222))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 3.0.0-alpha.221 (2026-08-14)
|
|
7
14
|
|
|
8
15
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-local",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.222",
|
|
4
4
|
"description": "Local platform for Reventless (in-memory or SQLite backend, for development and testing without AWS)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"sury": "11.0.0-alpha.4",
|
|
36
36
|
"ws": "^8.18.0",
|
|
37
37
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
38
|
-
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
39
|
-
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.27",
|
|
40
38
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
39
|
+
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
41
40
|
"@reventlessdev/rescript-node": "2.0.0-alpha.6",
|
|
41
|
+
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.27",
|
|
42
42
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
|
|
43
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.
|
|
44
|
-
"@reventlessdev/reventless-graphql-server": "1.0.0-alpha.
|
|
45
|
-
"@reventlessdev/reventless-gwt": "1.0.0-alpha.
|
|
46
|
-
"@reventlessdev/reventless-
|
|
43
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.234",
|
|
44
|
+
"@reventlessdev/reventless-graphql-server": "1.0.0-alpha.82",
|
|
45
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.181",
|
|
46
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.141",
|
|
47
|
+
"@reventlessdev/reventless-postgres": "3.0.0-alpha.98",
|
|
47
48
|
"@reventlessdev/reventless-seed": "1.0.0-alpha.13",
|
|
48
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.140",
|
|
49
49
|
"@reventlessdev/reventless-spec": "3.0.0-alpha.113"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
package/src/Platform.res
CHANGED
|
@@ -2251,7 +2251,7 @@ module MakeWithConfig = (
|
|
|
2251
2251
|
// extracts identity from the bearer token, same as the Domain server.
|
|
2252
2252
|
// Without this, Platform_* queries / mutations run as `anonymous` and
|
|
2253
2253
|
// skip the group authorization that AppSync would enforce via
|
|
2254
|
-
// `@
|
|
2254
|
+
// `@aws_cognito_user_pools(cognito_groups: ["Admin"])` in production. The Domain
|
|
2255
2255
|
// server's `asInterface.start` accepts but ignores `~contextFactory`
|
|
2256
2256
|
// because it always wires its own internal auth context.
|
|
2257
2257
|
adminGraphQL.start(
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// - Invalid bearer is rejected at HTTP level before this runs (see
|
|
8
8
|
// `DomainGraphQL_Server._dispatch`); on the admin server there is no
|
|
9
9
|
// dispatch layer, so an invalid bearer reaches this as an `AuthError`.
|
|
10
|
-
// AppSync enforces the same `@
|
|
11
|
-
// directive at the schema layer in production.
|
|
10
|
+
// AppSync enforces the same `@aws_cognito_user_pools(cognito_groups:
|
|
11
|
+
// ["Admin"])` directive at the schema layer in production.
|
|
12
12
|
//
|
|
13
13
|
// The outcome is carried onto the context beside the identity, not folded into
|
|
14
14
|
// it. Whether credentials verified and whether the verified caller holds a group
|
|
@@ -97,8 +97,9 @@ let extractAuthenticated = (ctx: JSON.t): bool =>
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// An unauthorized caller reads the reason: `GraphQL_CallerError` explains why a
|
|
100
|
-
// resolver has to construct the error rather than throw a bare one.
|
|
101
|
-
//
|
|
100
|
+
// resolver has to construct the error rather than throw a bare one. The AWS
|
|
101
|
+
// counterpart is the field-level refusal AppSync returns for a caller who fails
|
|
102
|
+
// an `@aws_cognito_user_pools(cognito_groups: [...])` gate.
|
|
102
103
|
let makeGraphqlError = GraphQL_CallerError.make
|
|
103
104
|
|
|
104
105
|
/**
|
|
@@ -112,7 +113,7 @@ let makeGraphqlError = GraphQL_CallerError.make
|
|
|
112
113
|
let unauthorizedError = (~group: string): exn =>
|
|
113
114
|
makeGraphqlError(
|
|
114
115
|
`Unauthorized: requires group "${group}"`,
|
|
115
|
-
{"extensions": {"code":
|
|
116
|
+
{"extensions": {"code": ReventlessCore.Auth_RefusalVocabulary.localIdentityCode}},
|
|
116
117
|
)
|
|
117
118
|
|
|
118
119
|
/**
|
|
@@ -128,13 +129,15 @@ let unauthorizedError = (~group: string): exn =>
|
|
|
128
129
|
let forbiddenError = (~group: string): exn =>
|
|
129
130
|
makeGraphqlError(
|
|
130
131
|
`Forbidden: requires group "${group}"`,
|
|
131
|
-
{"extensions": {"code":
|
|
132
|
+
{"extensions": {"code": ReventlessCore.Auth_RefusalVocabulary.localEntitlementCode}},
|
|
132
133
|
)
|
|
133
134
|
|
|
134
135
|
// Wrap a resolver so it refuses a caller whose identity lacks the required
|
|
135
|
-
// group. Mirrors AppSync's `@
|
|
136
|
-
// admin fields on the in-memory adapter
|
|
137
|
-
//
|
|
136
|
+
// group. Mirrors AppSync's `@aws_cognito_user_pools(cognito_groups: [...])`
|
|
137
|
+
// semantics for admin fields on the in-memory adapter. Both paths draw the same
|
|
138
|
+
// two-way distinction — AppSync as HTTP 401 versus a field error, this as two
|
|
139
|
+
// `extensions.code` values — and `ReventlessCore.Auth_RefusalVocabulary` is the
|
|
140
|
+
// mapping between them. Use for fields whose corresponding read-model entry
|
|
138
141
|
// carries `authorization: Some({group, ...})` — pass the group string here.
|
|
139
142
|
let requireGroup = (~group: string, resolver: YG.resolverFn): YG.resolverFn =>
|
|
140
143
|
async (root, args, ctx) => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as Graphql from "graphql";
|
|
4
4
|
import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
|
|
5
5
|
import * as LocalAuth$ReventlessLocal from "./LocalAuth.res.mjs";
|
|
6
|
+
import * as Auth_RefusalVocabulary$ReventlessCore from "@reventlessdev/reventless-core/src/adapter/Auth/Auth_RefusalVocabulary.res.mjs";
|
|
6
7
|
|
|
7
8
|
function extractHeaders(headers) {
|
|
8
9
|
let acc = {};
|
|
@@ -74,7 +75,7 @@ function makeGraphqlError(prim0, prim1) {
|
|
|
74
75
|
function unauthorizedError(group) {
|
|
75
76
|
return new Graphql.GraphQLError(`Unauthorized: requires group "` + group + `"`, {
|
|
76
77
|
extensions: {
|
|
77
|
-
code:
|
|
78
|
+
code: Auth_RefusalVocabulary$ReventlessCore.localIdentityCode
|
|
78
79
|
}
|
|
79
80
|
});
|
|
80
81
|
}
|
|
@@ -82,7 +83,7 @@ function unauthorizedError(group) {
|
|
|
82
83
|
function forbiddenError(group) {
|
|
83
84
|
return new Graphql.GraphQLError(`Forbidden: requires group "` + group + `"`, {
|
|
84
85
|
extensions: {
|
|
85
|
-
code:
|
|
86
|
+
code: Auth_RefusalVocabulary$ReventlessCore.localEntitlementCode
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// Authorization: every query AND mutation resolver registered here is
|
|
12
12
|
// wrapped with `Auth_GraphqlContext.requireGroup(~group="Admin")` so
|
|
13
13
|
// non-Admin identities are refused before the underlying resolver runs.
|
|
14
|
-
// Mirrors AppSync's `@
|
|
15
|
-
// gates Platform_* fields in the AWS adapter.
|
|
14
|
+
// Mirrors AppSync's `@aws_cognito_user_pools(cognito_groups: ["Admin"])`
|
|
15
|
+
// directive that gates Platform_* fields in the AWS adapter.
|
|
16
16
|
//
|
|
17
17
|
// The refusal names which kind it is: `FORBIDDEN` for a caller the server
|
|
18
18
|
// identified who does not hold the group, `UNAUTHORIZED` for one it could not
|