Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gorilla/websocket v1.5.3
github.com/labstack/echo-contrib/v5 v5.0.1
github.com/labstack/echo-jwt/v5 v5.0.2
github.com/labstack/echo/v5 v5.3.0
github.com/labstack/echo/v5 v5.4.0
github.com/lestrrat-go/jwx/v3 v3.1.1
github.com/prometheus/client_golang v1.23.2
github.com/r3labs/sse/v2 v2.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ github.com/labstack/echo-jwt/v5 v5.0.2 h1:ECmHEjwbR30fv90LvpQ0XZbEJWhCF/c3Zp8ug/
github.com/labstack/echo-jwt/v5 v5.0.2/go.mod h1:jNxekWlI4+M+UoV8dozKwIHN9MJ2psUR+U1B0nEutIg=
github.com/labstack/echo/v5 v5.3.0 h1:KT74Mprk053PQEHwSZdeCDIz1BigTZOZhavMD0c9Fjs=
github.com/labstack/echo/v5 v5.3.0/go.mod h1:Q3j2+clBRgJr0O3DDONQeXNsM7RHgSwUhcuo47unqm8=
github.com/labstack/echo/v5 v5.4.0 h1:iY674460IvSmUcj7MziL3YrgyTClghz5BpdZoKiGxR4=
github.com/labstack/echo/v5 v5.4.0/go.mod h1:4iEGNQiPPZnkfYpNR/L6fINd3NLiGWUD5+eBotFALas=
github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA=
github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw=
github.com/lestrrat-go/dsig v1.2.1 h1:MwxzZhE4+4fguHi+uDALKVlC3Cn+O1QU1Q/F8D7hVIc=
Expand Down
2 changes: 1 addition & 1 deletion reference/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ module github.com/labstack/echox/reference

go 1.25.0

require github.com/labstack/echo/v5 v5.3.0
require github.com/labstack/echo/v5 v5.4.0

