@lunora/cloudflare-access 1.0.0-alpha.2 → 1.0.0-alpha.20

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.md CHANGED
@@ -103,3 +103,129 @@ Unless required by applicable law or agreed to in writing, software distributed
103
103
  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
104
  CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
105
  specific language governing permissions and limitations under the License.
106
+
107
+ <!-- DEPENDENCIES -->
108
+ <!-- /DEPENDENCIES -->
109
+
110
+ <!-- TYPE_DEPENDENCIES -->
111
+
112
+ # Licenses of bundled types
113
+ The published @lunora/cloudflare-access artifact additionally contains code with the following licenses:
114
+ FSL-1.1-Apache-2.0
115
+
116
+ # Bundled types:
117
+ ## @lunora/server
118
+ License: FSL-1.1-Apache-2.0
119
+ By: Daniel Bannert
120
+ Repository: git+https://github.com/anolilab/lunora.git
121
+
122
+ > # Functional Source License, Version 1.1, Apache 2.0 Future License
123
+ >
124
+ > ## Abbreviation
125
+ >
126
+ > FSL-1.1-Apache-2.0
127
+ >
128
+ > ## Notice
129
+ >
130
+ > Copyright 2026 anolilab and contributors
131
+ >
132
+ > ## Terms and Conditions
133
+ >
134
+ > ### Licensor ("We")
135
+ >
136
+ > The party offering the Software under these Terms and Conditions.
137
+ >
138
+ > ### The Software
139
+ >
140
+ > The "Software" is each version of the software that we make available under
141
+ > these Terms and Conditions, as indicated by our inclusion of these Terms and
142
+ > Conditions with the Software.
143
+ >
144
+ > ### License Grant
145
+ >
146
+ > Subject to your compliance with this License Grant and the Patents,
147
+ > Redistribution and Trademark clauses below, we hereby grant you the right to
148
+ > use, copy, modify, create derivative works, publicly perform, publicly display
149
+ > and redistribute the Software for any Permitted Purpose identified below.
150
+ >
151
+ > ### Permitted Purpose
152
+ >
153
+ > A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
154
+ > means making the Software available to others in a commercial product or service
155
+ > that:
156
+ >
157
+ > 1. substitutes for the Software;
158
+ >
159
+ > 2. substitutes for any other product or service we offer using the Software that
160
+ > exists as of the date we make the Software available; or
161
+ >
162
+ > 3. offers the same or substantially similar functionality as the Software.
163
+ >
164
+ > Permitted Purposes specifically include using the Software:
165
+ >
166
+ > 1. for your internal use and access;
167
+ >
168
+ > 2. for non-commercial education;
169
+ >
170
+ > 3. for non-commercial research; and
171
+ >
172
+ > 4. in connection with professional services that you provide to a licensee using
173
+ > the Software in accordance with these Terms and Conditions.
174
+ >
175
+ > ### Patents
176
+ >
177
+ > To the extent your use for a Permitted Purpose would necessarily infringe our
178
+ > patents, the license grant above includes a license under our patents. If you
179
+ > make a claim against any party that the Software infringes or contributes to the
180
+ > infringement of any patent, then your patent license to the Software ends
181
+ > immediately.
182
+ >
183
+ > ### Redistribution
184
+ >
185
+ > The Terms and Conditions apply to all copies, modifications and derivatives of
186
+ > the Software.
187
+ >
188
+ > If you redistribute any copies, modifications or derivatives of the Software,
189
+ > you must include a copy of or a link to these Terms and Conditions and not
190
+ > remove any copyright notices provided in or with the Software.
191
+ >
192
+ > ### Disclaimer
193
+ >
194
+ > THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
195
+ > IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
196
+ > PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
197
+ >
198
+ > IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
199
+ > SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
200
+ > IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
201
+ >
202
+ > ### Trademarks
203
+ >
204
+ > Except for displaying the License Details and identifying us as the origin of
205
+ > the Software, you have no right under these Terms and Conditions to use our
206
+ > trademarks, trade names, service marks or product names.
207
+ >
208
+ > ## Grant of Future License
209
+ >
210
+ > We hereby irrevocably grant you an additional license to use the Software under
211
+ > the Apache License, Version 2.0 that is effective on the second anniversary of
212
+ > the date we make the Software available. On or after that date, you may use the
213
+ > Software under the Apache License, Version 2.0, in which case the following will
214
+ > apply:
215
+ >
216
+ > Licensed under the Apache License, Version 2.0 (the "License"); you may not use
217
+ > this file except in compliance with the License.
218
+ >
219
+ > You may obtain a copy of the License at
220
+ >
221
+ > http://www.apache.org/licenses/LICENSE-2.0
222
+ >
223
+ > Unless required by applicable law or agreed to in writing, software distributed
224
+ > under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
225
+ > CONDITIONS OF ANY KIND, either express or implied. See the License for the
226
+ > specific language governing permissions and limitations under the License.
227
+ >
228
+ > <!-- DEPENDENCIES -->
229
+ > <!-- /DEPENDENCIES -->
230
+
231
+ <!-- /TYPE_DEPENDENCIES -->
package/dist/admin.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { verifyRequest } from './packem_shared/accessIssuer-DhKaNoyU.mjs';
1
+ import { verifyRequest } from './packem_shared/accessIssuer-83KYwaCp.mjs';
2
2
 
