swadhinbiswas feat: implement production-grade security and fix critical vulnerabilities · 1/1/2026
0c17327
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
import BaseLayout from "./BaseLayout.astro";
const { title } = Astro.props;
const navigation = [
{ name: "Profile", href: "/settings/profile", icon: "user", color: "cyan" },
{ name: "Account", href: "/settings/account", icon: "lock", color: "purple" },
{ name: "Security", href: "/settings/security", icon: "shield", color: "orange" },
{ name: "SSH Keys", href: "/settings/ssh-keys", icon: "key", color: "green" },
{ name: "GPG Keys", href: "/settings/gpg-keys", icon: "lock", color: "pink" },
{ name: "Access Tokens", href: "/settings/tokens", icon: "ticket", color: "yellow" },
];
const icons: Record<string, string> = {
user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
lock: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",
shield: "M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",
key: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z",
ticket: "M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z",
};
const colors: Record<string, { active: string; text: string }> = {
cyan: { active: "bg-cyan-500/10 border-cyan-500/30", text: "text-cyan-400" },
purple: { active: "bg-purple-500/10 border-purple-500/30", text: "text-purple-400" },
orange: { active: "bg-orange-500/10 border-orange-500/30", text: "text-orange-400" },
green: { active: "bg-green-500/10 border-green-500/30", text: "text-green-400" },
pink: { active: "bg-pink-500/10 border-pink-500/30", text: "text-pink-400" },
yellow: { active: "bg-yellow-500/10 border-yellow-500/30", text: "text-yellow-400" },
};
const currentPath = Astro.url.pathname;
---
<BaseLayout title={title}>
<div class="container mx-auto px-4 py-8">
<div class="flex flex-col lg:flex-row gap-8">
<!-- Sidebar -->
<aside class="w-full lg:w-64 shrink-0">
<div class="relative">
<div class="absolute -inset-[1px] bg-gradient-to-b from-cyan-500/20 to-transparent rounded-xl opacity-50"></div>
<div class="relative rounded-xl border border-white/10 bg-[#0d1117]/80 backdrop-blur-sm p-4">
<h2 class="text-sm font-semibold text-gray-400 mb-4 flex items-center gap-2">
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
Settings
</h2>
<nav class="space-y-1">
{navigation.map((item) => {
const isActive = currentPath === item.href;
const colorSet = colors[item.color];
return (
<a
href={item.href}
class:list={[
"flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-lg transition-all",
isActive
? `${colorSet.active} ${colorSet.text} border`
: "text-gray-400 hover:text-white hover:bg-white/5",
]}
>
<svg class={`h-4 w-4 ${isActive ? colorSet.text : ''}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d={icons[item.icon]}></path>
</svg>
{item.name}
</a>
);
})}
</nav>
</div>
</div>
</aside>
<!-- Content -->
<div class="flex-1">
<slot />
</div>
</div>
</div>
</BaseLayout>