@seip/bluebird-js 0.0.1 → 0.1.0
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/.env_example +53 -53
- package/AGENTS.md +426 -403
- package/LICENSE +1 -1
- package/README.md +292 -285
- package/app/routes/api.js +50 -50
- package/app/routes/web.js +55 -53
- package/app/views/about.js +63 -0
- package/app/views/dashboard.js +147 -0
- package/app/views/index.js +80 -0
- package/app/views/layouts/main/view.js +81 -0
- package/app/views/legal/terms.html +19 -0
- package/app/views/login.js +80 -0
- package/core/app.d.ts +18 -18
- package/core/app.js +684 -644
- package/core/auth.d.ts +13 -13
- package/core/auth.js +326 -326
- package/core/cache.d.ts +17 -17
- package/core/cache.js +475 -475
- package/core/cli/doctor.js +287 -287
- package/core/cli/ecosystem.js +162 -162
- package/core/cli/init.js +779 -779
- package/core/cli/migrate.js +541 -541
- package/core/cli/model.js +66 -66
- package/core/cli/nginx.js +199 -199
- package/core/cli/route.js +120 -120
- package/core/cli/view.js +55 -36
- package/core/config.d.ts +3 -3
- package/core/config.js +111 -111
- package/core/csrf.d.ts +3 -3
- package/core/csrf.js +114 -114
- package/core/database.d.ts +15 -15
- package/core/database.js +636 -636
- package/core/debug.d.ts +3 -3
- package/core/debug.js +249 -249
- package/core/hash.d.ts +3 -3
- package/core/hash.js +194 -194
- package/core/html.d.ts +42 -0
- package/core/html.js +217 -0
- package/core/index.d.ts +1176 -1071
- package/core/logger.d.ts +3 -3
- package/core/logger.js +127 -124
- package/core/middleware.d.ts +3 -3
- package/core/middleware.js +28 -28
- package/core/model.d.ts +19 -19
- package/core/model.js +600 -600
- package/core/queue.d.ts +13 -13
- package/core/queue.js +172 -172
- package/core/ratelimit.d.ts +3 -3
- package/core/ratelimit.js +145 -145
- package/core/redis.d.ts +21 -21
- package/core/redis.js +230 -230
- package/core/render-cache.js +212 -0
- package/core/render.d.ts +3 -3
- package/core/render.js +199 -555
- package/core/router.d.ts +3 -3
- package/core/router.js +171 -171
- package/core/seo.d.ts +3 -3
- package/core/seo.js +106 -106
- package/core/swagger.d.ts +3 -3
- package/core/swagger.js +60 -60
- package/core/upload.d.ts +13 -13
- package/core/upload.js +102 -102
- package/core/util/colors.js +82 -82
- package/core/validate.d.ts +15 -15
- package/core/validate.js +364 -364
- package/core/view-loader.js +162 -0
- package/core/vite.d.ts +3 -3
- package/core/vite.js +145 -145
- package/core/ws.d.ts +13 -13
- package/core/ws.js +245 -245
- package/index.js +18 -18
- package/jsconfig.json +15 -15
- package/package.json +85 -86
- package/production.md +273 -273
- package/public/css/bluebird.min.css +1 -1
- package/public/js/bluebird-client.js +1780 -1662
- package/public/js/bluebird.min.js +1072 -1072
- package/app/views/about.html +0 -161
- package/app/views/dashboard.html +0 -140
- package/app/views/index.html +0 -150
- package/app/views/login.html +0 -144
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { html, script } from "@seip/bluebird-js/core/html.js";
|
|
2
|
+
|
|
3
|
+
export const layout = "main";
|
|
4
|
+
|
|
5
|
+
export const head = () => ({
|
|
6
|
+
title: "Sign In — Blue Bird Framework",
|
|
7
|
+
description: "Test native JWT authentication, encrypted cookies, and protected routes.",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Login page view module.
|
|
12
|
+
* @returns {import('@seip/bluebird-js/core/html.js').SafeHtml}
|
|
13
|
+
*/
|
|
14
|
+
export default function LoginView() {
|
|
15
|
+
return html`
|
|
16
|
+
<section class="hero">
|
|
17
|
+
<h1 class="mt-3 text-gradient font-bold">Authentication Demo</h1>
|
|
18
|
+
<p class="lead">Test native AES-256-GCM JWT auth cookies, Auth.protect middleware, and seamless View Transitions.</p>
|
|
19
|
+
</section>
|
|
20
|
+
|
|
21
|
+
<div class="mt-6">
|
|
22
|
+
<div class="alert alert-info mb-6">
|
|
23
|
+
<div>
|
|
24
|
+
<strong class="alert-title">Interactive Auth Testing</strong>
|
|
25
|
+
<p class="alert-description">
|
|
26
|
+
Submit credentials below to generate an encrypted JWT session cookie with <code>Auth.login(res, user)</code>.
|
|
27
|
+
Try visiting <strong>/dashboard</strong> directly before and after logging in to verify the <code>Auth.protect({ redirect: "/login" })</code> middleware!
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<article class="card">
|
|
33
|
+
<header class="card-header">
|
|
34
|
+
<h3 class="card-title">Sign In</h3>
|
|
35
|
+
<p class="card-description">Enter your test credentials below to start a secure session.</p>
|
|
36
|
+
</header>
|
|
37
|
+
|
|
38
|
+
<form action="/login" method="POST" id="loginForm">
|
|
39
|
+
<label for="email">Email Address</label>
|
|
40
|
+
<input type="email" id="email" name="email" value="alex@example.com" placeholder="alex@example.com" required />
|
|
41
|
+
|
|
42
|
+
<label for="password">Password</label>
|
|
43
|
+
<input type="password" id="password" name="password" value="password123" placeholder="••••••••" required />
|
|
44
|
+
|
|
45
|
+
<div class="flex items-center justify-between gap-4 mt-6">
|
|
46
|
+
<button type="submit" id="submitBtn" class="glow-blue">Sign In →</button>
|
|
47
|
+
<a href="/dashboard" role="button" class="outline">Try /dashboard (Protected)</a>
|
|
48
|
+
</div>
|
|
49
|
+
</form>
|
|
50
|
+
</article>
|
|
51
|
+
|
|
52
|
+
<article class="mt-6">
|
|
53
|
+
<header>
|
|
54
|
+
<h4 class="font-bold">What is being tested here?</h4>
|
|
55
|
+
</header>
|
|
56
|
+
<div class="grid cols-2 gap-4 mt-4">
|
|
57
|
+
<div class="card">
|
|
58
|
+
<h5 class="font-bold mb-2">1. Auth.protect Middleware</h5>
|
|
59
|
+
<p class="text-sm">When an unauthenticated client requests <code>/dashboard</code>, the server issues a 302 redirect to <code>/login</code>. The client router automatically follows the transition smoothly.</p>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="card">
|
|
62
|
+
<h5 class="font-bold mb-2">2. Encrypted JWT Cookies</h5>
|
|
63
|
+
<p class="text-sm">Session cookies are encrypted with AES-256-GCM and marked HttpOnly and SameSite=Lax to protect against token exfiltration.</p>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</article>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
const form = document.getElementById("loginForm");
|
|
71
|
+
const btn = document.getElementById("submitBtn");
|
|
72
|
+
form?.addEventListener("submit", () => {
|
|
73
|
+
if (btn) {
|
|
74
|
+
btn.textContent = "Signing In...";
|
|
75
|
+
btn.setAttribute("disabled", "true");
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
</script>
|
|
79
|
+
`;
|
|
80
|
+
}
|
package/core/app.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import App, {
|
|
2
|
-
AppError,
|
|
3
|
-
WebSocketManager,
|
|
4
|
-
AppOptions,
|
|
5
|
-
CorsOptions,
|
|
6
|
-
SecurityHeadersOptions,
|
|
7
|
-
AppStaticOptions,
|
|
8
|
-
} from "./index.js";
|
|
9
|
-
export default App;
|
|
10
|
-
export {
|
|
11
|
-
App,
|
|
12
|
-
AppError,
|
|
13
|
-
WebSocketManager,
|
|
14
|
-
AppOptions,
|
|
15
|
-
CorsOptions,
|
|
16
|
-
SecurityHeadersOptions,
|
|
17
|
-
AppStaticOptions,
|
|
18
|
-
};
|
|
1
|
+
import App, {
|
|
2
|
+
AppError,
|
|
3
|
+
WebSocketManager,
|
|
4
|
+
AppOptions,
|
|
5
|
+
CorsOptions,
|
|
6
|
+
SecurityHeadersOptions,
|
|
7
|
+
AppStaticOptions,
|
|
8
|
+
} from "./index.js";
|
|
9
|
+
export default App;
|
|
10
|
+
export {
|
|
11
|
+
App,
|
|
12
|
+
AppError,
|
|
13
|
+
WebSocketManager,
|
|
14
|
+
AppOptions,
|
|
15
|
+
CorsOptions,
|
|
16
|
+
SecurityHeadersOptions,
|
|
17
|
+
AppStaticOptions,
|
|
18
|
+
};
|