3
3
  const accessAdminGate = (options) => async (request) => {
4
4
  const claims = await verifyRequest(request, options);
@@ -1,5 +1,6 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.mjs";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.mjs";
2
2
  import { A as AccessClaims } from "./packem_shared/types.d-BO8d74KI.mjs";
3
+ import '@lunora/errors';
3
4
  import 'jose';
4
5
  /**
5
6
  * The slice of context {@link accessContext} reads: the `auth` facade every
package/dist/context.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.js";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.js";
2
2
  import { A as AccessClaims } from "./packem_shared/types.d-BO8d74KI.js";
3
+ import '@lunora/errors';
3
4
  import 'jose';
4
5
  /**
5
6
  * The slice of context {@link accessContext} reads: the `auth` facade every
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { composeResolvers, createAccessResolver } from './packem_shared/composeResolvers-C_7T5dDj.mjs';
2
- export { accessIssuer, verifyAccessJwt } from './packem_shared/accessIssuer-DhKaNoyU.mjs';
1
+ export { composeResolvers, createAccessResolver } from './packem_shared/composeResolvers-BI3envaN.mjs';
2
+ export { accessIssuer, verifyAccessJwt } from './packem_shared/accessIssuer-83KYwaCp.mjs';
@@ -1,3 +1,4 @@
1
+ import { LunoraError } from '@lunora/errors';
1
2
  import { jwtVerify, createRemoteJWKSet } from 'jose';
2
3
 
3
4
  const DEFAULT_HEADER = "cf-access-jwt-assertion";
@@ -36,7 +37,7 @@ const stripTrailingSlashes = (value) => {
36
37
  const accessIssuer = (teamDomain) => {
37
38
  const trimmed = stripTrailingSlashes(teamDomain.trim().replace(SCHEME_PREFIX, ""));
38
39
  if (trimmed.length === 0) {
39
- throw new Error('@lunora/cloudflare-access: `teamDomain` is required (e.g. "acme" or "acme.cloudflareaccess.com")');
40
+ throw new LunoraError("INTERNAL", '@lunora/cloudflare-access: `teamDomain` is required (e.g. "acme" or "acme.cloudflareaccess.com")');
40
41
  }
41
42
  const candidate = trimmed.includes(".") ? `https://${trimmed}` : `https://${trimmed}.cloudflareaccess.com`;
42
43
  const host = new URL(candidate).host.toLowerCase();
@@ -57,7 +58,8 @@ const verifyAccessJwt = async (token, options) => {
57
58
  (entry) => typeof entry === "string" && entry.length > 0
58
59
  );
59
60
  if (audiences.length === 0) {
60
- throw new Error(
61
+ throw new LunoraError(
62
+ "INTERNAL",
61
63
  "@lunora/cloudflare-access: `aud` is required and must be a non-empty Access AUD tag — refusing to verify a token without an audience to scope it to your application"
62
64
  );
63
65
  }
@@ -1,4 +1,4 @@
1
- import { verifyRequest } from './accessIssuer-DhKaNoyU.mjs';
1
+ import { verifyRequest } from './accessIssuer-83KYwaCp.mjs';
2
2
 
3
3
  const ANONYMOUS = null;
4
4
  const deriveUserId = (claims) => {
@@ -1,3 +1,4 @@
1
+ import '@lunora/errors';
1
2
  /**
2
3
  * `next()` advances the middleware chain. Called with no argument it forwards
3
4
  * the current context unchanged; called with `{ ctx }` it shallow-merges the
@@ -1,3 +1,4 @@
1
+ import '@lunora/errors';
1
2
  /**
2
3
  * `next()` advances the middleware chain. Called with no argument it forwards
3
4
  * the current context unchanged; called with `{ ctx }` it shallow-merges the
package/dist/roles.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.mjs";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.mjs";
2
+ import '@lunora/errors';
2
3
  /**
3
4
  * The slice of context {@link accessRoles} reads and augments: the `auth` facade
4
5
  * every Lunora ctx carries. `getIdentity()` returns the verified identity
package/dist/roles.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.js";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.js";
2
+ import '@lunora/errors';
2
3
  /**
3
4
  * The slice of context {@link accessRoles} reads and augments: the `auth` facade
4
5
  * every Lunora ctx carries. `getIdentity()` returns the verified identity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/cloudflare-access",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.20",
4
4
  "description": "Cloudflare Access (Zero Trust) identity for Lunora — verify the Cf-Access-Jwt-Assertion JWT against your team JWKS and feed the verified identity into ctx.auth / RLS via a resolveIdentity adapter",
5
5
  "keywords": [
6
6
  "access",
@@ -54,10 +54,11 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "jose": "^6.1.0"
57
+ "@lunora/errors": "1.0.0-alpha.3",
58
+ "jose": "^6.2.3"
58
59
  },
59
60
  "peerDependencies": {
60
- "@lunora/server": "1.0.0-alpha.8"
61
+ "@lunora/server": "1.0.0-alpha.22"
61
62
  },
62
63
  "peerDependenciesMeta": {
63
64
  "@lunora/server": {