@jjlmoya/utils-developer 1.16.0 → 1.18.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.
Files changed (63) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +3 -1
  3. package/src/entries.ts +7 -1
  4. package/src/index.ts +4 -0
  5. package/src/tests/locale_completeness.test.ts +2 -2
  6. package/src/tests/tool_validation.test.ts +2 -2
  7. package/src/tool/calculadoraTiempoDatos/data-time-calculator-web-speed-impact.css +498 -499
  8. package/src/tool/jwtDecoder/bibliography.astro +14 -0
  9. package/src/tool/jwtDecoder/bibliography.ts +12 -0
  10. package/src/tool/jwtDecoder/component.astro +209 -0
  11. package/src/tool/jwtDecoder/entry.ts +30 -0
  12. package/src/tool/jwtDecoder/i18n/de.ts +248 -0
  13. package/src/tool/jwtDecoder/i18n/en.ts +247 -0
  14. package/src/tool/jwtDecoder/i18n/es.ts +248 -0
  15. package/src/tool/jwtDecoder/i18n/fr.ts +248 -0
  16. package/src/tool/jwtDecoder/i18n/id.ts +248 -0
  17. package/src/tool/jwtDecoder/i18n/it.ts +248 -0
  18. package/src/tool/jwtDecoder/i18n/ja.ts +248 -0
  19. package/src/tool/jwtDecoder/i18n/ko.ts +248 -0
  20. package/src/tool/jwtDecoder/i18n/nl.ts +247 -0
  21. package/src/tool/jwtDecoder/i18n/pl.ts +247 -0
  22. package/src/tool/jwtDecoder/i18n/pt.ts +247 -0
  23. package/src/tool/jwtDecoder/i18n/ru.ts +248 -0
  24. package/src/tool/jwtDecoder/i18n/sv.ts +248 -0
  25. package/src/tool/jwtDecoder/i18n/tr.ts +248 -0
  26. package/src/tool/jwtDecoder/i18n/zh.ts +248 -0
  27. package/src/tool/jwtDecoder/index.ts +11 -0
  28. package/src/tool/jwtDecoder/jwt-decoder-parser-and-claims-inspector.css +358 -0
  29. package/src/tool/jwtDecoder/logic.ts +96 -0
  30. package/src/tool/jwtDecoder/seo.astro +15 -0
  31. package/src/tool/jwtDecoder/ui.ts +38 -0
  32. package/src/tool/serpPixelSimulator/bibliography.astro +11 -4
  33. package/src/tool/serpPixelSimulator/index.ts +0 -4
  34. package/src/tool/serpPixelSimulator/seo.astro +8 -5
  35. package/src/tool/visualCssGridFlexboxGenerator/bibliography.astro +14 -0
  36. package/src/tool/visualCssGridFlexboxGenerator/bibliography.ts +20 -0
  37. package/src/tool/visualCssGridFlexboxGenerator/canvas.ts +103 -0
  38. package/src/tool/visualCssGridFlexboxGenerator/component.astro +218 -0
  39. package/src/tool/visualCssGridFlexboxGenerator/entry.ts +30 -0
  40. package/src/tool/visualCssGridFlexboxGenerator/i18n/de.ts +110 -0
  41. package/src/tool/visualCssGridFlexboxGenerator/i18n/en.ts +256 -0
  42. package/src/tool/visualCssGridFlexboxGenerator/i18n/es.ts +110 -0
  43. package/src/tool/visualCssGridFlexboxGenerator/i18n/fr.ts +110 -0
  44. package/src/tool/visualCssGridFlexboxGenerator/i18n/id.ts +110 -0
  45. package/src/tool/visualCssGridFlexboxGenerator/i18n/it.ts +110 -0
  46. package/src/tool/visualCssGridFlexboxGenerator/i18n/ja.ts +110 -0
  47. package/src/tool/visualCssGridFlexboxGenerator/i18n/ko.ts +110 -0
  48. package/src/tool/visualCssGridFlexboxGenerator/i18n/nl.ts +110 -0
  49. package/src/tool/visualCssGridFlexboxGenerator/i18n/pl.ts +110 -0
  50. package/src/tool/visualCssGridFlexboxGenerator/i18n/pt.ts +110 -0
  51. package/src/tool/visualCssGridFlexboxGenerator/i18n/ru.ts +110 -0
  52. package/src/tool/visualCssGridFlexboxGenerator/i18n/sv.ts +110 -0
  53. package/src/tool/visualCssGridFlexboxGenerator/i18n/tr.ts +110 -0
  54. package/src/tool/visualCssGridFlexboxGenerator/i18n/zh.ts +110 -0
  55. package/src/tool/visualCssGridFlexboxGenerator/index.ts +11 -0
  56. package/src/tool/visualCssGridFlexboxGenerator/interactions.ts +45 -0
  57. package/src/tool/visualCssGridFlexboxGenerator/logic.ts +49 -0
  58. package/src/tool/visualCssGridFlexboxGenerator/presets.ts +63 -0
  59. package/src/tool/visualCssGridFlexboxGenerator/seo.astro +15 -0
  60. package/src/tool/visualCssGridFlexboxGenerator/ui.ts +58 -0
  61. package/src/tool/visualCssGridFlexboxGenerator/visual-css-grid-flexbox-generator.css +816 -0
  62. package/src/tool/visualCssGridFlexboxGenerator/workspace.ts +192 -0
  63. package/src/tools.ts +3 -1