require golang.org/x/time v0.15.0 // indirect
4 changes: 4 additions & 0 deletions reference/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/labstack/echo/v5 v5.3.0 h1:KT74Mprk053PQEHwSZdeCDIz1BigTZOZhavMD0c9Fjs=
github.com/labstack/echo/v5 v5.3.0/go.mod h1:Q3j2+clBRgJr0O3DDONQeXNsM7RHgSwUhcuo47unqm8=
github.com/labstack/echo/v5 v5.4.0 h1:iY674460IvSmUcj7MziL3YrgyTClghz5BpdZoKiGxR4=
github.com/labstack/echo/v5 v5.4.0/go.mod h1:4iEGNQiPPZnkfYpNR/L6fINd3NLiGWUD5+eBotFALas=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o=
golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec=
golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE=
golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE=
golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
4 changes: 2 additions & 2 deletions site/echo-source.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"repository": "https://github.com/labstack/echo.git",
"revision": "caa018246b840091e71a1d61ea9ee1176ab81333",
"release": "v5.3.0"
"revision": "fc410094b2f3415cf2bf5204082137b205bfd5af",
"release": "v5.4.0"
}
2 changes: 1 addition & 1 deletion site/next-source.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"repository": "https://github.com/labstack/echo.git",
"revision": "e804f422d2b0546df620b7f73b7563f509368972",
"revision": "5196b9b0ad8f683fa4bf7172a37805f4651a7975",
"release": "next"
}
2 changes: 2 additions & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"source:accept": "node scripts/accept-source.mjs",
"translations:status": "node scripts/translation-status.mjs",
"translations:accept": "node scripts/accept-translations.mjs",
"security-translations:status": "node scripts/security-translation-status.mjs",
"security-translations:accept": "node scripts/security-translation-status.mjs --accept",
"site:check": "node scripts/check-site.mjs",
"site:accept": "node scripts/check-site.mjs --accept",
"performance:check": "node scripts/check-performance.mjs",
Expand Down
11 changes: 11 additions & 0 deletions site/route-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"/docs/middleware/static/",
"/docs/middleware/trailing-slash/",
"/docs/quick-start/",
"/docs/request-scheme/",
"/docs/request/",
"/docs/response/",
"/docs/routing/",
Expand Down Expand Up @@ -114,6 +115,7 @@
"/es/guide/installation/",
"/es/guide/ip-address/",
"/es/guide/quickstart/",
"/es/guide/request-scheme/",
"/es/guide/request/",
"/es/guide/response/",
"/es/guide/routing/",
Expand Down Expand Up @@ -154,6 +156,7 @@
"/guide/installation/",
"/guide/ip-address/",
"/guide/quickstart/",
"/guide/request-scheme/",
"/guide/request/",
"/guide/response/",
"/guide/routing/",
Expand Down Expand Up @@ -189,6 +192,7 @@
"/ja/guide/installation/",
"/ja/guide/ip-address/",
"/ja/guide/quickstart/",
"/ja/guide/request-scheme/",
"/ja/guide/request/",
"/ja/guide/response/",
"/ja/guide/routing/",
Expand Down Expand Up @@ -298,6 +302,7 @@
"/next/es/guide/installation/",
"/next/es/guide/ip-address/",
"/next/es/guide/quickstart/",
"/next/es/guide/request-scheme/",
"/next/es/guide/request/",
"/next/es/guide/response/",
"/next/es/guide/routing/",
Expand Down Expand Up @@ -338,6 +343,7 @@
"/next/guide/installation/",
"/next/guide/ip-address/",
"/next/guide/quickstart/",
"/next/guide/request-scheme/",
"/next/guide/request/",
"/next/guide/response/",
"/next/guide/routing/",
Expand Down Expand Up @@ -373,6 +379,7 @@
"/next/ja/guide/installation/",
"/next/ja/guide/ip-address/",
"/next/ja/guide/quickstart/",
"/next/ja/guide/request-scheme/",
"/next/ja/guide/request/",
"/next/ja/guide/response/",
"/next/ja/guide/routing/",
Expand Down Expand Up @@ -460,6 +467,7 @@
"/next/pt-br/guide/installation/",
"/next/pt-br/guide/ip-address/",
"/next/pt-br/guide/quickstart/",
"/next/pt-br/guide/request-scheme/",
"/next/pt-br/guide/request/",
"/next/pt-br/guide/response/",
"/next/pt-br/guide/routing/",
Expand Down Expand Up @@ -521,6 +529,7 @@
"/next/zh-cn/guide/installation/",
"/next/zh-cn/guide/ip-address/",
"/next/zh-cn/guide/quickstart/",
"/next/zh-cn/guide/request-scheme/",
"/next/zh-cn/guide/request/",
"/next/zh-cn/guide/response/",
"/next/zh-cn/guide/routing/",
Expand Down Expand Up @@ -582,6 +591,7 @@
"/pt-br/guide/installation/",
"/pt-br/guide/ip-address/",
"/pt-br/guide/quickstart/",
"/pt-br/guide/request-scheme/",
"/pt-br/guide/request/",
"/pt-br/guide/response/",
"/pt-br/guide/routing/",
Expand Down Expand Up @@ -644,6 +654,7 @@
"/zh-cn/guide/installation/",
"/zh-cn/guide/ip-address/",
"/zh-cn/guide/quickstart/",
"/zh-cn/guide/request-scheme/",
"/zh-cn/guide/request/",
"/zh-cn/guide/response/",
"/zh-cn/guide/routing/",
Expand Down
1 change: 1 addition & 0 deletions site/scripts/build-site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function run(args, channel, sourceDir = '') {

run(['run', 'source:check'], 'stable');
run(['run', 'translations:status'], 'stable');
run(['run', 'security-translations:status'], 'stable');
run(['run', 'astro', '--', 'build'], 'stable');
run(['run', 'source:check'], 'next', proposedEcho);
run(['run', 'astro', '--', 'build'], 'next', proposedEcho);
Expand Down
55 changes: 55 additions & 0 deletions site/scripts/security-translation-status.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { createHash } from 'node:crypto';
import { readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';

const siteDir = fileURLToPath(new URL('..', import.meta.url));
const docsDir = join(siteDir, 'src/content/docs');
const baselinePath = join(siteDir, 'security-translation-baseline.json');
const locales = ['es', 'ja', 'pt-br', 'zh-cn'];
const pages = [
'guide/ip-address.md',
'guide/request-scheme.md',
'guide/response.md',
'guide/static-files.md',
'guide/testing.md',
'middleware/redirect.mdx',
'middleware/secure.mdx',
'middleware/proxy.mdx',
'middleware/method-override.mdx',
'middleware/static.mdx',
'middleware/trailing-slash.mdx',
'cookbook/reverse-proxy.md',
'cookbook/jsonp.md',
];

function hash(path) {
return createHash('sha256').update(readFileSync(path, 'utf8')).digest('hex');
}

const actual = Object.fromEntries(locales.map((locale) => [
locale,
Object.fromEntries(pages.map((page) => [page, {
source: hash(join(docsDir, page)),
translation: hash(join(docsDir, locale, page)),
}])),
]));

if (process.argv.includes('--accept')) {
writeFileSync(baselinePath, `${JSON.stringify(actual, null, 2)}\n`);
console.log(`Recorded ${pages.length} reviewed security pages in ${locales.length} locales`);
} else {
const baseline = JSON.parse(readFileSync(baselinePath, 'utf8'));
const stale = [];
for (const locale of locales) {
for (const page of pages) {
const before = baseline[locale]?.[page];
const now = actual[locale][page];
if (!before || before.source !== now.source || before.translation !== now.translation) {
stale.push(`${locale}/${page}: ${!before ? 'not reviewed' : before.source !== now.source ? 'English changed' : 'translation changed'}`);
}
}
}
if (stale.length) throw new Error(`${stale.length} security translations need review:\n${stale.join('\n')}`);
console.log(`${pages.length} security pages match reviewed translations in ${locales.length} locales`);
}
Loading
Loading