@@ -0,0 +1,248 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { JwtDecoderUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
5
+
6
+ const slug = 'jwt-cozucu-ayristirici-ve-claims-denetleyicisi';
7
+ const title = 'JWT Cozucu, Ayrıstırıcı ve Claims Denetleyicisi';
8
+ const description = 'Bir JSON Web Token yapıstırın, header ve payload kısmını anında cozun, kayıtlı claimsleri inceleyin, suresi dolmus tokenleri tespit edin ve kimlik dogrulama akıslarında hata ayıklamak icin temiz JSON kopyalayın.';
9
+
10
+ const howTo = [
11
+ {
12
+ name: 'JWTyi yapıstırın',
13
+ text: 'Authorization header, cookie, log kaydı veya kimlik saglayıcıdan bir token kopyalayın ve giris alanına yapıstırın.',
14
+ },
15
+ {
16
+ name: 'Cozulmus header ve payloadı okuyun',
17
+ text: 'Arac tokeni header, payload ve imza olarak ayırır, ardından hızlı inceleme icin JSON segmentlerini ayrı panellerde gosterir.',
18
+ },
19
+ {
20
+ name: 'Onemli claimsleri kontrol edin',
21
+ text: 'Unix zaman damgalarını manuel olarak donusturmeden algoritma, yayıncı, hedef kitle, konu, yayınlanma zamanı, gecerlilik baslangıcı ve sona erme suresini gozden gecirin.',
22
+ },
23
+ {
24
+ name: 'Ihtiyacınız olan veriyi kopyalayın',
25
+ text: 'Ekibinizle temizlenmis bir hata ayıklama anlık goruntusu paylasmanız gerektiginde bir cozulmus bolumu veya tum cozulmus cıktıyı kopyalayın.',
26
+ },
27
+ ];
28
+
29
+ const faq = [
30
+ {
31
+ question: 'JWTnin cozulmesi tokenin gecerli oldugunu kanıtlar mı?',
32
+ answer: 'Hayır. Cozme islemi yalnızca base64url ile kodlanmıs header ve payloadı ortaya cıkarır. Bir token ancak imza, yayıncı, hedef kitle, sona erme suresi ve ilgili claimsler uygulama veya kimlik saglayıcı tarafından dogrulandıktan sonra guvenilirdir.',
33
+ },
34
+ {
35
+ question: 'Bu JWT cozucuyu access tokenler ve ID tokenler icin kullanabilir miyim?',
36
+ answer: 'Evet. Cozucu, standart uc parcalı JWT formatını kullandıkları surece OAuth access tokenleri, OpenID Connect ID tokenleri, oturum tokenleri ve servisler arası tokenleri incelemek icin kullanıslıdır.',
37
+ },
38
+ {
39
+ question: 'Imza paneli tokeni neden dogrulamıyor?',
40
+ answer: 'JWT dogrulaması dogru gizli anahtar, acık anahtar veya JWKS yapılandırması gerektirir. Bu arac kasıtlı olarak cozme ve incelemeye odaklanır, boylece gelistiriciler gorunur bir imza dizisinin gecerlilik kanıtıymıs gibi gostermeden token icerigini gorebilir.',
41
+ },
42
+ {
43
+ question: 'Bir JWTde hata ayıklarken ilk olarak neyi kontrol etmeliyim?',
44
+ answer: 'exp, nbf, iss, aud ve alg ile baslayın. Gercek uretim sorunlarının cogu suresi dolmus tokenlerden, saat kaymasından, yanlıs hedef kitle degerlerinden, beklenmedik yayıncı URLlerinden veya guvensiz algoritma varsayımlarından kaynaklanır.',
45
+ },
46
+ ];
47
+
48
+ const ui: JwtDecoderUI = {
49
+ tokenLabel: 'JWT tokeni',
50
+ tokenPlaceholder: 'Buraya bir JWT yapıstırın: header.payload.imza',
51
+ sampleButton: 'Ornek yukle',
52
+ clearButton: 'Temizle',
53
+ statusWaiting: 'JSON header, payload ve claims icerigini cozmek icin bir token yapıstırın.',
54
+ statusValid: 'JWT basarıyla cozuldu.',
55
+ statusInvalid: 'Bu gecerli uc parcalı bir JWT gibi gorunmuyor.',
56
+ statusExpired: 'JWT cozuldu, ancak exp claim suresi dolmus.',
57
+ statusUnsigned: 'JWT cozuldu, ancak imzasız veya none algoritması kullanıyor.',
58
+ headerTitle: 'Header',
59
+ payloadTitle: 'Payload',
60
+ signatureTitle: 'Imza',
61
+ claimsTitle: 'Kayıtlı claimsler',
62
+ copyHeader: 'Cozulmus headeri kopyala',
63
+ copyPayload: 'Cozulmus payloadı kopyala',
64
+ copySignature: 'Imzayı kopyala',
65
+ copyAll: 'Tumunu kopyala',
66
+ copiedLabel: 'Kopyalandı',
67
+ invalidTokenTitle: 'Gecersiz JWT',
68
+ invalidTokenBody: 'Tokenin nokta ile ayrılmıs uc base64url segmenti oldugunu kontrol edin.',
69
+ invalidSegmentError: 'Tokenin nokta ile ayrılmıs uc base64url segmenti oldugunu kontrol edin.',
70
+ invalidDecodeError: 'Header veya payload gecerli JSON olarak cozulemedi.',
71
+ emptyJson: '{}',
72
+ signaturePresent: 'Imza segmenti mevcut; dogru anahtarla kimlik dogrulama katmanınızda dogrulayın.',
73
+ signatureMissing: 'Imza segmenti yok',
74
+ algorithmLabel: 'Algoritma',
75
+ typeLabel: 'Tur',
76
+ issuerLabel: 'Yayıncı',
77
+ subjectLabel: 'Konu',
78
+ audienceLabel: 'Hedef kitle',
79
+ issuedAtLabel: 'Yayınlanma',
80
+ notBeforeLabel: 'Gecerlilik baslangıcı',
81
+ expiresAtLabel: 'Sona erme',
82
+ claimMissing: 'Mevcut degil',
83
+ privacyNote: 'Cozme islemi tarayıcı oturumunuzda calısır. Guvenlik politikanız izin vermedikce uretim sırlarını hicbir araca yapıstırmayın.',
84
+ sampleToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJnYW1lYm9iLXVzZXItNDIiLCJuYW1lIjoiR2FtZUJvYiBEZXZlbG9wZXIiLCJpc3MiOiJodHRwczovL3d3dy5nYW1lYm9iLmRldiIsImF1ZCI6ImRldmVsb3Blci10b29scyIsImlhdCI6MTcxNzIwMDAwMCwibmJmIjoxNzE3MjAwMDAwLCJleHAiOjE4OTM0NTYwMDAsInJvbGUiOiJhZG1pbiJ9.demo-signature',
85
+ };
86
+
87
+ const faqSchema: WithContext<FAQPage> = {
88
+ '@context': 'https://schema.org',
89
+ '@type': 'FAQPage',
90
+ mainEntity: faq.map((item) => ({
91
+ '@type': 'Question',
92
+ name: item.question,
93
+ acceptedAnswer: {
94
+ '@type': 'Answer',
95
+ text: item.answer,
96
+ },
97
+ })),
98
+ };
99
+
100
+ const howToSchema: WithContext<HowTo> = {
101
+ '@context': 'https://schema.org',
102
+ '@type': 'HowTo',
103
+ name: title,
104
+ description,
105
+ step: howTo.map((step, index) => ({
106
+ '@type': 'HowToStep',
107
+ position: index + 1,
108
+ name: step.name,
109
+ text: step.text,
110
+ })),
111
+ };
112
+
113
+ const appSchema: WithContext<SoftwareApplication> = {
114
+ '@context': 'https://schema.org',
115
+ '@type': 'SoftwareApplication',
116
+ name: title,
117
+ description,
118
+ applicationCategory: 'DeveloperApplication',
119
+ operatingSystem: 'Any',
120
+ offers: {
121
+ '@type': 'Offer',
122
+ price: '0',
123
+ priceCurrency: 'EUR',
124
+ },
125
+ inLanguage: 'tr',
126
+ };
127
+
128
+ export const content: ToolLocaleContent<JwtDecoderUI> = {
129
+ slug,
130
+ title,
131
+ description,
132
+ ui,
133
+ faqTitle: 'JWT cozucu SSS',
134
+ faq,
135
+ bibliographyTitle: 'JWT spesifikasyonları ve guvenlik referansları',
136
+ bibliography,
137
+ howTo,
138
+ schemas: [appSchema, faqSchema, howToSchema],
139
+ seo: [
140
+ {
141
+ type: 'title',
142
+ text: 'JWTleri guvenlik baglamını kaybetmeden cozun',
143
+ level: 2,
144
+ },
145
+ {
146
+ type: 'paragraph',
147
+ html: 'Bir JSON Web Token kucuk gorunur, ancak cogu zaman bir kimlik dogrulama hatasını acıklayan tam ayrıntıyı tasır: imza algoritması, yayıncı, hedef kitle, konu, yayınlanma zamanı, gecerlilik baslangıc zamanı, sona erme suresi ve uygulamaya ozel yetkilendirme claimsleri. Bu <strong>JWT cozucu, ayrıstırıcı ve claims denetleyicisi</strong>, uc token segmentini okunabilir JSONa donusturerek kimlik dogrulama akıslarında daha hızlı hata ayıklamanıza olanak tanır.',
148
+ },
149
+ {
150
+ type: 'diagnostic',
151
+ variant: 'warning',
152
+ title: 'Cozulmus olması guvenilir oldugu anlamına gelmez',
153
+ html: 'Herkes bir JWTyi base64url olarak cozebilir. Guven, yalnızca uygulamanız imzayı dogru gizli anahtar, acık anahtar veya JWKS ile dogruladıktan ve ardından yayıncı, hedef kitle, sona erme suresi ve alana ozgu claimsleri onayladıktan sonra baslar. Bu aracı verileri incelemek icin kullanın, bir tokeni gercek olarak kabul etmek icin degil.',
154
+ },
155
+ {
156
+ type: 'title',
157
+ text: 'Her JWT segmentinin size soyledikleri',
158
+ level: 3,
159
+ },
160
+ {
161
+ type: 'table',
162
+ headers: ['Segment', 'Tipik icerik', 'Hata ayıklama degeri'],
163
+ rows: [
164
+ ['Header', 'Algoritma, token turu ve istege baglı anahtar kimligi', 'Tokenin HS256, RS256, ES256 veya baska bir dogrulama stratejisi bekleyip beklemedigini gosterir.'],
165
+ ['Payload', 'Kayıtlı claimsler ve uygulama claimsleri', 'Kimlik, kiracı, kapsamlar, roller, sona erme suresi ve hedef kitle uyusmazlıklarını ortaya cıkarır.'],
166
+ ['Imza', 'Base64url olarak kodlanmıs kriptografik imza baytları', 'Bir imza segmentinin var oldugunu onaylar, ancak baska bir yerde dogru anahtarla dogrulanmalıdır.'],
167
+ ],
168
+ },
169
+ {
170
+ type: 'title',
171
+ text: 'Genellikle bozuk kimlik dogrulamayı acıklayan claimsler',
172
+ level: 3,
173
+ },
174
+ {
175
+ type: 'list',
176
+ items: [
177
+ '<strong>exp:</strong> tokenin suresi dolduysa, yenileme mantıgı veya saat ayarları yanlıs olabilir.',
178
+ '<strong>nbf:</strong> token henuz aktif degilse, sunucu ve kimlik saglayıcı saatleri senkronize olmayabilir.',
179
+ '<strong>iss:</strong> yayıncı URLsi yapılandırmadan farklıysa, token yanlıs kiracıdan veya ortamdan gelebilir.',
180
+ '<strong>aud:</strong> hedef kitle API tanımlayıcısıyla eslesmiyorsa, token baska bir kaynak icin olusturulmustur.',
181
+ '<strong>alg:</strong> algoritma beklenmedikse, dogrulayıcınız tokeni reddedebilir veya tehlikeli bir yapılandırma hatasını acıga cıkarabilir.',
182
+ ],
183
+ },
184
+ {
185
+ type: 'title',
186
+ text: 'Gelistirme sırasında JWT ayrıstırıcı kullanım senaryoları',
187
+ level: 3,
188
+ },
189
+ {
190
+ type: 'comparative',
191
+ columns: 3,
192
+ items: [
193
+ {
194
+ title: 'On yuz hata ayıklama',
195
+ description: 'Kapsamları, rolleri ve profil claimslerini dogrulamak icin oturum acıldıktan sonra alınan ID tokenleri ve access tokenleri inceleyin.',
196
+ icon: 'mdi:monitor-dashboard',
197
+ points: ['Profil claimslerini kontrol edin', 'Kapsamları ve rolleri dogrulayın', 'Oturum acma ortamlarını karsılastırın'],
198
+ },
199
+ {
200
+ title: 'Arka uc API QA',
201
+ description: 'Beklenen yayıncı ve hedef kitle degerlerini, Authorization headerda gercekte gonderilen token ile karsılastırın.',
202
+ icon: 'mdi:api',
203
+ highlight: true,
204
+ points: ['Hedef kitle yapısını dogrulayın', 'Yayıncı uyusmazlıklarını tespit edin', 'Bearer tokenleri inceleyin'],
205
+ },
206
+ {
207
+ title: 'Kimlik saglayıcı kurulumu',
208
+ description: 'Auth0, Azure AD, Cognito, Keycloak veya ozel bir saglayıcıdan gelen claimslerin uygulamanızın bekledigi sekilde yapılandırılıp yapılandırılmadıgını kontrol edin.',
209
+ icon: 'mdi:account-key',
210
+ points: ['Kiracı verilerini gozden gecirin', 'Ozel claimsleri kontrol edin', 'Saglayıcı eslestirmelerini karsılastırın'],
211
+ },
212
+ ],
213
+ },
214
+ {
215
+ type: 'title',
216
+ text: 'Bu denetleyicinin belirgin hale getirdigi yaygın JWT hataları',
217
+ level: 3,
218
+ },
219
+ {
220
+ type: 'proscons',
221
+ title: 'Hızlı kontroller ve guven kararları',
222
+ items: [
223
+ {
224
+ pro: 'Hatalı tokenleri hemen gorun.',
225
+ con: 'Beklenen hedef kitlenizi veya yayıncınızı bilemez.',
226
+ },
227
+ {
228
+ pro: 'Unix zaman damgası claimslerini okunabilir tarihlere donusturun.',
229
+ con: 'Gercek anahtar materyali olmadan bir imzayı dogrulayamaz.',
230
+ },
231
+ {
232
+ pro: 'Eksik yayıncı, hedef kitle, konu veya tur degerlerini tespit edin.',
233
+ con: 'Kapsamların ve rollerin uygulamanız icin guvenli oldugunu kanıtlayamaz.',
234
+ },
235
+ ],
236
+ },
237
+ {
238
+ type: 'summary',
239
+ title: 'En iyi uygulama is akısı',
240
+ items: [
241
+ 'Istemcinin veya API\'nin gercekte ne aldıgını anlamak icin tokeni cozun.',
242
+ 'Uygulama mantıgına dalmadan once exp, nbf, iss, aud, sub ve algyi kontrol edin.',
243
+ 'Imzaları ve guven kararlarını yalnızca kimlik dogrulama katmanınızda dogrulayın.',
244
+ 'Hassas uretim JWTlerini biletlerde, loglarda veya ekran goruntulerinde paylasmaktan kacının.',
245
+ ],
246
+ },
247
+ ],
248
+ };
@@ -0,0 +1,248 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { JwtDecoderUI } from '../ui';
4
+ import { bibliography } from '../bibliography';
5
+
6
+ const slug = 'jwt-decoder-parser-and-claims-inspector';
7
+ const title = 'JWT Decoder, Parser and Claims Inspector';
8
+ const description = '粘贴 JSON Web Token,即时解码其头部和载荷,检查注册声明,发现过期令牌,并复制干净的 JSON 以调试认证流程。';
9
+
10
+ const howTo = [
11
+ {
12
+ name: '粘贴 JWT',
13
+ text: '从 Authorization 头、Cookie、日志条目或身份提供商复制令牌,并将其粘贴到输入字段中。',
14
+ },
15
+ {
16
+ name: '读取解码后的头部和载荷',
17
+ text: '该工具将令牌拆分为头部、载荷和签名,然后在单独的面板中渲染 JSON 段以供快速检查。',
18
+ },
19
+ {
20
+ name: '检查重要声明',
21
+ text: '查看算法、签发者、受众、主题、签发时间、生效时间和过期时间,无需手动转换 Unix 时间戳。',
22
+ },
23
+ {
24
+ name: '复制所需数据',
25
+ text: '当需要与团队共享经过清理的调试快照时,复制一个解码后的部分或完整的解码输出。',
26
+ },
27
+ ];
28
+
29
+ const faq = [
30
+ {
31
+ question: '解码 JWT 是否能证明令牌有效?',
32
+ answer: '不能。解码仅揭示经过 base64url 编码的头部和载荷。只有在应用程序或身份提供商验证了签名、签发者、受众、过期时间和相关声明后,令牌才是可信的。',
33
+ },
34
+ {
35
+ question: '我可以将此 JWT 解码器用于访问令牌和 ID 令牌吗?',
36
+ answer: '可以。只要使用标准的三部分 JWT 格式,该解码器可用于检查 OAuth 访问令牌、OpenID Connect ID 令牌、会话令牌和服务间令牌。',
37
+ },
38
+ {
39
+ question: '为什么签名面板不验证令牌?',
40
+ answer: 'JWT 验证需要正确的密钥、公钥或 JWKS 配置。该工具有意专注于解码和检查,以便开发人员可以查看令牌内容,而不会假装可见的签名字符串就是有效性的证明。',
41
+ },
42
+ {
43
+ question: '调试 JWT 时应首先检查什么?',
44
+ answer: '从 exp、nbf、iss、aud 和 alg 开始。大多数实际生产问题源于过期令牌、时钟偏差、错误的受众值、意外的签发者 URL 或不安全的算法假设。',
45
+ },
46
+ ];
47
+
48
+ const ui: JwtDecoderUI = {
49
+ tokenLabel: 'JWT 令牌',
50
+ tokenPlaceholder: '在此粘贴 JWT: header.payload.signature',
51
+ sampleButton: '加载示例',
52
+ clearButton: '清除',
53
+ statusWaiting: '粘贴令牌以解码其 JSON 头部、载荷和声明。',
54
+ statusValid: 'JWT 解码成功。',
55
+ statusInvalid: '这看起来不像是有效的三部分 JWT。',
56
+ statusExpired: 'JWT 已解码,但 exp 声明已过期。',
57
+ statusUnsigned: 'JWT 已解码,但未签名或使用了 alg none。',
58
+ headerTitle: '头部',
59
+ payloadTitle: '载荷',
60
+ signatureTitle: '签名',
61
+ claimsTitle: '注册声明',
62
+ copyHeader: '复制解码后的头部',
63
+ copyPayload: '复制解码后的载荷',
64
+ copySignature: '复制签名',
65
+ copyAll: '复制全部',
66
+ copiedLabel: '已复制',
67
+ invalidTokenTitle: '无效的 JWT',
68
+ invalidTokenBody: '请检查令牌是否具有三个由点分隔的 base64url 段。',
69
+ invalidSegmentError: '请检查令牌是否具有三个由点分隔的 base64url 段。',
70
+ invalidDecodeError: '无法将头部或载荷解码为有效的 JSON。',
71
+ emptyJson: '{}',
72
+ signaturePresent: '签名段存在;请在您的认证层中使用正确的密钥进行验证。',
73
+ signatureMissing: '无签名段',
74
+ algorithmLabel: '算法',
75
+ typeLabel: '类型',
76
+ issuerLabel: '签发者',
77
+ subjectLabel: '主题',
78
+ audienceLabel: '受众',
79
+ issuedAtLabel: '签发时间',
80
+ notBeforeLabel: '生效时间',
81
+ expiresAtLabel: '过期时间',
82
+ claimMissing: '不存在',
83
+ privacyNote: '解码在您的浏览器会话中运行。除非安全策略允许,否则不要将生产密钥粘贴到任何工具中。',
84
+ sampleToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJnYW1lYm9iLXVzZXItNDIiLCJuYW1lIjoiR2FtZUJvYiBEZXZlbG9wZXIiLCJpc3MiOiJodHRwczovL3d3dy5nYW1lYm9iLmRldiIsImF1ZCI6ImRldmVsb3Blci10b29scyIsImlhdCI6MTcxNzIwMDAwMCwibmJmIjoxNzE3MjAwMDAwLCJleHAiOjE4OTM0NTYwMDAsInJvbGUiOiJhZG1pbiJ9.demo-signature',
85
+ };
86
+
87
+ const faqSchema: WithContext<FAQPage> = {
88
+ '@context': 'https://schema.org',
89
+ '@type': 'FAQPage',
90
+ mainEntity: faq.map((item) => ({
91
+ '@type': 'Question',
92
+ name: item.question,
93
+ acceptedAnswer: {
94
+ '@type': 'Answer',
95
+ text: item.answer,
96
+ },
97
+ })),
98
+ };
99
+
100
+ const howToSchema: WithContext<HowTo> = {
101
+ '@context': 'https://schema.org',
102
+ '@type': 'HowTo',
103
+ name: title,
104
+ description,
105
+ step: howTo.map((step, index) => ({
106
+ '@type': 'HowToStep',
107
+ position: index + 1,
108
+ name: step.name,
109
+ text: step.text,
110
+ })),
111
+ };
112
+
113
+ const appSchema: WithContext<SoftwareApplication> = {
114
+ '@context': 'https://schema.org',
115
+ '@type': 'SoftwareApplication',
116
+ name: title,
117
+ description,
118
+ applicationCategory: 'DeveloperApplication',
119
+ operatingSystem: 'Any',
120
+ offers: {
121
+ '@type': 'Offer',
122
+ price: '0',
123
+ priceCurrency: 'EUR',
124
+ },
125
+ inLanguage: 'zh',
126
+ };
127
+
128
+ export const content: ToolLocaleContent<JwtDecoderUI> = {
129
+ slug,
130
+ title,
131
+ description,
132
+ ui,
133
+ faqTitle: 'JWT 解码器常见问题',
134
+ faq,
135
+ bibliographyTitle: 'JWT 规范和安全参考',
136
+ bibliography,
137
+ howTo,
138
+ schemas: [appSchema, faqSchema, howToSchema],
139
+ seo: [
140
+ {
141
+ type: 'title',
142
+ text: '在不丢失安全上下文的情况下解码 JWT',
143
+ level: 2,
144
+ },
145
+ {
146
+ type: 'paragraph',
147
+ html: 'JSON Web Token 看似简洁,但通常包含解释认证失败的确切细节:签名算法、签发者、受众、主题、签发时间、生效时间、过期时间以及应用程序特定的授权声明。该 <strong>JWT 解码器、解析器和声明检查器</strong>将三个令牌段转换为可读的 JSON,以便您更快地调试认证流程。',
148
+ },
149
+ {
150
+ type: 'diagnostic',
151
+ variant: 'warning',
152
+ title: '已解码不等于可信',
153
+ html: '任何人都可以对 JWT 进行 base64url 解码。只有在您的应用程序使用正确的密钥、公钥或 JWKS 验证签名,然后验证签发者、受众、过期时间和任何领域特定声明之后,信任才开始。使用此工具检查数据,而不是将其作为令牌真实的证明。',
154
+ },
155
+ {
156
+ type: 'title',
157
+ text: '每个 JWT 段告诉您的信息',
158
+ level: 3,
159
+ },
160
+ {
161
+ type: 'table',
162
+ headers: ['段', '典型内容', '调试价值'],
163
+ rows: [
164
+ ['头部', '算法、令牌类型和可选的密钥 ID', '显示令牌期望 HS256、RS256、ES256 还是其他验证策略。'],
165
+ ['载荷', '注册声明和应用程序声明', '揭示身份、租户、范围、角色、过期和受众不匹配。'],
166
+ ['签名', '以 base64url 编码的加密签名字节', '确认签名段存在,但必须在其他地方用正确的密钥进行验证。'],
167
+ ],
168
+ },
169
+ {
170
+ type: 'title',
171
+ text: '通常能解释认证失败的声明',
172
+ level: 3,
173
+ },
174
+ {
175
+ type: 'list',
176
+ items: [
177
+ '<strong>exp:</strong> 如果令牌已过期,刷新逻辑或时钟设置可能有误。',
178
+ '<strong>nbf:</strong> 如果令牌尚未生效,服务器和身份提供商的时钟可能不同步。',
179
+ '<strong>iss:</strong> 如果签发者 URL 与配置不同,令牌可能来自错误的租户或环境。',
180
+ '<strong>aud:</strong> 如果受众与 API 标识符不匹配,令牌是为其他资源签发的。',
181
+ '<strong>alg:</strong> 如果算法出乎意料,您的验证器可能拒绝令牌或暴露危险的配置错误。',
182
+ ],
183
+ },
184
+ {
185
+ type: 'title',
186
+ text: '开发过程中 JWT 解析器的使用场景',
187
+ level: 3,
188
+ },
189
+ {
190
+ type: 'comparative',
191
+ columns: 3,
192
+ items: [
193
+ {
194
+ title: '前端调试',
195
+ description: '检查登录后收到的 ID 令牌和访问令牌,以确认范围、角色和个人资料声明。',
196
+ icon: 'mdi:monitor-dashboard',
197
+ points: ['检查个人资料声明', '确认范围和角色', '比较登录环境'],
198
+ },
199
+ {
200
+ title: '后端 API 质量保证',
201
+ description: '将预期的签发者和受众值与 Authorization 头中实际发送的令牌进行比较。',
202
+ icon: 'mdi:api',
203
+ highlight: true,
204
+ points: ['验证受众形态', '发现签发者不匹配', '检查持有者令牌'],
205
+ },
206
+ {
207
+ title: '身份提供商设置',
208
+ description: '检查来自 Auth0、Azure AD、Cognito、Keycloak 或自定义提供商的声明是否符合您的应用程序预期。',
209
+ icon: 'mdi:account-key',
210
+ points: ['审查租户数据', '检查自定义声明', '比较提供商映射'],
211
+ },
212
+ ],
213
+ },
214
+ {
215
+ type: 'title',
216
+ text: '该检查器能清楚揭示的常见 JWT 错误',
217
+ level: 3,
218
+ },
219
+ {
220
+ type: 'proscons',
221
+ title: '快速检查与信任决策',
222
+ items: [
223
+ {
224
+ pro: '立即看到格式错误的令牌。',
225
+ con: '无法知道您预期的受众或签发者。',
226
+ },
227
+ {
228
+ pro: '将 Unix 时间戳声明转换为可读日期。',
229
+ con: '没有实际密钥材料,无法验证签名。',
230
+ },
231
+ {
232
+ pro: '发现缺失的签发者、受众、主题或类型值。',
233
+ con: '无法证明范围和角色对您的应用程序是安全的。',
234
+ },
235
+ ],
236
+ },
237
+ {
238
+ type: 'summary',
239
+ title: '最佳实践工作流程',
240
+ items: [
241
+ '解码令牌以了解客户端或 API 实际接收到的内容。',
242
+ '在追踪应用程序逻辑之前检查 exp、nbf、iss、aud、sub 和 alg。',
243
+ '仅在您的认证层中验证签名和信任决策。',
244
+ '避免在工单、日志或截图中共享敏感的生产 JWT。',
245
+ ],
246
+ },
247
+ ],
248
+ };
@@ -0,0 +1,11 @@
1
+ import type { ToolDefinition } from '../../types';
2
+ import { jwtDecoder } from './entry';
3
+
4
+ export * from './entry';
5
+
6
+ export const JWT_DECODER_TOOL: ToolDefinition = {
7
+ entry: jwtDecoder,
8
+ Component: () => import('./component.astro'),
9
+ SEOComponent: () => import('./seo.astro'),
10
+ BibliographyComponent: () => import('./bibliography.astro'),
11
+ };