Compare commits

...
68 Commits
Author SHA1 Message Date
lukaszraczylo 5a9d104b37 chore(lean): model redirects, key lookup, upserts, retries, CORS, TTL 2026-11-23 13:39:03 +00:00
lukaszraczylo f2049383cb fix(api): restrict CORS to allowed origins, refuse cross-origin writes 2026-11-23 13:38:38 +00:00
lukaszraczylo 549d56e0a1 fix(cache): default metadata freshness to 24h, under the age gate 2026-11-23 13:38:37 +00:00
lukaszraczylo 31db940014 fix(scanner): re-read the blob when a scan retry finds its file gone 2026-11-23 13:38:37 +00:00
lukaszraczylo f46e079cee fix(stats): upsert hourly and daily stats on SQLite as PostgreSQL does 2026-11-23 13:38:37 +00:00
lukaszraczylo ae5167ffa9 fix(auth): look up API keys by id, one bcrypt compare per request 2026-11-23 13:38:37 +00:00
lukaszraczylo 787c757827 fix(network): vet every redirect hop against the upstream allowlist 2026-11-23 13:38:36 +00:00
lukaszraczylo ac4f39322c feat(ui): page, search and filter packages on the server
The package list loaded every package, then grouped and paged in the
browser. The dashboard did the same to show ten recent rows.

- PackageList asks the server for one page of 25 groups. The registry
  filter and a debounced search box (300 ms) change the request. A newer
  request replaces the answer of an older one.
- Dashboard loads a page of 10 groups sorted by cached_at, newest first,
  and runs its stats, recent list and chart requests in parallel.
- Stats already used /api/stats only and does not change.
- The store keeps the loading flag on until the last overlapping request
  settles. Deleting a package no longer reloads the full list, and the
  list reloads its own page instead.
- VulnerablePackages keeps the unpaginated call because it filters on
  scan results in the browser.
2026-11-23 13:26:50 +00:00
lukaszraczylo db5ca2539f perf(api): serve package lists and stats in constant queries
The dashboard waited seconds for /api/packages and /api/stats. Both
handlers ran queries per package, so the cost grew with the cache.

Baseline, measured live through a port-forward (median of 5):
- /api/packages: 3033 ms, 594 items, limit ignored
- /api/packages?limit=50&offset=0: 2813 ms
- /api/stats: 3813 ms
- /api/stats/timeseries?period=1day: 12 ms

Baseline queries per request, counted on SQLite with 20 and 120 rows:
- /api/packages: 141 and 841 queries (7 per package)
- /api/stats: 103 and 603 queries (5 per package)

Both handlers now run a constant number of queries: 4 for the full list,
6 for a page, 6 for stats. The query-count tests fail on the old code.

- /api/packages pages (registry, name) groups with page, page_size,
  registry, q, sort and order, and returns total_groups. Without page
  and page_size it returns every package, so old clients keep working.
- A batched scan lookup replaces the per-package GetScanResult and
  CheckVulnerabilities calls. ScanDecisions returns the same verdicts as
  CheckVulnerabilities, proven by a policy and bypass matrix test.
- The silent 1000-row cap is gone from the list and the Go delete.
- /api/stats sums per registry with GROUP BY and judges blocked
  packages in one batch.
- Migration 202611240001 adds scan_results (package_id, scanned_at) on
  SQLite, PostgreSQL and MySQL. The existing (registry_id, name, version)
  index already serves the group lookups.
2026-11-23 13:26:50 +00:00
lukaszraczylo a7b9917696 chore(lean): model cache, keys, scan policy, access, release age and stats
Six Lean 4 + Mathlib modules prove or refute the audited properties and cite the Go files they model. FINDINGS.md records each verdict with its Lean theorem, Go test and fix commit. The axiom audit and the currency check live in lean4/scripts.
2026-11-23 13:16:52 +00:00
lukaszraczylo 3143de3a3f fix(scanner): scan PyPI artifacts by release version, not file name
PyPI artifacts are cached under their file name, and the scanners received that name as the version. OSV parsed it as a version below every range, so it missed vulnerabilities that affect the real release (for requests 2.19.0, PYSEC-2023-74 and GHSA-j8r2-6x86-q33q) and reported others that do not. Scanners now receive the release version stored on the package row. The saved result stays keyed by the cache version.
2026-11-23 13:15:34 +00:00
lukaszraczylo f0b37ea719 fix(cache): scan npm and PyPI packages named like Go metadata
IsMetadataEntry treated any name ending in .mod or .info as metadata. An npm or PyPI package with such a name skipped the vulnerability scan and was never blocked. The suffix rule now applies to the go registry only.
2026-11-23 13:15:34 +00:00
lukaszraczylo 7192e4ff3e fix(stats): keep downloads that a daily rollup has not counted yet
The time series let a day's rollup replace the hourly rows and events for that day. A download aggregated after the rollup ran vanished from the chart until the next pass. The chart now takes the larger of the two figures.
2026-11-23 13:15:34 +00:00
lukaszraczylo ad4e848e2b fix(stats): roll up every completed day still held hourly
The daily pass rolled up only yesterday, once a day at hour 0. A pass that ran before its last hour was aggregated, or that a restart skipped, left that day short or empty, and the hourly rows were deleted after seven days. Each pass now recomputes the six completed days before today.
2026-11-23 13:15:33 +00:00
lukaszraczylo 990a1d3409 fix(cache): retry once when a purge removes the blob during a hit
Get probed the blob in getOrFetch and opened it again after the singleflight. A purge between the two returned a storage error to the client. Get now resolves the entry a second time, which sees the miss and fetches again.
2026-11-23 13:15:33 +00:00
lukaszraczylo 440279aa50 fix(cache): stop LRU eviction spinning and failing overlapping stores
evict re-listed the same 100 rows forever when every delete failed, and an
overlapping store received a quota error because a flag rejected the second
eviction. Eviction now returns when a pass deletes nothing, and a second
caller waits for the running eviction.
2026-11-23 13:15:33 +00:00
lukaszraczylo 1f31256769 fix(storage): release replaced bytes when a key is overwritten
Put added the new size to the usage counter without subtracting the file it
replaced. Each overwrite inflated usage until restart and could trip the
quota on a cache that was not full.
2026-11-23 13:15:33 +00:00
lukaszraczylo 4713524778 fix(scanner): honour CVE bypasses under block_on_severity LOW
The LOW policy counted every vulnerability, including bypassed ones, so an
active bypass never unblocked a package. It now counts only the remaining
vulnerabilities.
2026-11-23 13:15:33 +00:00
lukaszraczylo 5c9f7e6af3 fix(pypi): bind original_url to the requested file name
The cache key is built from the request path, but the upstream fetch used
the original_url query value. Any file on an allowed host could be stored
under another package's key. The handler now rejects an original_url whose
file name differs from the requested file.
2026-11-23 13:15:32 +00:00
lukaszraczylo 6f604367da fix(websocket): start the event loop and throttle drop warnings
The app built the websocket server but never called Start, so nothing read the 256-slot broadcast channel. After the first 256 events every event was dropped with a warning, and dashboard clients blocked forever on the unbuffered register channel, leaking a goroutine per connection and never receiving events. Run now starts the loop with the other workers. Dropped events are counted in gohoarder_websocket_events_dropped_total and warned about at most once a minute.
2026-11-23 12:56:32 +00:00
lukaszraczylo c98720c02e docs: describe cache.idle_ttl and the cleanup run
Document the new idle_ttl key in the example config and the README.
Explain that artifacts never expire by age and that metadata entries
refresh after default_ttl.
2026-11-23 12:50:01 +00:00
lukaszraczylo 9a44683fbd feat(ui): note the idle eviction window on the stats page
The stats page now reads idle_ttl from the stats API. It shows
"Cached items not requested for 7 days are removed." in an info alert.
The note stays hidden when idle eviction is off.
2026-11-23 12:50:00 +00:00
lukaszraczylo d6edd40d79 feat(cache): evict items idle past cache.idle_ttl
Every cached item got a 7-day expiry at store time. A popular tarball
left the cache seven days after it was cached, however often clients
requested it.

Artifacts now get no age-based expiry. Cleanup removes any item whose
last_accessed is older than cache.idle_ttl (default 168h, 0 disables).
It reads the items in bounded batches of 500 through the indexed
last_accessed column and deletes them through deletePackage. Metadata
entries keep the freshness expiry from default_ttl.

Startup and each cleanup run clear the expiry that earlier versions set
on artifact rows. Cleanup records the idle and ttl eviction reasons and
logs the count and bytes freed. The stats API reports idle_ttl in
seconds. Package deletes are soft deletes and no history table has a
foreign key to packages, so download history stays intact.
2026-11-23 12:49:47 +00:00
lukaszraczylo 99c885cd88 fix(ui): stack package rows on phones and drop pager edge buttons
At 320px the package name shared a row with the registry badge, size and downloads, so it had about 90px and scoped names broke mid-word. Below sm the name now takes the full width with the meta row underneath. The pager's first and last buttons wrapped onto a second line inside the card; the page list already reaches the first and last pages, so the edge buttons are off.
2026-11-23 12:29:40 +00:00
lukaszraczylo c022824d2b fix(ui): swap native key prompt for a dialog; add favicon 2026-11-23 03:18:43 +00:00
lukaszraczylo 5420480ef8 fix(metadata): keep created_at on CVE bypass edit; repair MySQL suite 2026-11-23 03:18:42 +00:00
lukaszraczylo bde9eebf3d fix(ui): show the PyPI release version in every version display 2026-11-23 03:18:42 +00:00
github-actions[bot]andGitHub f65c0cc1f3 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-23 03:17:22 +00:00
lukaszraczylo 947b264d94 fix(pypi): send the release version in the scanned package list
The package list builds its own payload when scanning is on, and that payload left out release_version, so the dashboard still showed file names. A helper now builds the summary and a test covers it.
2026-11-23 02:47:34 +00:00
lukaszraczylo 1c9b04fba4 fix(pypi): key rows on the file name and show the release version
A PyPI row keys on the file name so each file of a release keeps its own cache and storage key. A new release_version column holds the real version and the API and dashboard show it. Startup deletes old sidecar rows with their storage and fills the release version on old file rows, keeping their storage keys. Startup also drops an empty download_events_old table. This replaces the local-version suffix.
2026-11-23 02:36:53 +00:00
lukaszraczylo fb25501ae4 test(integration): build the integration suites again
The mysql and postgres suites used a removed cache rebuild method, a map for string metadata, and a shadowed metadata package. The mysql suite now sets parseTime. JSON columns pick json on mysql and jsonb elsewhere, so the mysql schema creates.
2026-11-23 02:36:51 +00:00
lukaszraczylo f0b7139a92 fix(pypi): record the release version and skip metadata sidecars
A PyPI package row held the file name as its version, and each PEP 658
sidecar became its own package. The version now comes from the file name, and
a wheel or zip adds a local-version suffix so distinct files keep distinct
cache keys. The sidecar streams from upstream without a package row. Rows
written before this change age out through the cache TTL.
2026-11-23 02:29:14 +00:00
lukaszraczylo 879ece368e fix(stats): include unaggregated downloads in the timeseries
The timeseries read only the aggregated tables. The hourly worker skips the
current hour and the daily rollup skips the current day, so fresh downloads
showed as zero. The query now merges raw download events, hourly rows and
daily rollups, with all buckets in UTC. The change in gormstore is limited to
GetTimeSeriesStats.
2026-11-23 02:29:14 +00:00
lukaszraczylo 81e3f9c74f fix(frontend): show load failures as errors and add a not-found route
A failed request left the store error set while the view kept its own
empty-list branch, so the page said nothing was cached. Every view now
checks loading, then error, then content, and the retry button refetches.
Unknown paths render a NotFound page with a link to the dashboard. The brand
shares the sidebar left edge, and a stopped socket reads Live updates paused
in a neutral tone; the client already retries with backoff.
2026-11-23 02:29:14 +00:00
lukaszraczylo 24dfb6eace chore(frontend): remove the hand-written ui kit and unused dependencies
The library provides every component, so src/components/ui, the cn helper,
the badge class helpers, tailwind.config.js and components.json go. Drop clsx,
class-variance-authority, tailwind-merge, tailwindcss-animate, lucide,
@vueuse/core, marked, reka-ui, the typography plugin and the Font Awesome
web font.
2026-11-23 02:29:14 +00:00
lukaszraczylo a5fd828410 feat(frontend): rebuild the bypass panel with library forms
Field, Input, Textarea, Checkbox, SegmentedControl and Dialog replace the
hand-written form. The status filter now applies the expired choice, which
the old click handler compared instead of assigning. Results show as toasts
and fetch failures as an ErrorState. Add a strict-mode smoke test per view.
2026-11-23 02:29:14 +00:00
lukaszraczylo 54bc809f66 feat(frontend): rebuild package, detail and vulnerable views
Package groups use Accordion with Table or DataTable in the cards layout
below sm. Delete confirmations use ConfirmDialog and results go to the
Toaster. Vulnerability descriptions render through Markdown instead of
v-html, and references use the library Link.
2026-11-23 02:29:13 +00:00
lukaszraczylo 041c6e8012 feat(frontend): rebuild the dashboard and stats on library components
KpiTile and StatGroup carry the totals, BarChart draws download activity,
ActivityFeed lists live events and DataTable lists recent packages and
registries. Loading, empty and error states use the library states. Severity
badges are StatusBadge with the tones critical danger, high warning, moderate
info and low neutral, and always print the word.
2026-11-23 02:29:13 +00:00
lukaszraczylo 0a0286df41 feat(frontend): add the perfect-design theme, shell and helpers
Install @perfect-design/ui 0.3.10 with the workbench style pack, IBM Plex
faces and the inline theme boot script. The app shell uses AppHeader, AppShell
and SidebarNav. Shared formatters, severity tones and icon data replace the
per-view copies. A test checks that main.css scans only the library
directories the app imports.
2026-11-23 02:29:13 +00:00
lukaszraczylo b88f9d2c99 chore: ignore local worktrees 2026-11-23 02:29:13 +00:00
lukaszraczylo d38eb34e06 fix(postgres): create the stats upsert indexes and partition audit_log
The hourly and daily aggregation upserts name a unique expression index that AutoMigrate does not create, so every aggregation failed on PostgreSQL. AutoMigrate also created audit_log as a plain table, so the partition step failed on every start. The partition manager now creates the two indexes and replaces an empty plain audit_log with a partitioned one.
2026-11-23 02:23:35 +00:00
lukaszraczylo ea00fac0fe style: fix remaining golangci-lint findings 2026-11-23 01:21:16 +00:00
lukaszraczylo 1fefe03e8f fix(sqlite): stop prepared statements starving the connection pool 2026-11-23 01:21:14 +00:00
lukaszraczylo a69e96d75c ci: run the benchmark and helm chart jobs on the self-hosted runner 2026-11-23 01:19:31 +00:00
lukaszraczylo d653a32bd5 fix(metadata): read file store through os.Root to block symlink escape 2026-11-23 01:16:32 +00:00
lukaszraczylo 1d0363b247 fix(cache): cancel background scans when the manager closes 2026-11-23 01:15:19 +00:00
lukaszraczylo 380b3b9d1c fix(frontend): keep package endpoints off the dashboard proxy
The dashboard image forwarded /npm, /pypi, /go and /metrics to the
backend, so exposing the dashboard also exposed the package cache. Those
paths now return 404. The WebSocket location also matches /ws, the path
the backend serves.
2026-11-23 00:32:47 +00:00
lukaszraczylo a313ac1096 fix(proxy): serve escaped npm scopes and unscanned packages
npm and pnpm request scoped packages as @scope%2fname. Fiber's adaptor
answers 404 to an escaped slash, so a route middleware now rewrites the
scope separator before the adaptor runs.

With scanning off, the cache still waited 30 s for a scan result and then
refused the package. A scanner that is off is now treated as absent.

A scan that fails on infrastructure (timeout, network error, upstream 5xx)
no longer blocks the package until its entry expires. The package is
served and the scan is retried every scan_retry_interval. Set
security.fail_closed to refuse such packages.

The OSV api_url default and the docs named the host, which answers 404 to a
query. They now name https://api.osv.dev/v1/query, and a bare host is
completed with the query path.
2026-11-23 00:31:47 +00:00
lukaszraczylo 65b2f23486 fix(pypi): serve the PEP 691 JSON simple API with upload-time
The proxy returned HTML pages only. uv with --exclude-newer drops files
that carry no upload time, so every file was filtered out. The handler
now negotiates the representation from the Accept header, as PyPI does.
It passes the upstream JSON through, including PEP 700 upload-time, and
rewrites only the file URLs. HTML clients keep HTML. The handler also
fetches the PEP 658 metadata sidecar and trusts the configured upstream
host for file URLs.
2026-11-23 00:31:40 +00:00
lukaszraczylo cfab914a24 fix(sqlite): take the write lock at transaction start
Read-then-write transactions began deferred. SQLite returns SQLITE_BUSY
for these at once and ignores busy_timeout, so concurrent requests logged
"database is locked". The DSN now sets _txlock=immediate and a 15 s
busy_timeout, so writers queue. A concurrency test covers this.
2026-11-23 00:31:37 +00:00
github-actions[bot]andGitHub 00a2d2f6ed chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-22 03:15:48 +00:00
github-actions[bot]andGitHub 379fd53c73 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-21 03:14:29 +00:00
github-actions[bot]andGitHub de75f67720 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-20 03:15:12 +00:00
github-actions[bot]andGitHub 6a37d56e33 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-19 03:16:42 +00:00
github-actions[bot]andGitHub 57cbdcdb67 chore(deps): update dependency @vue/test-utils to v2.6.0
Automated dependency update. All tests passed.
2026-11-17 03:15:17 +00:00
github-actions[bot]andGitHub 951f501ff6 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-16 03:14:45 +00:00
github-actions[bot]andGitHub c57c4ccfb0 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-15 03:13:55 +00:00
github-actions[bot]andGitHub 138edbede7 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-14 03:49:04 +00:00
github-actions[bot]andGitHub 3ae90aa0ee chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-13 03:14:52 +00:00
github-actions[bot]andGitHub d71371674d chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-12 03:17:59 +00:00
github-actions[bot]andGitHub cc0f56f6db chore(deps): update dependency jsdom to v31
Automated dependency update. All tests passed.
2026-11-10 03:17:34 +00:00
github-actions[bot]andGitHub a174afee73 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-10 03:14:46 +00:00
github-actions[bot]andGitHub 046e074be5 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-09 03:25:01 +00:00
lukaszraczylo 2e0f095ea9 ci(runners): run shared workflows on self-hosted runners
The pr, autoupdate and release workflows now pass runner: self-hosted. The macOS and Windows release legs stay on GitHub-hosted runners.
2026-11-08 03:55:12 +00:00
github-actions[bot]andGitHub c38916aebb chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-08 03:17:55 +00:00
github-actions[bot]andGitHub 015f48b468 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-07 03:19:25 +00:00
github-actions[bot]andGitHub ad5b03ba60 chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-06 03:18:12 +00:00
github-actions[bot]andGitHub 819465e83f chore(deps): update dependencies
Automated dependency update. All tests passed.
2026-11-05 03:15:22 +00:00
205 changed files with 12242 additions and 4533 deletions
+1
View File
@@ -18,3 +18,4 @@ jobs:
go-version: ">=1.27"
node-working-directory: frontend
release-workflow: release.yaml
runner: self-hosted
+1
View File
@@ -19,3 +19,4 @@ jobs:
uses: lukaszraczylo/shared-actions/.github/workflows/go-pr.yaml@main
with:
go-version: ">=1.27"
runner: self-hosted
+3 -2
View File
@@ -29,12 +29,13 @@ jobs:
node-build-script: "cd frontend && npm install -g pnpm && pnpm install --frozen-lockfile && pnpm run build"
node-output-path: "frontend/dist"
node-cache-dependency-path: "frontend/pnpm-lock.yaml"
runner: self-hosted
secrets: inherit
benchmark:
name: Publish Benchmarks
needs: release
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -65,7 +66,7 @@ jobs:
publish-helm-chart:
name: Publish Helm Chart
needs: release
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
+5
View File
@@ -72,6 +72,7 @@ tests/fixtures/temp/
# Markdown files (except README.md)
*.md
!README.md
!lean4/FINDINGS.md
/gohoarder
*.log
@@ -80,3 +81,7 @@ test-go-proxy
frontend/node_modules
data/storage
*.pid
# Local worktrees
.worktrees/
lean4/.lake
+6 -29
View File
@@ -106,38 +106,15 @@ server {
access_log off;
}
# Metrics endpoint
location /metrics {
proxy_pass http://backend/metrics;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
# Package download endpoints
location ~ ^/(npm|pypi|go)/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
# Extended timeouts for package downloads
proxy_connect_timeout 60s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
# Large buffer for package downloads
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
# The package endpoints are not part of the dashboard and stay on the
# backend Service. A catch-all 404 keeps them off the SPA fallback below.
location ~ ^/(npm|pypi|go|metrics)(/|$) {
return 404;
}
# WebSocket support
location /ws/ {
proxy_pass http://backend/ws/;
location /ws {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
+38 -4
View File
@@ -193,6 +193,7 @@ server:
host: "0.0.0.0"
read_timeout: "5m"
write_timeout: "5m"
allowed_origins: [] # Browser origins allowed to use /api and /ws; empty = same-origin only
storage:
backend: "filesystem" # Options: filesystem, s3, smb
@@ -233,7 +234,9 @@ security:
enabled: true
cache:
default_ttl: 86400 # 24 hours in seconds
default_ttl: 24h # Freshness window for metadata pages (version lists, package documents)
idle_ttl: 168h # Remove cached items not requested for 7 days; 0 disables
cleanup_interval: 1h
logging:
level: "info" # debug, info, warn, error
@@ -245,6 +248,15 @@ upstream:
go: "https://proxy.golang.org"
```
#### Cache cleanup
Every `cleanup_interval` the cleanup run removes:
- **Idle items.** Any cached item, artifact or metadata page, whose last request is older than `idle_ttl` (default `168h`, seven days). Each request, hit or miss, resets the clock. Set `idle_ttl: 0` to turn idle eviction off.
- **Stale metadata.** Version lists, package documents and Go `.mod`/`.info` files past `default_ttl` (default `24h`, below the 72h release-age gate clients apply). They refresh on the next request.
Artifacts (tarballs, wheels, module zips) never expire by age, so a package that clients keep requesting stays cached. Size-based LRU eviction at `max_size_bytes` is unchanged. Removed items keep their download history in the statistics.
### Environment Variables
All configuration values can be overridden with environment variables:
@@ -876,10 +888,29 @@ Access the web dashboard at **http://localhost:8080**
**List Packages:**
```bash
GET /api/packages
GET /api/packages?registry=npm
GET /api/packages?status=vulnerable
GET /api/packages?page=1&page_size=25
GET /api/packages?registry=npm&q=axios&page_size=25
GET /api/packages?sort=cached_at&order=desc&page_size=10
```
The dashboard groups versions under a package, so paging counts packages (a
registry and name pair), not rows. Without `page` and `page_size` the call
returns every package in one response, with no row cap.
| Parameter | Meaning |
|---|---|
| `page` | 1-based page of groups. Default 1. |
| `page_size` | Groups per page. Default 25 when `page` is set, at most 200. |
| `registry` | Only this registry, for example `npm`, `pypi` or `go`. |
| `q` | Case-insensitive search in name, version and release version. |
| `sort` | `name` (default, ascending), `cached_at`, `downloads` or `size` (both descending). |
| `order` | `asc` or `desc`, to override the default direction of `sort`. |
`packages` holds every version row of each group on the page, in group order
and newest first within a group. `total` is the number of rows returned.
`total_groups` is the number of groups that match the filters across all pages.
A paged response also echoes `page` and `page_size`.
**Package Details:**
```bash
GET /api/packages/:registry/:name/:version
@@ -909,7 +940,10 @@ GET /api/packages/:registry/:name/:version
}
}
],
"total": 42
"total": 1,
"total_groups": 42,
"page": 1,
"page_size": 25
}
```
+14 -5
View File
@@ -12,6 +12,10 @@ server:
read_timeout: "5m"
write_timeout: "5m"
idle_timeout: "2m"
# Origins allowed to call /api from a browser and to open the WebSocket. Exact
# ("https://gohoarder.example.com") or wildcard ("https://*.example.com").
# Empty: same-origin only. A cross-origin DELETE/POST/PATCH is refused with 403.
allowed_origins: []
tls:
enabled: false
cert_file: ""
@@ -89,20 +93,25 @@ metadata:
log_level: "warn" # GORM log level: silent, error, warn, info
cache:
default_ttl: "168h" # 7 days
default_ttl: "24h" # Freshness window for metadata pages (version lists, packuments, .mod/.info); artifacts never expire by age
cleanup_interval: "1h"
idle_ttl: "168h" # Remove cached items not requested for this long; "0" disables
max_size_bytes: 536870912000 # 500GB
per_project_quota: 53687091200 # 50GB
ttl_overrides:
npm: "168h"
pip: "168h"
go: "168h"
npm: "24h"
pip: "24h"
go: "24h"
security:
enabled: false
block_on_severity: "high" # none, low, medium, high, critical
scan_on_download: true # Scan packages on first download
rescan_interval: "24h" # How often to re-scan packages (e.g., 24h, 168h for weekly)
# When a scan fails on infrastructure (timeout, upstream 5xx) the package is served and the
# scan is retried every scan_retry_interval. Set fail_closed to refuse such packages instead.
fail_closed: false
scan_retry_interval: "5m"
update_db_on_startup: false # Update vulnerability databases on startup
allowed_packages: [] # Packages that bypass security checks (format: "registry/name@version")
ignored_cves: [] # CVE IDs to ignore globally (e.g., "CVE-2021-23337")
@@ -125,7 +134,7 @@ security:
# Supports: npm, PyPI, Go, Maven, NuGet, etc.
osv:
enabled: false
api_url: "https://api.osv.dev"
api_url: "https://api.osv.dev/v1/query" # full query endpoint, not the host
timeout: "30s"
# Grype - Multi-ecosystem vulnerability scanner from Anchore
+3
View File
@@ -5,3 +5,6 @@ VITE_BACKEND_URL=http://localhost:8080
# Frontend dev server port
# The Vite development server will run on this port
VITE_PORT=5173
# Origin sent on the dev WebSocket proxy, for a backend with an allowed-origins list
# VITE_WS_ORIGIN=https://gohoarder.example.com
-21
View File
@@ -1,21 +0,0 @@
{
"$schema": "https://shadcn-vue.com/schema.json",
"style": "new-york",
"typescript": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/styles/main.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"composables": "@/composables"
},
"registries": {}
}
+4 -6
View File
@@ -1,13 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-style="workbench">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<title>GoHoarder Dashboard</title>
<meta name="color-scheme" content="light dark" />
<link rel="icon" href="data:," />
<title>GoHoarder dashboard</title>
</head>
<body>
<div id="app"></div>
+7 -12
View File
@@ -8,31 +8,26 @@
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
"test:coverage": "vitest run --coverage",
"sources": "node scripts/library-sources.mjs --write"
},
"dependencies": {
"@vueuse/core": "^15.0.0",
"@fontsource/ibm-plex-mono": "5.3.0",
"@fontsource/ibm-plex-sans": "5.3.0",
"@fortawesome/free-solid-svg-icons": "7.3.1",
"@perfect-design/ui": "0.3.10",
"axios": "^1.20.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-vue-next": "^1.0.0",
"marked": "^18.0.0",
"pinia": "^4.0.0",
"reka-ui": "^2.7.0",
"tailwind-merge": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"vue": "^3.5.26",
"vue-router": "^5.3.1"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^7.1.0",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.3.3",
"@testing-library/jest-dom": "^7.0.0",
"@testing-library/vue": "^8.1.0",
"@vitejs/plugin-vue": "^6.0.3",
"@vue/test-utils": "^2.4.6",
"jsdom": "^30.0.0",
"jsdom": "^31.0.0",
"tailwindcss": "^4.3.3",
"typescript": "^6.0.3",
"vite": "^8.0.0",
+525 -779
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
export function librarySources(root: string): string[]
+94
View File
@@ -0,0 +1,94 @@
// Lists the @source lines for the @perfect-design/ui dist directories the app imports, transitively.
// `node scripts/library-sources.mjs` prints them; `--write` rewrites the block in src/styles/main.css.
import { readFileSync, writeFileSync, readdirSync, statSync, existsSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { join, dirname, resolve, relative } from 'node:path'
export function librarySources(root) {
const dist = join(root, 'node_modules/@perfect-design/ui/dist')
function walk(dir, out = []) {
for (const e of readdirSync(dir)) {
const p = join(dir, e)
statSync(p).isDirectory() ? walk(p, out) : out.push(p)
}
return out
}
// names imported from the package entry
const names = new Set()
for (const f of walk(join(root, 'src')).filter((f) => /\.(vue|ts)$/.test(f) && !/\.(spec|test)\./.test(f))) {
const src = readFileSync(f, 'utf8')
for (const m of src.matchAll(/import\s*\{([^}]*)\}\s*from\s*'@perfect-design\/ui'/g))
for (const n of m[1].split(',')) {
const name = n.trim().replace(/^type\s+/, '').split(/\s+as\s+/)[0]
if (name && !n.trim().startsWith('type ')) names.add(name)
}
}
// name -> file: follow the barrel index.js re-exports
const resolveJs = (from, spec) => {
const base = resolve(dirname(from), spec)
for (const c of [base, base + '.js', join(base, 'index.js')]) if (existsSync(c) && statSync(c).isFile()) return c
return null
}
const exportsOf = new Map() // exported name -> file
{
const idx = join(dist, 'index.js')
const src = readFileSync(idx, 'utf8')
const localFile = new Map()
for (const m of src.matchAll(/^import\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*"(\.[^"]+)";?$/gm)) {
const target = resolveJs(idx, m[3])
if (!target) continue
if (m[1]) localFile.set(m[1], target)
if (m[2]) for (const n of m[2].split(',')) { const p = n.trim().split(/\s+as\s+/); if (p[0]) localFile.set(p[1] ?? p[0], target) }
}
for (const m of src.matchAll(/^export\s*\{([^}]*)\};?$/gm))
for (const n of m[1].split(',')) {
const p = n.trim().split(/\s+as\s+/)
const local = p[0], exported = p[1] ?? p[0]
if (localFile.has(local)) exportsOf.set(exported, localFile.get(local))
}
}
const files = new Set()
const queue = []
const missing = []
for (const n of names) {
const f = exportsOf.get(n)
f ? queue.push(f) : missing.push(n)
}
while (queue.length) {
const f = queue.pop()
if (files.has(f)) continue
files.add(f)
const src = readFileSync(f, 'utf8')
for (const m of src.matchAll(/from\s*["'](\.[^"']+)["']/g)) {
const t = resolveJs(f, m[1])
if (t && !files.has(t)) queue.push(t)
}
}
const dirs = new Set([...files].map((f) => dirname(f)))
if (missing.length) throw new Error(`not exported by @perfect-design/ui: ${missing.join(', ')}`)
const rel = (d) => relative(join(root, 'src/styles'), d).split('\\').join('/')
const lines = [...dirs]
.map(rel)
.sort()
.map((d) => `@source "${d}/*.js";`)
return lines
}
if (import.meta.url === `file://${process.argv[1]}`) {
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const lines = librarySources(root)
if (process.argv.includes('--write')) {
const css = join(root, 'src/styles/main.css')
const kept = readFileSync(css, 'utf8')
.split('\n')
.filter((l) => !l.startsWith('@source '))
const at = kept.findIndex((l) => l.startsWith('/* Only the library components'))
kept.splice(at + 1, 0, ...lines)
writeFileSync(css, kept.join('\n'))
} else {
console.log(lines.join('\n'))
}
}
+47 -58
View File
@@ -1,61 +1,50 @@
<template>
<div class="min-h-screen bg-background">
<nav class="sticky top-0 z-50 bg-card/95 backdrop-blur-lg shadow-sm border-b">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center gap-3">
<div class="flex items-center justify-center w-10 h-10 rounded-lg bg-primary text-primary-foreground">
<i class="fas fa-box-open text-lg"></i>
</div>
<div class="flex flex-col">
<h1 class="text-lg font-semibold tracking-tight text-foreground">GoHoarder</h1>
<p class="text-xs text-muted-foreground">Package Cache Manager</p>
</div>
</div>
<div class="flex items-center gap-1">
<router-link
to="/"
class="inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium text-foreground/70 hover:text-foreground hover:bg-accent transition-colors"
active-class="text-foreground bg-accent"
>
<i class="fas fa-chart-pie text-sm"></i>
<span>Dashboard</span>
</router-link>
<router-link
to="/packages"
class="inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium text-foreground/70 hover:text-foreground hover:bg-accent transition-colors"
active-class="text-foreground bg-accent"
>
<i class="fas fa-boxes text-sm"></i>
<span>Packages</span>
</router-link>
<router-link
to="/stats"
class="inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium text-foreground/70 hover:text-foreground hover:bg-accent transition-colors"
active-class="text-foreground bg-accent"
>
<i class="fas fa-chart-bar text-sm"></i>
<span>Statistics</span>
</router-link>
<router-link
to="/admin/bypasses"
class="inline-flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium text-foreground/70 hover:text-foreground hover:bg-accent transition-colors"
active-class="text-foreground bg-accent"
>
<i class="fas fa-shield-alt text-sm"></i>
<span>Admin</span>
</router-link>
</div>
</div>
</div>
</nav>
<script setup lang="ts">
import { onMounted } from 'vue'
import { RouterView } from 'vue-router'
import { AppHeader, AppShell, Icon, ThemeToggle, Toaster, useThemeStore } from '@perfect-design/ui'
import AppNav from '@/components/shell/AppNav.vue'
import { faBoxOpen } from '@/lib/icons'
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
<router-view />
</main>
// init() installs the watcher that applies and persists the choice; the style is set after it so a stored value cannot override the pack.
onMounted(() => {
const theme = useThemeStore()
theme.init()
theme.setStyle('workbench')
})
</script>
<template>
<div class="flex min-h-dvh flex-col">
<!-- Rendered here, not by AppShell: the header sits above the shell, and the skip link must be the first tab stop. -->
<a
href="#main-content"
class="sr-only focus:not-sr-only focus:absolute focus:start-2 focus:top-2 focus:z-(--z-toast) focus:rounded-md focus:bg-primary focus:px-3 focus:py-2 focus:text-sm focus:text-primary-foreground"
>Skip to main content</a
>
<!-- px-6 on the bar equals the sidebar nav's p-3 plus the link's px-3, so the brand icon sits over the nav icons. -->
<!-- AppShell wraps its #header slot in its own <header> and AppHeader renders one too; outside the shell there is one banner. -->
<AppHeader sticky mobile-variant="sheet" class="[&>div]:h-(--header-h) [&>div]:px-6">
<template #brand>
<Icon :icon="faBoxOpen" size="lg" class="text-primary" />
<p class="m-0 text-lg font-semibold">GoHoarder</p>
<p class="m-0 hidden text-sm text-muted-foreground sm:block">Package cache manager</p>
</template>
<template #actions><ThemeToggle /></template>
<template #mobile><AppNav sheet /></template>
</AppHeader>
<!-- The aside scrolls itself, so only the aside can stick; both offsets come from --header-h. -->
<AppShell
:skip-link="false"
drawer-breakpoint="md"
sidebar-label="Sections"
content-max-width="7xl"
class="flex-1 md:[&_[data-slot=app-shell-sidebar]]:sticky md:[&_[data-slot=app-shell-sidebar]]:top-(--header-h) md:[&_[data-slot=app-shell-sidebar]]:h-[calc(100dvh-var(--header-h))] md:[&_[data-slot=app-shell-sidebar]]:self-start"
>
<template #sidebar><AppNav /></template>
<div class="py-6"><RouterView /></div>
</AppShell>
<Toaster />
</div>
</template>
<script setup lang="ts">
// App component
</script>
+218 -338
View File
@@ -1,347 +1,204 @@
<template>
<div>
<div class="flex justify-between items-center mb-8">
<div>
<h2 class="text-3xl font-bold text-gray-900">CVE Bypass Management</h2>
<p class="text-gray-600 mt-1">Manage temporary security bypasses for packages and CVEs</p>
</div>
<Button @click="showCreateModal = true" class="bg-green-600 hover:bg-green-700">
<i class="fas fa-plus mr-2"></i>Create Bypass
<div class="flex flex-col gap-6">
<PageHeader
title="CVE bypass management"
description="Manage temporary security bypasses for packages and CVEs."
>
<template #actions>
<Button :icon-start="faPlus" @click="showCreateModal = true">Create bypass</Button>
</template>
</PageHeader>
<div class="flex flex-col gap-4 sm:flex-row sm:flex-wrap sm:items-center">
<SegmentedControl v-model="activeFilter" :options="FILTER_OPTIONS" aria-label="Filter by status" />
<SegmentedControl v-model="typeFilter" :options="TYPE_OPTIONS" aria-label="Filter by type" />
<Button variant="outline" size="sm" :icon-start="faRotateRight" class="sm:ms-auto" @click="fetchBypasses">
Refresh
</Button>
</div>
<!-- Filter Section -->
<div class="mb-6 flex flex-col sm:flex-row items-start sm:items-center gap-4">
<div class="flex items-center gap-2">
<span class="text-sm font-medium text-gray-700">Filter:</span>
<div class="flex gap-2">
<Button
@click="activeFilter = 'all'"
:variant="activeFilter === 'all' ? 'default' : 'outline'"
size="sm"
>
All
</Button>
<Button
@click="activeFilter = 'active'"
:variant="activeFilter === 'active' ? 'default' : 'outline'"
size="sm"
>
<i class="fas fa-check-circle mr-1"></i>Active
</Button>
<Button
@click="activeFilter === 'expired'"
:variant="activeFilter === 'expired' ? 'default' : 'outline'"
size="sm"
>
<i class="fas fa-clock mr-1"></i>Expired
</Button>
</div>
</div>
<div class="flex items-center gap-2">
<span class="text-sm font-medium text-gray-700">Type:</span>
<div class="flex gap-2">
<Button
@click="typeFilter = ''"
:variant="typeFilter === '' ? 'default' : 'outline'"
size="sm"
>
All
</Button>
<Button
@click="typeFilter = 'cve'"
:variant="typeFilter === 'cve' ? 'default' : 'outline'"
size="sm"
>
CVE
</Button>
<Button
@click="typeFilter = 'package'"
:variant="typeFilter === 'package' ? 'default' : 'outline'"
size="sm"
>
Package
</Button>
</div>
</div>
<Button @click="fetchBypasses" variant="outline" size="sm" class="sm:ml-auto">
<i class="fas fa-sync-alt mr-2"></i>Refresh
</Button>
</div>
<LoadingState v-if="loading" variant="table" label="Loading bypasses..." />
<!-- Error Alert -->
<Alert v-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load bypasses"
:message="error"
@retry="fetchBypasses"
/>
<!-- Success Alert -->
<Alert v-if="successMessage" class="mb-4 bg-green-50 border-green-200">
<i class="fas fa-check-circle mr-2 text-green-600"></i>
<AlertDescription class="text-green-800">{{ successMessage }}</AlertDescription>
</Alert>
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading bypasses...</p>
</div>
<!-- Bypass List -->
<Card v-else>
<CardContent class="p-6">
<div v-if="filteredBypasses.length === 0" class="text-center py-12 text-gray-500">
<i class="fas fa-shield-alt text-6xl mb-4"></i>
<p class="text-xl">No bypasses found</p>
<p class="mt-2">Create a bypass to allow packages with known vulnerabilities</p>
</div>
<div v-else class="space-y-4">
<div
v-for="bypass in filteredBypasses"
:key="bypass.id"
class="border rounded-lg p-4 hover:bg-gray-50"
:class="bypass.active ? 'border-gray-200' : 'border-gray-300 bg-gray-50'"
>
<div class="flex items-start justify-between">
<div class="flex-1">
<div class="flex items-center gap-2 mb-2">
<Badge :variant="bypass.type === 'cve' ? 'default' : 'outline'">
{{ bypass.type.toUpperCase() }}
</Badge>
<Badge
:class="bypass.active ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-600'"
>
{{ bypass.active ? 'ACTIVE' : 'INACTIVE' }}
</Badge>
<Badge
v-if="isExpired(bypass.expires_at)"
class="bg-red-100 text-red-800"
>
EXPIRED
</Badge>
</div>
<h4 class="font-semibold text-lg text-gray-900">{{ bypass.target }}</h4>
<p class="text-sm text-gray-600 mt-1">{{ bypass.reason }}</p>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mt-3 text-sm text-gray-500">
<div>
<i class="fas fa-user mr-1"></i>
<strong>Created by:</strong> {{ bypass.created_by }}
</div>
<div>
<i class="fas fa-calendar mr-1"></i>
<strong>Created:</strong> {{ formatDate(bypass.created_at) }}
</div>
<div>
<i class="fas fa-clock mr-1"></i>
<strong>Expires:</strong> {{ formatDate(bypass.expires_at) }}
</div>
<div v-if="bypass.applies_to">
<i class="fas fa-box mr-1"></i>
<strong>Applies to:</strong> {{ bypass.applies_to }}
</div>
</div>
</div>
<div class="flex items-center gap-2 ml-4">
<Button
@click="editBypass(bypass)"
variant="outline"
size="sm"
title="Edit bypass"
>
<i class="fas fa-edit"></i>
</Button>
<Button
@click="confirmDeleteBypass(bypass)"
variant="destructive"
size="sm"
title="Delete bypass"
>
<i class="fas fa-trash"></i>
</Button>
</div>
</div>
</div>
</div>
<CardContent>
<EmptyState
v-if="filteredBypasses.length === 0"
:icon="faShieldHalved"
title="No bypasses found"
description="Create a bypass to allow packages with known vulnerabilities."
/>
<DataTable
v-else
label="Bypasses"
layout="cards"
row-key="id"
:columns="bypassColumns"
:rows="filteredBypasses"
>
<template #cell-type="{ row }">
<Badge :variant="row.type === 'cve' ? 'default' : 'outline'">{{ row.type === 'cve' ? 'CVE' : 'Package' }}</Badge>
</template>
<template #cell-status="{ row }">
<span class="flex flex-wrap gap-1">
<StatusBadge
:status="row.active ? 'active' : 'inactive'"
:tones="{ active: 'success', inactive: 'neutral' }"
/>
<StatusBadge v-if="isExpired(row.expires_at)" status="expired" :tones="{ expired: 'danger' }" />
</span>
</template>
<template #cell-actions="{ row }">
<span class="flex gap-1">
<IconButton :icon="faPen" :label="`Edit bypass for ${row.target}`" @click="editBypass(row)" />
<IconButton :icon="faTrash" :label="`Delete bypass for ${row.target}`" @click="confirmDeleteBypass(row)" />
</span>
</template>
</DataTable>
</CardContent>
</Card>
<!-- Create/Edit Bypass Modal -->
<Dialog v-model:open="showCreateModal">
<DialogContent class="max-w-2xl">
<DialogContent size="lg">
<DialogHeader>
<DialogTitle>{{ editingBypass ? 'Edit' : 'Create' }} Bypass</DialogTitle>
<DialogTitle>{{ editingBypass ? 'Edit' : 'Create' }} bypass</DialogTitle>
<DialogDescription>
{{ editingBypass ? 'Update bypass settings' : 'Create a temporary bypass for a CVE or package' }}
{{ editingBypass ? 'Update the bypass settings.' : 'Create a temporary bypass for a CVE or package.' }}
</DialogDescription>
</DialogHeader>
<div class="space-y-4 py-4">
<!-- Type Selection -->
<div v-if="!editingBypass">
<label class="text-sm font-medium text-gray-700 mb-2 block">Bypass Type</label>
<div class="flex gap-4">
<Button
@click="bypassForm.type = 'cve'"
:variant="bypassForm.type === 'cve' ? 'default' : 'outline'"
class="flex-1"
>
<i class="fas fa-bug mr-2"></i>CVE Bypass
</Button>
<Button
@click="bypassForm.type = 'package'"
:variant="bypassForm.type === 'package' ? 'default' : 'outline'"
class="flex-1"
>
<i class="fas fa-box mr-2"></i>Package Bypass
</Button>
</div>
</div>
<form class="flex flex-col gap-4" @submit.prevent="submitBypass">
<Field v-if="!editingBypass" label="Bypass type">
<SegmentedControl v-model="bypassForm.type" :options="BYPASS_TYPE_OPTIONS" full-width />
</Field>
<!-- Target -->
<div v-if="!editingBypass">
<label class="text-sm font-medium text-gray-700 mb-2 block">
{{ bypassForm.type === 'cve' ? 'CVE ID' : 'Package' }}
</label>
<Field
v-if="!editingBypass"
:label="bypassForm.type === 'cve' ? 'CVE ID' : 'Package'"
:hint="
bypassForm.type === 'cve'
? 'Enter the CVE ID, for example CVE-2021-23337.'
: 'Enter a package, for example npm/[email protected], or npm/lodash for all versions. PyPI packages use the release version, for example pypi/[email protected].'
"
required
>
<Input
v-model="bypassForm.target"
:placeholder="bypassForm.type === 'cve' ? 'CVE-2021-23337' : 'npm/[email protected]'"
class="w-full"
/>
<p class="text-xs text-gray-500 mt-1">
{{ bypassForm.type === 'cve' ? 'Enter the CVE ID (e.g., CVE-2021-23337)' : 'Enter package (e.g., npm/[email protected] or npm/lodash for all versions)' }}
</p>
</div>
</Field>
<!-- Applies To (CVE only) -->
<div v-if="!editingBypass && bypassForm.type === 'cve'">
<label class="text-sm font-medium text-gray-700 mb-2 block">
Applies To (Optional)
</label>
<Input
v-model="bypassForm.applies_to"
placeholder="npm/[email protected]"
class="w-full"
/>
<p class="text-xs text-gray-500 mt-1">
Limit this CVE bypass to a specific package. Leave empty to apply to all packages with this CVE.
</p>
</div>
<Field
v-if="!editingBypass && bypassForm.type === 'cve'"
label="Applies to (optional)"
hint="Limit this CVE bypass to one package. Leave empty to apply it to every package with this CVE."
>
<Input v-model="bypassForm.applies_to" placeholder="npm/[email protected]" />
</Field>
<!-- Reason -->
<div>
<label class="text-sm font-medium text-gray-700 mb-2 block">Reason *</label>
<Input
v-model="bypassForm.reason"
placeholder="No fix available, business critical dependency"
class="w-full"
/>
<p class="text-xs text-gray-500 mt-1">
Explain why this bypass is needed (required for audit trail)
</p>
</div>
<Field label="Reason" hint="Explain why this bypass is needed. It is kept for the audit trail." required>
<Textarea v-model="bypassForm.reason" placeholder="No fix available, business critical dependency" />
</Field>
<!-- Created By -->
<div v-if="!editingBypass">
<label class="text-sm font-medium text-gray-700 mb-2 block">Created By *</label>
<Input
v-model="bypassForm.created_by"
placeholder="[email protected]"
class="w-full"
/>
</div>
<Field v-if="!editingBypass" label="Created by" required>
<Input v-model="bypassForm.created_by" placeholder="[email protected]" />
</Field>
<!-- Expires In -->
<div>
<label class="text-sm font-medium text-gray-700 mb-2 block">Expires In (Hours) *</label>
<Field
label="Expires in (hours)"
hint="Hours until this bypass expires. 168 is 7 days and 720 is 30 days."
required
>
<Input
v-model.number="bypassForm.expires_in_hours"
:model-value="bypassForm.expires_in_hours"
type="number"
min="1"
placeholder="168"
class="w-full"
@update:model-value="setExpiresInHours"
/>
<p class="text-xs text-gray-500 mt-1">
How many hours until this bypass expires (e.g., 168 = 7 days, 720 = 30 days)
</p>
</div>
</Field>
<!-- Active (Edit only) -->
<div v-if="editingBypass" class="flex items-center gap-2">
<input
type="checkbox"
v-model="bypassForm.active"
id="active-checkbox"
class="w-4 h-4"
/>
<label for="active-checkbox" class="text-sm font-medium text-gray-700">
Active
</label>
</div>
<Checkbox v-if="editingBypass" v-model="bypassForm.active" label="Active" />
<!-- Notify on Expiry -->
<div class="flex items-center gap-2">
<input
type="checkbox"
v-model="bypassForm.notify_on_expiry"
id="notify-checkbox"
class="w-4 h-4"
/>
<label for="notify-checkbox" class="text-sm font-medium text-gray-700">
Send notification when bypass expires
</label>
</div>
</div>
<Checkbox v-model="bypassForm.notify_on_expiry" label="Send a notification when the bypass expires" />
<DialogFooter>
<Button @click="closeCreateModal" variant="outline">
Cancel
</Button>
<Button @click="submitBypass" :disabled="!isFormValid">
{{ editingBypass ? 'Update' : 'Create' }} Bypass
</Button>
</DialogFooter>
<DialogFooter>
<Button variant="outline" @click="closeCreateModal">Cancel</Button>
<Button type="submit" :disabled="!isFormValid">{{ editingBypass ? 'Update' : 'Create' }} bypass</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<!-- Delete Confirmation Dialog -->
<Dialog v-model:open="showDeleteModal">
<DialogContent>
<Dialog v-model:open="showKeyDialog">
<DialogContent size="sm">
<DialogHeader>
<DialogTitle>Confirm Deletion</DialogTitle>
<DialogDescription>
Are you sure you want to delete this bypass for <strong>{{ bypassToDelete?.target }}</strong>?
This action cannot be undone and the security check will be re-enabled immediately.
</DialogDescription>
<DialogTitle>Admin API key</DialogTitle>
<DialogDescription>Enter your admin API key to manage bypasses.</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button @click="showDeleteModal = false" variant="outline">
Cancel
</Button>
<Button @click="deleteBypass" variant="destructive">
Delete
</Button>
</DialogFooter>
<form class="flex flex-col gap-4" @submit.prevent="submitApiKey">
<Field label="API key" required>
<Input v-model="keyInput" type="password" autocomplete="off" />
</Field>
<DialogFooter>
<Button variant="outline" @click="showKeyDialog = false">Cancel</Button>
<Button type="submit" :disabled="keyInput.trim() === ''">Continue</Button>
</DialogFooter>
</form>
</DialogContent>
</Dialog>
<ConfirmDialog
v-model:open="showDeleteModal"
title="Delete bypass?"
:description="`Delete the bypass for ${bypassToDelete?.target}? This cannot be undone and the security check is re-enabled immediately.`"
confirm-label="Delete bypass"
tone="danger"
destructive
@confirm="deleteBypass"
/>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'
import { ref, computed, onMounted, watch } from 'vue'
import axios from 'axios'
import { Button } from '@/components/ui/button'
import {
Badge,
Button,
Card,
CardContent,
Checkbox,
ConfirmDialog,
DataTable,
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Card, CardContent } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Input } from '@/components/ui/input'
EmptyState,
ErrorState,
Field,
IconButton,
Input,
LoadingState,
PageHeader,
SegmentedControl,
StatusBadge,
Textarea,
useToastStore,
type DataTableColumn,
} from '@perfect-design/ui'
import { formatDate } from '@/lib/format'
import { faPen, faPlus, faRotateRight, faShieldHalved, faTrash } from '@/lib/icons'
interface Bypass {
id: string
@@ -358,17 +215,17 @@ interface Bypass {
const loading = ref(false)
const error = ref<string | null>(null)
const successMessage = ref<string | null>(null)
const toasts = useToastStore()
const bypasses = ref<Bypass[]>([])
const activeFilter = ref<'all' | 'active' | 'expired'>('all')
const typeFilter = ref<'' | 'cve' | 'package'>('')
const typeFilter = ref<'all' | 'cve' | 'package'>('all')
const showCreateModal = ref(false)
const showDeleteModal = ref(false)
const editingBypass = ref<Bypass | null>(null)
const bypassToDelete = ref<Bypass | null>(null)
const bypassForm = ref({
const EMPTY_FORM = {
type: 'cve' as 'cve' | 'package',
target: '',
reason: '',
@@ -377,10 +234,14 @@ const bypassForm = ref({
applies_to: '',
notify_on_expiry: false,
active: true,
})
}
const bypassForm = ref({ ...EMPTY_FORM })
// Get API key from localStorage or prompt user
const apiKey = ref<string>('')
const keyInput = ref('')
const showKeyDialog = ref(false)
const filteredBypasses = computed(() => {
let filtered = bypasses.value
@@ -393,7 +254,7 @@ const filteredBypasses = computed(() => {
}
// Filter by type
if (typeFilter.value) {
if (typeFilter.value !== 'all') {
filtered = filtered.filter(b => b.type === typeFilter.value)
}
@@ -423,16 +284,23 @@ onMounted(() => {
})
function promptForApiKey() {
const key = prompt('Enter your admin API key:')
if (key) {
apiKey.value = key
localStorage.setItem('admin_api_key', key)
fetchBypasses()
} else {
error.value = 'Admin API key required to manage bypasses'
}
keyInput.value = ''
showKeyDialog.value = true
}
function submitApiKey() {
const key = keyInput.value.trim()
if (!key) return
apiKey.value = key
localStorage.setItem('admin_api_key', key)
showKeyDialog.value = false
fetchBypasses()
}
watch(showKeyDialog, (open) => {
if (!open && !apiKey.value) error.value = 'Admin API key required to manage bypasses'
})
async function fetchBypasses() {
if (!apiKey.value) {
promptForApiKey()
@@ -448,7 +316,7 @@ async function fetchBypasses() {
} else if (activeFilter.value === 'expired') {
params.append('include_expired', 'true')
}
if (typeFilter.value) {
if (typeFilter.value !== 'all') {
params.append('type', typeFilter.value)
}
@@ -476,8 +344,6 @@ async function submitBypass() {
if (!isFormValid.value) return
loading.value = true
error.value = null
successMessage.value = null
try {
if (editingBypass.value) {
@@ -495,7 +361,7 @@ async function submitBypass() {
},
}
)
successMessage.value = 'Bypass updated successfully'
toasts.success('Bypass updated')
} else {
// Create new bypass
await axios.post(
@@ -515,19 +381,14 @@ async function submitBypass() {
},
}
)
successMessage.value = 'Bypass created successfully'
toasts.success('Bypass created')
}
closeCreateModal()
await fetchBypasses()
// Clear success message after 5 seconds
setTimeout(() => {
successMessage.value = null
}, 5000)
} catch (err: any) {
console.error('Failed to submit bypass:', err)
error.value = err.response?.data?.error?.message || err.message || 'Failed to save bypass'
toasts.error('Could not save bypass', err.response?.data?.error?.message || err.message || 'Failed to save bypass')
} finally {
loading.value = false
}
@@ -550,19 +411,15 @@ function editBypass(bypass: Bypass) {
function closeCreateModal() {
showCreateModal.value = false
editingBypass.value = null
bypassForm.value = {
type: 'cve',
target: '',
reason: '',
created_by: '',
expires_in_hours: 168,
applies_to: '',
notify_on_expiry: false,
active: true,
}
}
// Also covers dismissal by Escape or the close button, so the next open never reuses an old edit.
watch(showCreateModal, (open) => {
if (open) return
editingBypass.value = null
bypassForm.value = { ...EMPTY_FORM }
})
function confirmDeleteBypass(bypass: Bypass) {
bypassToDelete.value = bypass
showDeleteModal.value = true
@@ -572,8 +429,6 @@ async function deleteBypass() {
if (!bypassToDelete.value) return
loading.value = true
error.value = null
successMessage.value = null
try {
await axios.delete(`/api/admin/bypasses/${bypassToDelete.value.id}`, {
@@ -582,18 +437,13 @@ async function deleteBypass() {
},
})
successMessage.value = 'Bypass deleted successfully'
toasts.success('Bypass deleted')
showDeleteModal.value = false
bypassToDelete.value = null
await fetchBypasses()
// Clear success message after 5 seconds
setTimeout(() => {
successMessage.value = null
}, 5000)
} catch (err: any) {
console.error('Failed to delete bypass:', err)
error.value = err.response?.data?.error?.message || err.message || 'Failed to delete bypass'
toasts.error('Could not delete bypass', err.response?.data?.error?.message || err.message || 'Failed to delete bypass')
} finally {
loading.value = false
}
@@ -603,7 +453,37 @@ function isExpired(expiresAt: string): boolean {
return new Date(expiresAt) < new Date()
}
function formatDate(date: string): string {
return new Date(date).toLocaleString()
const FILTER_OPTIONS = [
{ value: 'all', label: 'All' },
{ value: 'active', label: 'Active' },
{ value: 'expired', label: 'Expired' },
]
const TYPE_OPTIONS = [
{ value: 'all', label: 'All' },
{ value: 'cve', label: 'CVE' },
{ value: 'package', label: 'Package' },
]
const BYPASS_TYPE_OPTIONS = [
{ value: 'cve', label: 'CVE bypass' },
{ value: 'package', label: 'Package bypass' },
]
const bypassColumns: DataTableColumn<Bypass>[] = [
{ key: 'target', header: 'Target', rowHeader: true },
{ key: 'type', header: 'Type' },
{ key: 'status', header: 'Status', accessor: (b) => (b.active ? 'active' : 'inactive') },
{ key: 'reason', header: 'Reason' },
{ key: 'created_by', header: 'Created by' },
{ key: 'created_at', header: 'Created', accessor: (b) => formatDate(b.created_at) },
{ key: 'expires_at', header: 'Expires', accessor: (b) => formatDate(b.expires_at) },
{ key: 'applies_to', header: 'Applies to' },
{ key: 'actions', header: 'Actions', actions: true, accessor: () => '' },
]
function setExpiresInHours(value: string | number) {
bypassForm.value.expires_in_hours = Number(value)
}
</script>
+39 -45
View File
@@ -12,12 +12,12 @@ describe('Dashboard.vue', () => {
// Mock the fetch functions to prevent actual API calls
const store = usePackageStore()
vi.spyOn(store, 'fetchStats').mockResolvedValue()
vi.spyOn(store, 'fetchPackages').mockResolvedValue()
vi.spyOn(store, 'fetchRecentPackages').mockResolvedValue()
})
it('renders dashboard component', () => {
const wrapper = mount(Dashboard)
expect(wrapper.find('h2').text()).toBe('Dashboard')
expect(wrapper.find('h1').text()).toBe('Dashboard')
})
it('displays error message when error occurs', async () => {
@@ -57,9 +57,9 @@ describe('Dashboard.vue', () => {
}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Total Packages')
expect(wrapper.text()).toContain('Total Size')
expect(wrapper.text()).toContain('Total Downloads')
expect(wrapper.text()).toContain('Total packages')
expect(wrapper.text()).toContain('Total size')
expect(wrapper.text()).toContain('Total downloads')
})
it('displays total packages from stats', async () => {
@@ -127,7 +127,7 @@ describe('Dashboard.vue', () => {
const store = usePackageStore()
store.loading = false
store.packages = [
store.recentPackages = [
{
id: '1',
registry: 'npm',
@@ -141,25 +141,15 @@ describe('Dashboard.vue', () => {
]
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Recent Packages')
expect(wrapper.text()).toContain('Recent packages')
})
it('shows recent packages sorted by cached_at', async () => {
it('lists recent packages in the order the store holds them, newest first', async () => {
const wrapper = mount(Dashboard)
const store = usePackageStore()
store.loading = false
store.packages = [
{
id: '1',
registry: 'npm',
name: 'old-package',
version: '1.0.0',
size: 1024,
cached_at: '2025-01-01T00:00:00Z',
last_accessed: '2025-01-01T00:00:00Z',
download_count: 10,
},
store.recentPackages = [
{
id: '2',
registry: 'npm',
@@ -170,46 +160,33 @@ describe('Dashboard.vue', () => {
last_accessed: '2025-01-02T00:00:00Z',
download_count: 5,
},
{
id: '1',
registry: 'npm',
name: 'old-package',
version: '1.0.0',
size: 1024,
cached_at: '2025-01-01T00:00:00Z',
last_accessed: '2025-01-01T00:00:00Z',
download_count: 10,
},
]
await wrapper.vm.$nextTick()
const recentPackagesSection = wrapper.text().split('Recent Packages')[1]
const recentPackagesSection = wrapper.text().split('Recent packages')[1]
// new-package should appear before old-package since it's more recent
// The store sorts by cached_at; the view keeps that order
expect(recentPackagesSection.indexOf('new-package')).toBeLessThan(
recentPackagesSection.indexOf('old-package')
)
})
it('limits recent packages to 10 items', async () => {
const wrapper = mount(Dashboard)
const store = usePackageStore()
store.loading = false
store.packages = Array.from({ length: 15 }, (_, i) => ({
id: `${i}`,
registry: 'npm',
name: `package${i}`,
version: '1.0.0',
size: 1024,
cached_at: `2025-01-${String(i + 1).padStart(2, '0')}T00:00:00Z`,
last_accessed: `2025-01-${String(i + 1).padStart(2, '0')}T00:00:00Z`,
download_count: i,
}))
await wrapper.vm.$nextTick()
const recentSection = wrapper.text().split('Recent Packages')[1]
// Count how many "package" strings appear (each package has the word "package" in its name)
const packageCount = (recentSection.match(/package\d+/g) || []).length
expect(packageCount).toBeLessThanOrEqual(10)
})
it('handles empty packages array', async () => {
const wrapper = mount(Dashboard)
const store = usePackageStore()
store.loading = false
store.packages = []
store.recentPackages = []
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('0')
@@ -244,4 +221,21 @@ describe('Dashboard.vue', () => {
expect(wrapper.text()).toContain('999')
expect(wrapper.text()).toContain('777')
})
it('shows a neutral "Live updates paused" badge while the socket is down', async () => {
const wrapper = mount(Dashboard)
const badge = wrapper.find('[data-testid="ws-live-indicator"]')
expect(badge.text()).toBe('Live updates paused')
expect(badge.text()).not.toMatch(/offline/i)
expect(badge.attributes('data-tone')).toBe('neutral')
})
it('shows a "Live" badge once the socket is connected', async () => {
const wrapper = mount(Dashboard)
useRealtimeStore().connected = true
await wrapper.vm.$nextTick()
const badge = wrapper.find('[data-testid="ws-live-indicator"]')
expect(badge.text()).toBe('Live')
expect(badge.attributes('data-tone')).toBe('success')
})
})
+161 -264
View File
@@ -1,246 +1,146 @@
<template>
<div>
<div class="flex items-center justify-between mb-8">
<h2 class="text-3xl font-bold text-gray-900">Dashboard</h2>
<div
class="flex items-center gap-2 px-3 py-1 rounded-full border text-xs font-medium"
:class="
rt.connected
? 'bg-emerald-50 border-emerald-200 text-emerald-700'
: 'bg-gray-100 border-gray-200 text-gray-500'
"
data-testid="ws-live-indicator"
>
<span
class="w-2 h-2 rounded-full"
:class="rt.connected ? 'bg-emerald-500 animate-pulse' : 'bg-gray-400'"
></span>
{{ rt.connected ? 'Live' : 'Offline' }}
</div>
</div>
<div class="flex flex-col gap-6">
<PageHeader title="Dashboard" description="What the cache holds and what is moving through it.">
<template #actions>
<StatusBadge
:status="rt.connected ? 'live' : 'paused'"
:label="rt.connected ? 'Live' : 'Live updates paused'"
:tones="{ live: 'success', paused: 'neutral' }"
:pulse="rt.connected"
data-testid="ws-live-indicator"
/>
</template>
</PageHeader>
<!-- Error Alert -->
<Alert v-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<LoadingState v-if="loading" variant="kpi-grid" :columns="4" label="Loading statistics..." />
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading statistics...</p>
</div>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load statistics"
:message="error"
@retry="refresh"
/>
<!-- Stats Grid -->
<div v-else class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-10">
<Card class="border-0 shadow-lg hover:shadow-xl transition-shadow">
<CardContent class="p-6">
<div class="flex items-start justify-between">
<div class="space-y-2">
<p class="text-sm font-medium text-muted-foreground">Total Packages</p>
<p class="text-3xl font-bold text-foreground tracking-tight">
{{ formatNumber(displayStats?.total_packages || 0) }}
</p>
</div>
<div class="w-12 h-12 bg-slate-100 rounded-xl flex items-center justify-center">
<i class="fas fa-boxes text-slate-700 text-lg"></i>
</div>
</div>
</CardContent>
</Card>
<template v-else>
<StatGroup :columns="4" aria-label="Cache totals">
<KpiTile label="Total packages" :value="displayStats?.total_packages || 0" :icon="faBoxesStacked" />
<KpiTile label="Total size" :value="formatBytes(displayStats?.total_size || 0)" :icon="faHardDrive" />
<KpiTile label="Total downloads" :value="displayStats?.total_downloads || 0" :icon="faDownload" />
<KpiTile label="Scanned packages" :value="displayStats?.scanned_packages || 0" :icon="faShieldHalved" />
</StatGroup>
<Card class="border-0 shadow-lg hover:shadow-xl transition-shadow">
<CardContent class="p-6">
<div class="flex items-start justify-between">
<div class="space-y-2">
<p class="text-sm font-medium text-muted-foreground">Total Size</p>
<p class="text-3xl font-bold text-foreground tracking-tight">
{{ formatBytes(displayStats?.total_size || 0) }}
</p>
</div>
<div class="w-12 h-12 bg-sky-50 rounded-xl flex items-center justify-center">
<i class="fas fa-hard-drive text-sky-600 text-lg"></i>
</div>
</div>
</CardContent>
</Card>
<Card class="border-0 shadow-lg hover:shadow-xl transition-shadow">
<CardContent class="p-6">
<div class="flex items-start justify-between">
<div class="space-y-2">
<p class="text-sm font-medium text-muted-foreground">Total Downloads</p>
<p class="text-3xl font-bold text-foreground tracking-tight">
{{ formatNumber(displayStats?.total_downloads || 0) }}
</p>
</div>
<div class="w-12 h-12 bg-emerald-50 rounded-xl flex items-center justify-center">
<i class="fas fa-download text-emerald-600 text-lg"></i>
</div>
</div>
</CardContent>
</Card>
<Card class="border-0 shadow-lg hover:shadow-xl transition-shadow">
<CardContent class="p-6">
<div class="flex items-start justify-between">
<div class="space-y-2">
<p class="text-sm font-medium text-muted-foreground">Scanned Packages</p>
<p class="text-3xl font-bold text-foreground tracking-tight">
{{ formatNumber(displayStats?.scanned_packages || 0) }}
</p>
</div>
<div class="w-12 h-12 bg-violet-50 rounded-xl flex items-center justify-center">
<i class="fas fa-shield-alt text-violet-600 text-lg"></i>
</div>
</div>
</CardContent>
</Card>
</div>
<!-- Realtime Feed -->
<Card v-if="recentRealtimeEvents.length > 0" class="border-0 shadow-lg mb-10" data-testid="ws-event-feed">
<CardContent class="p-6">
<h3 class="text-xl font-semibold text-foreground mb-4">
<i class="fas fa-bolt mr-2 text-amber-500"></i>Live Activity
</h3>
<ul class="space-y-2">
<li
v-for="(evt, idx) in recentRealtimeEvents"
:key="`${evt.timestamp}-${idx}`"
class="flex items-center gap-3 text-sm"
>
<component :is="iconForEvent(evt.type)" class="w-4 h-4 text-muted-foreground" />
<span class="font-medium">{{ labelForEvent(evt.type) }}</span>
<span class="text-muted-foreground truncate">
{{ describeEvent(evt) }}
</span>
<span class="ml-auto text-xs text-muted-foreground">
{{ formatTimestamp(evt.timestamp) }}
</span>
</li>
</ul>
<Card v-if="recentRealtimeEvents.length > 0" data-testid="ws-event-feed">
<CardHeader>
<CardTitle as="h2">Live activity</CardTitle>
</CardHeader>
<CardContent>
<ActivityFeed :events="feedEvents" variant="compact" label="Live activity" />
</CardContent>
</Card>
<!-- Downloads Chart -->
<Card class="border-0 shadow-lg mb-10">
<CardContent class="p-6">
<div class="flex items-center justify-between mb-6">
<h3 class="text-xl font-semibold text-foreground">Download Activity</h3>
<div class="flex gap-2">
<Button
v-for="period in chartPeriods"
:key="period.value"
@click="selectedPeriod = period.value"
:variant="selectedPeriod === period.value ? 'default' : 'outline'"
size="sm"
>
{{ period.label }}
</Button>
</div>
</div>
<div class="h-64 flex items-end justify-between gap-2">
<div
v-for="(value, index) in chartData"
:key="index"
class="flex-1 flex flex-col items-center gap-2"
>
<div class="w-full bg-slate-100 rounded-t-lg relative" :style="{ height: `${(value / maxChartValue) * 100}%` }">
<div class="absolute inset-0 bg-gradient-to-t from-slate-700 to-slate-500 rounded-t-lg"></div>
</div>
<span class="text-xs text-muted-foreground">{{ getChartLabel(index) }}</span>
</div>
</div>
<div v-if="chartLoading || chartData.length === 0" class="mt-4 text-center">
<p class="text-sm text-muted-foreground">
<i class="fas fa-info-circle mr-1"></i>
{{ chartLoading ? 'Loading chart data...' : 'No download activity in this period' }}
</p>
</div>
<Card>
<CardHeader>
<CardTitle as="h2">Download activity</CardTitle>
<CardAction>
<SegmentedControl v-model="selectedPeriod" :options="chartPeriods" aria-label="Period" />
</CardAction>
</CardHeader>
<CardContent>
<LoadingState
v-if="chartLoading && chartData.length === 0"
layout="inline"
label="Loading chart data..."
/>
<ErrorState
v-else-if="chartError"
variant="inline"
title="Could not load download activity"
:message="chartError"
@retry="fetchTimeSeriesData"
/>
<BarChart
v-else
:labels="chartLabels"
:series="[{ name: 'Downloads', data: chartData }]"
label="Downloads over the selected period"
empty-text="No download activity in this period"
/>
</CardContent>
</Card>
<!-- Recent Packages -->
<Card><CardContent class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-4">
<i class="fas fa-clock mr-2"></i>Recent Packages
</h3>
<div v-if="packages.length === 0" class="text-center py-8 text-gray-500">
<i class="fas fa-inbox text-4xl mb-4"></i>
<p>No packages cached yet</p>
</div>
<div v-else class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead>
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Package
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Version
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Registry
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Size
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
Downloads
</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr v-for="pkg in recentPackages" :key="pkg.id">
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
{{ pkg.name }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ pkg.version }}
</td>
<td class="px-6 py-4 whitespace-nowrap">
<Badge variant="outline" :class="getRegistryBadgeClass(pkg.registry)">
{{ pkg.registry }}
</Badge>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ formatBytes(pkg.size) }}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{{ formatNumber(pkg.download_count) }}
</td>
</tr>
</tbody>
</table>
</div>
<Card>
<CardHeader>
<CardTitle as="h2">Recent packages</CardTitle>
</CardHeader>
<CardContent>
<EmptyState
v-if="recentPackages.length === 0"
size="sm"
:icon="faBoxOpen"
title="No packages cached yet"
description="Packages appear here once they are downloaded through the proxy."
/>
<DataTable
v-else
label="Recent packages"
layout="cards"
:columns="packageColumns"
:rows="recentPackages"
>
<template #cell-registry="{ row }">
<Badge variant="outline">{{ row.registry }}</Badge>
</template>
</DataTable>
</CardContent>
</Card>
</template>
</div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref, watch, type Component } from 'vue'
import { computed, onMounted, ref, watch } from 'vue'
import { storeToRefs } from 'pinia'
import axios from 'axios'
import {
Package as PackageIcon,
Download as DownloadIcon,
Trash2 as TrashIcon,
ShieldCheck as ShieldIcon,
Activity as ActivityIcon,
} from 'lucide-vue-next'
import { usePackageStore } from '../stores/packages'
ActivityFeed,
BarChart,
Badge,
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
DataTable,
EmptyState,
ErrorState,
KpiTile,
LoadingState,
PageHeader,
SegmentedControl,
StatGroup,
StatusBadge,
type ActivityEvent,
type DataTableColumn,
} from '@perfect-design/ui'
import type { IconDefinition } from '@perfect-design/ui/lib/icons-tools'
import { usePackageStore, type Package } from '../stores/packages'
import { useRealtimeStore } from '../stores/realtime'
import type { EventType, RealtimeEvent } from '@/lib/ws'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Card, CardContent } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { getRegistryBadgeClass } from '@/composables/useBadgeStyles'
import { displayVersion, formatBytes, formatNumber, withVersionPrefix } from '@/lib/format'
import {
faBox,
faBoxOpen,
faBoxesStacked,
faChartLine,
faDownload,
faHardDrive,
faShieldHalved,
faTrash,
} from '@/lib/icons'
const store = usePackageStore()
const { packages, stats, loading, error } = storeToRefs(store)
const { recentPackages, stats, loading, error } = storeToRefs(store)
const rt = useRealtimeStore()
const { lastStats, events: rtEvents } = storeToRefs(rt)
@@ -261,18 +161,28 @@ const EVENT_LABELS: Record<EventType, string> = {
stats_update: 'Stats update',
}
const EVENT_ICONS: Record<EventType, Component> = {
package_cached: PackageIcon,
package_deleted: TrashIcon,
package_downloaded: DownloadIcon,
scan_complete: ShieldIcon,
stats_update: ActivityIcon,
const EVENT_ICONS: Record<EventType, IconDefinition> = {
package_cached: faBox,
package_deleted: faTrash,
package_downloaded: faDownload,
scan_complete: faShieldHalved,
stats_update: faChartLine,
}
function iconForEvent(type: EventType): Component {
return EVENT_ICONS[type] ?? ActivityIcon
function iconForEvent(type: EventType): IconDefinition {
return EVENT_ICONS[type] ?? faChartLine
}
const feedEvents = computed<ActivityEvent[]>(() =>
recentRealtimeEvents.value.map((evt, idx) => ({
id: `${evt.timestamp}-${idx}`,
action: labelForEvent(evt.type),
target: describeEvent(evt) || undefined,
time: evt.timestamp,
icon: iconForEvent(evt.type),
})),
)
function labelForEvent(type: EventType): string {
return EVENT_LABELS[type] ?? type
}
@@ -280,25 +190,21 @@ function labelForEvent(type: EventType): string {
function describeEvent(evt: RealtimeEvent): string {
const p = evt.payload
const name = typeof p.name === 'string' ? p.name : ''
const version = typeof p.version === 'string' ? `@${p.version}` : ''
const shown = typeof p.release_version === 'string' && p.release_version ? p.release_version : p.version
const version = typeof shown === 'string' ? `@${shown}` : ''
const registry = typeof p.registry === 'string' ? `[${p.registry}] ` : ''
if (evt.type === 'stats_update') return ''
if (name) return `${registry}${name}${version}`
return ''
}
function formatTimestamp(ts: number): string {
if (!ts) return ''
return new Date(ts).toLocaleTimeString()
}
// Chart periods and data
const selectedPeriod = ref<string>('1day')
const chartPeriods = [
{ value: '1h', label: '1 Hour' },
{ value: '1day', label: '24 Hours' },
{ value: '7day', label: '7 Days' },
{ value: '30day', label: '30 Days' },
{ value: '1h', label: '1 hour' },
{ value: '1day', label: '24 hours' },
{ value: '7day', label: '7 days' },
{ value: '30day', label: '30 days' },
]
// Time-series data from API
@@ -315,16 +221,19 @@ interface TimeSeriesStats {
const timeSeriesData = ref<TimeSeriesStats | null>(null)
const chartLoading = ref(false)
const chartError = ref<string | null>(null)
// Fetch time-series data from API
async function fetchTimeSeriesData() {
chartLoading.value = true
chartError.value = null
try {
const response = await axios.get(`/api/stats/timeseries?period=${selectedPeriod.value}`)
timeSeriesData.value = response.data
} catch (err) {
console.error('Failed to fetch time-series data:', err)
timeSeriesData.value = null
chartError.value = err instanceof Error ? err.message : 'Failed to load download activity'
} finally {
chartLoading.value = false
}
@@ -338,11 +247,20 @@ const chartData = computed(() => {
return timeSeriesData.value.data_points.map(point => point.value)
})
const maxChartValue = computed(() => {
if (chartData.value.length === 0) return 100
const max = Math.max(...chartData.value)
return max === 0 ? 100 : max
})
const chartLabels = computed(() => chartData.value.map((_, index) => getChartLabel(index)))
const packageColumns: DataTableColumn<Package>[] = [
{ key: 'name', header: 'Package', rowHeader: true },
{ key: 'version', header: 'Version', accessor: (pkg) => withVersionPrefix(displayVersion(pkg)) },
{ key: 'registry', header: 'Registry' },
{ key: 'size', header: 'Size', numeric: true, accessor: (pkg) => formatBytes(pkg.size) },
{ key: 'download_count', header: 'Downloads', numeric: true, accessor: (pkg) => formatNumber(pkg.download_count) },
]
function refresh() {
void store.fetchStats()
void store.fetchRecentPackages()
}
function getChartLabel(index: number): string {
// Use timestamp from data if available
@@ -373,14 +291,6 @@ function getChartLabel(index: number): string {
return labels[selectedPeriod.value]?.(index) || `${index}`
}
// API returns clean, deduplicated data - just sort and limit
const recentPackages = computed(() => {
return packages.value
.slice()
.sort((a, b) => new Date(b.cached_at).getTime() - new Date(a.cached_at).getTime())
.slice(0, 10)
})
// Watch for period changes and fetch new data
watch(selectedPeriod, () => {
fetchTimeSeriesData()
@@ -391,20 +301,7 @@ onMounted(async () => {
// initial polling resolves. Singleton survives navigation, so we
// intentionally do not disconnect on unmount.
rt.connect()
await store.fetchStats()
await store.fetchPackages()
await fetchTimeSeriesData()
await Promise.all([store.fetchStats(), store.fetchRecentPackages(), fetchTimeSeriesData()])
})
function formatNumber(num: number): string {
return new Intl.NumberFormat().format(num)
}
function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i]
}
</script>
+26
View File
@@ -0,0 +1,26 @@
<template>
<div class="flex flex-col gap-6">
<PageHeader title="Page not found" />
<EmptyState
title-as="h2"
size="lg"
:icon="faMagnifyingGlass"
title="No page at this address"
:description="`Nothing lives at ${route.path}.`"
>
<template #action>
<Button as-child>
<RouterLink to="/">Back to the dashboard</RouterLink>
</Button>
</template>
</EmptyState>
</div>
</template>
<script setup lang="ts">
import { RouterLink, useRoute } from 'vue-router'
import { Button, EmptyState, PageHeader } from '@perfect-design/ui'
import { faMagnifyingGlass } from '@/lib/icons'
const route = useRoute()
</script>
+154 -272
View File
@@ -1,250 +1,154 @@
<template>
<div class="max-w-7xl mx-auto px-4 py-8">
<!-- Header with Back Button -->
<div class="mb-6">
<Button @click="goBack" variant="ghost" class="mb-4">
<i class="fas fa-arrow-left mr-2"></i>
Back to Packages
</Button>
<div class="flex items-center gap-3">
<i class="fas fa-box text-3xl text-primary-600"></i>
<div>
<h1 class="text-3xl font-bold text-gray-900">{{ packageName }}</h1>
<div class="flex items-center gap-2 mt-2">
<Badge :class="getRegistryBadgeClass(registry)">{{ registry }}</Badge>
<Badge variant="outline" class="font-mono">v{{ version }}</Badge>
</div>
</div>
</div>
</div>
<div class="flex flex-col gap-6">
<PageHeader :title="packageName">
<template #back>
<Button variant="ghost" size="sm" :icon-start="faArrowLeft" @click="goBack">Back to packages</Button>
</template>
<template #description>
<span class="flex flex-wrap items-center gap-2">
<Badge variant="outline">{{ registry }}</Badge>
<Badge variant="outline" class="font-mono">{{ withVersionPrefix(shownVersion) }}</Badge>
</span>
</template>
</PageHeader>
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading vulnerability details...</p>
</div>
<LoadingState v-if="loading" variant="card" label="Loading vulnerability details..." />
<!-- Error State -->
<Alert v-else-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load vulnerability details"
:message="error"
@retry="fetchVulnerabilities"
/>
<!-- Vulnerability Details -->
<div v-else-if="vulnerabilities" class="space-y-6">
<!-- Summary Card -->
<template v-else-if="vulnerabilities">
<Card>
<CardHeader>
<CardTitle class="flex items-center gap-2">
<i class="fas fa-shield-virus text-red-600"></i>
Security Scan Summary
</CardTitle>
<CardTitle as="h2">Security scan summary</CardTitle>
</CardHeader>
<CardContent>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-4">
<div class="text-center p-4 bg-red-50 rounded-lg border border-red-200">
<p class="text-3xl font-bold text-red-600">{{ severityCounts.critical }}</p>
<p class="text-sm text-gray-600 mt-1">Critical</p>
</div>
<div class="text-center p-4 bg-orange-50 rounded-lg border border-orange-200">
<p class="text-3xl font-bold text-orange-600">{{ severityCounts.high }}</p>
<p class="text-sm text-gray-600 mt-1">High</p>
</div>
<div class="text-center p-4 bg-yellow-50 rounded-lg border border-yellow-200">
<p class="text-3xl font-bold text-yellow-600">{{ severityCounts.moderate }}</p>
<p class="text-sm text-gray-600 mt-1">Moderate</p>
</div>
<div class="text-center p-4 bg-blue-50 rounded-lg border border-blue-200">
<p class="text-3xl font-bold text-blue-600">{{ severityCounts.low }}</p>
<p class="text-sm text-gray-600 mt-1">Low</p>
</div>
</div>
<Separator class="my-4" />
<div class="flex items-center justify-between text-sm">
<div class="flex flex-col gap-3">
<span class="text-gray-600">
<i class="fas fa-search mr-1"></i>
Scanned: {{ formatDate(vulnerabilities.scanned_at) }}
<CardContent class="flex flex-col gap-4">
<SeveritySummary :counts="severityCounts" label="Vulnerabilities by severity" />
<DescriptionList variant="inline" divided>
<DescriptionItem term="Scanned">{{ formatDate(vulnerabilities.scanned_at) }}</DescriptionItem>
<DescriptionItem term="Scanners">
<span class="flex flex-wrap gap-1">
<Badge v-for="scanner in scannerList" :key="scanner" variant="secondary">{{ scanner }}</Badge>
</span>
<div class="flex items-center gap-2">
<span class="text-gray-600">
<i class="fas fa-cog mr-1"></i>
Scanners:
</span>
<div class="flex flex-wrap gap-1">
<Badge
v-for="scanner in scannerList"
:key="scanner"
variant="secondary"
class="text-xs"
>
{{ scanner }}
</Badge>
</div>
</div>
</div>
<div v-if="bypassedCount > 0" class="flex items-center gap-2 text-green-600">
<i class="fas fa-check-circle"></i>
<span>{{ bypassedCount }} bypassed</span>
</div>
</div>
</DescriptionItem>
<DescriptionItem v-if="bypassedCount > 0" term="Bypassed">
<StatusBadge status="bypassed" :label="`${bypassedCount} bypassed`" :tones="{ bypassed: 'success' }" />
</DescriptionItem>
</DescriptionList>
</CardContent>
</Card>
<!-- No Vulnerabilities -->
<Card v-if="vulnerabilityList.length === 0">
<CardContent class="text-center py-12">
<i class="fas fa-check-circle text-6xl text-green-500 mb-4"></i>
<p class="text-xl font-semibold text-gray-900">No Vulnerabilities Found</p>
<p class="mt-2 text-gray-600">This package is clean and safe to use</p>
<CardContent>
<EmptyState
tone="success"
:icon="faCircleCheck"
title="No vulnerabilities found"
description="The scanners reported nothing for this package version."
/>
</CardContent>
</Card>
<!-- Vulnerability List -->
<Card v-else>
<CardHeader>
<CardTitle class="flex items-center gap-2">
<i class="fas fa-list text-gray-600"></i>
Detected Vulnerabilities ({{ vulnerabilityList.length }})
</CardTitle>
<CardTitle as="h2">Detected vulnerabilities ({{ vulnerabilityList.length }})</CardTitle>
</CardHeader>
<CardContent class="p-0">
<div class="border-t overflow-x-auto">
<Table class="min-w-[800px]">
<TableHeader>
<TableRow class="bg-gray-50 hover:bg-gray-50">
<TableHead class="w-[100px]">Severity</TableHead>
<TableHead class="w-[180px]">CVE ID</TableHead>
<TableHead>Description</TableHead>
<TableHead class="w-[120px]">Fix Version</TableHead>
<TableHead class="w-[100px] text-center">Details</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<template v-for="(vuln, index) in vulnerabilityList" :key="vuln.id">
<!-- Main Row -->
<TableRow
:class="getRowClass(index, vuln.severity)"
@click="toggleRow(index)"
>
<TableCell>
<Badge :class="getSeverityBadgeClass(vuln.severity)">
{{ formatSeverityName(vuln.severity) }}
</Badge>
<span
<CardContent>
<Table label="Detected vulnerabilities" layout="cards">
<TableHeader>
<TableRow>
<TableHead>Severity</TableHead>
<TableHead>CVE ID</TableHead>
<TableHead>Description</TableHead>
<TableHead>Fix version</TableHead>
<TableHead align="center">Details</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<template v-for="(vuln, index) in vulnerabilityList" :key="vuln.id">
<TableRow class="cursor-pointer" :selected="expandedRows.has(index)" @click="toggleRow(index)">
<TableCell label="Severity">
<span class="flex flex-wrap items-center gap-2">
<StatusBadge
:status="vuln.severity"
:tones="SEVERITY_TONES"
:label="formatSeverityName(vuln.severity)"
/>
<StatusBadge
v-if="vuln.bypassed"
class="ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800"
title="Bypassed"
>
<i class="fas fa-unlock text-xs"></i>
</span>
</TableCell>
<TableCell>
<span class="font-mono text-sm font-medium">{{ vuln.id }}</span>
</TableCell>
<TableCell>
<p class="text-sm text-gray-900 line-clamp-2 break-words">{{ vuln.title || vuln.description }}</p>
</TableCell>
<TableCell>
<span v-if="vuln.fixed_in" class="inline-flex items-center text-sm text-green-700">
<i class="fas fa-arrow-up text-xs mr-1"></i>
v{{ vuln.fixed_in }}
</span>
<span v-else class="text-sm text-gray-400">-</span>
</TableCell>
<TableCell class="text-center">
<Button
variant="ghost"
size="sm"
class="h-8 w-8 p-0"
@click.stop="toggleRow(index)"
>
<i
:class="[
'fas transition-transform',
expandedRows.has(index) ? 'fa-chevron-up' : 'fa-chevron-down'
]"
></i>
</Button>
</TableCell>
</TableRow>
status="bypassed"
label="Bypassed"
:tones="{ bypassed: 'success' }"
/>
</span>
</TableCell>
<TableCell label="CVE ID" class="font-mono font-medium">{{ vuln.id }}</TableCell>
<TableCell label="Description">
<p class="m-0 line-clamp-2 break-words">{{ vuln.title || vuln.description }}</p>
</TableCell>
<TableCell label="Fix version">
<span v-if="vuln.fixed_in">v{{ vuln.fixed_in }}</span>
<span v-else class="text-muted-foreground">-</span>
</TableCell>
<TableCell label="Details" align="center">
<IconButton
size="icon-sm"
:icon="expandedRows.has(index) ? faChevronUp : faChevronDown"
:label="`${expandedRows.has(index) ? 'Hide' : 'Show'} details for ${vuln.id}`"
:aria-expanded="expandedRows.has(index)"
@click.stop="toggleRow(index)"
/>
</TableCell>
</TableRow>
<!-- Expanded Details Row -->
<TableRow v-if="expandedRows.has(index)" class="bg-gray-50 hover:bg-gray-50">
<TableCell colspan="5" class="p-0">
<div class="px-6 py-4 space-y-3">
<!-- Full Description -->
<div>
<h5 class="font-semibold text-gray-900 mb-2">Description</h5>
<div
class="text-sm text-gray-700 leading-relaxed prose prose-sm max-w-none break-words overflow-hidden"
v-html="renderMarkdown(vuln.description)"
></div>
</div>
<TableRow v-if="expandedRows.has(index)" :hoverable="false">
<TableCell :colspan="5">
<div class="flex flex-col gap-4 py-2">
<section>
<h3 class="mb-2 text-sm font-semibold">Description</h3>
<Markdown :source="vuln.description" :heading-offset="3" />
</section>
<!-- Bypass Information -->
<div v-if="vuln.bypassed && vuln.bypass" class="bg-green-50 border border-green-200 rounded-lg p-3">
<h5 class="font-semibold text-green-900 mb-2 flex items-center gap-2">
<i class="fas fa-info-circle"></i>
Bypass Active
</h5>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm text-green-800">
<div class="break-words">
<span class="font-medium">Reason:</span> {{ vuln.bypass.reason }}
</div>
<div class="break-words">
<span class="font-medium">By:</span> {{ vuln.bypass.created_by }}
</div>
<div class="break-words">
<span class="font-medium">Expires:</span> {{ formatDate(vuln.bypass.expires_at) }}
</div>
</div>
</div>
<Alert v-if="vuln.bypassed && vuln.bypass" variant="success">
<AlertTitle>Bypass active</AlertTitle>
<AlertDescription>
<DescriptionList variant="grid" :columns="3" size="sm">
<DescriptionItem term="Reason">{{ vuln.bypass.reason }}</DescriptionItem>
<DescriptionItem term="By">{{ vuln.bypass.created_by }}</DescriptionItem>
<DescriptionItem term="Expires">{{ formatDate(vuln.bypass.expires_at) }}</DescriptionItem>
</DescriptionList>
</AlertDescription>
</Alert>
<!-- Fix Information -->
<div v-if="vuln.fixed_in" class="bg-blue-50 border border-blue-200 rounded-lg p-3">
<div class="flex items-center gap-2">
<i class="fas fa-wrench text-blue-700"></i>
<span class="text-sm text-blue-900">
<span class="font-semibold">Fix Available:</span> Upgrade to version <strong>{{ vuln.fixed_in }}</strong> or later
</span>
</div>
</div>
<Alert v-if="vuln.fixed_in" variant="info">
<AlertTitle>Fix available</AlertTitle>
<AlertDescription>
Upgrade to version <strong>{{ vuln.fixed_in }}</strong> or later.
</AlertDescription>
</Alert>
<!-- References -->
<div v-if="vuln.references && vuln.references.length > 0">
<h5 class="font-semibold text-gray-900 mb-2 flex items-center gap-2">
<i class="fas fa-link"></i>
References ({{ vuln.references.length }})
</h5>
<div class="space-y-1.5">
<div
v-for="(ref, refIndex) in vuln.references"
:key="refIndex"
class="flex items-start gap-2 text-sm"
>
<i class="fas fa-external-link-alt text-gray-400 text-xs mt-0.5"></i>
<a
:href="ref"
target="_blank"
rel="noopener noreferrer"
class="text-blue-600 hover:text-blue-800 hover:underline break-all"
>
{{ ref }}
</a>
</div>
</div>
</div>
</div>
</TableCell>
</TableRow>
</template>
</TableBody>
</Table>
</div>
<section v-if="vuln.references && vuln.references.length > 0">
<h3 class="mb-2 text-sm font-semibold">References ({{ vuln.references.length }})</h3>
<ul class="m-0 flex list-none flex-col gap-1 p-0 text-sm">
<li v-for="(ref, refIndex) in vuln.references" :key="refIndex" class="break-all">
<Link :href="ref" external>{{ ref }}</Link>
</li>
</ul>
</section>
</div>
</TableCell>
</TableRow>
</template>
</TableBody>
</Table>
</CardContent>
</Card>
</div>
</template>
</div>
</template>
@@ -252,32 +156,37 @@
import { ref, computed, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import axios from 'axios'
import { marked } from 'marked'
import { Button } from '@/components/ui/button'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Separator } from '@/components/ui/separator'
import {
Alert,
AlertDescription,
AlertTitle,
Badge,
Button,
Card,
CardContent,
CardHeader,
CardTitle,
DescriptionItem,
DescriptionList,
EmptyState,
ErrorState,
IconButton,
Link,
LoadingState,
Markdown,
PageHeader,
StatusBadge,
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/components/ui/table'
import {
getSeverityBadgeClass,
getRegistryBadgeClass,
getVulnerabilityBorderClass,
formatSeverityName,
} from '@/composables/useBadgeStyles'
// Configure marked
marked.setOptions({
breaks: true,
gfm: true,
})
} from '@perfect-design/ui'
import SeveritySummary from './SeveritySummary.vue'
import { formatDate, withVersionPrefix } from '@/lib/format'
import { faArrowLeft, faChevronDown, faChevronUp, faCircleCheck } from '@/lib/icons'
import { NO_VULNERABILITIES, SEVERITY_TONES, formatSeverityName, severityRank } from '@/lib/severity'
const router = useRouter()
const route = useRoute()
@@ -292,6 +201,7 @@ const packageName = computed(() => {
return nameParam as string
})
const version = computed(() => route.params.version as string)
const shownVersion = computed(() => vulnerabilities.value?.package?.release_version || version.value)
interface BypassInfo {
id: string
@@ -312,6 +222,7 @@ interface Vulnerability {
}
interface VulnerabilityResponse {
package?: { release_version?: string }
scanned: boolean
scanner: string
scanned_at: string
@@ -332,27 +243,15 @@ const error = ref<string | null>(null)
const vulnerabilities = ref<VulnerabilityResponse | null>(null)
const expandedRows = ref<Set<number>>(new Set())
// Severity order for sorting (higher values = more severe)
const severityOrder: Record<string, number> = {
CRITICAL: 4,
HIGH: 3,
MEDIUM: 2,
MODERATE: 2, // Treat MODERATE same as MEDIUM
LOW: 1,
UNKNOWN: 0,
}
const vulnerabilityList = computed(() => {
const vulns = vulnerabilities.value?.vulnerabilities || []
// Sort by severity (most severe first)
return [...vulns].sort((a, b) => {
const severityA = severityOrder[a.severity.toUpperCase()] || 0
const severityB = severityOrder[b.severity.toUpperCase()] || 0
return severityB - severityA // Descending order
return severityRank(b.severity) - severityRank(a.severity)
})
})
const severityCounts = computed(() => vulnerabilities.value?.severity_counts || { critical: 0, high: 0, moderate: 0, low: 0 })
const severityCounts = computed(() => vulnerabilities.value?.severity_counts || NO_VULNERABILITIES)
const bypassedCount = computed(() => vulnerabilities.value?.bypassed_count || 0)
// Parse scanner string into array of scanner names
@@ -396,21 +295,4 @@ function toggleRow(index: number) {
}
}
function getRowClass(index: number, severity: string): string {
const classes = ['cursor-pointer']
if (expandedRows.value.has(index)) {
classes.push('bg-gray-50')
}
classes.push(getVulnerabilityBorderClass(severity))
return classes.join(' ')
}
function formatDate(date: string): string {
return new Date(date).toLocaleString()
}
function renderMarkdown(text: string): string {
if (!text) return ''
return marked.parse(text) as string
}
</script>
+133 -32
View File
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import { createRouter, createMemoryHistory, type Router } from 'vue-router'
@@ -6,6 +6,14 @@ import { defineComponent, h } from 'vue'
import PackageList from './PackageList.vue'
import { usePackageStore } from '../stores/packages'
type Row = ReturnType<typeof usePackageStore>['packagePage']['packages'][number]
// A page as the server sends it: whole groups, flattened to rows.
function setRows(store: ReturnType<typeof usePackageStore>, packages: Row[]) {
const groups = new Set(packages.map((p) => `${p.registry}:${p.name}`))
store.packagePage = { packages, totalGroups: groups.size, page: 1, pageSize: 25 }
}
const Stub = defineComponent({ render: () => h('div') })
function createTestRouter(): Router {
@@ -41,12 +49,12 @@ describe('PackageList.vue', () => {
setActivePinia(createPinia())
// Prevent real network calls from store actions on mount
const store = usePackageStore()
vi.spyOn(store, 'fetchPackages').mockResolvedValue()
vi.spyOn(store, 'fetchPackagePage').mockResolvedValue()
})
it('renders package list component', async () => {
const wrapper = await mountWithRouter()
expect(wrapper.find('h2').text()).toBe('Packages')
expect(wrapper.find('h1').text()).toBe('Packages')
})
it('displays loading state when loading', async () => {
@@ -74,7 +82,7 @@ describe('PackageList.vue', () => {
const store = usePackageStore()
store.loading = false
store.packages = []
setRows(store, [])
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('No packages cached yet')
@@ -85,7 +93,7 @@ describe('PackageList.vue', () => {
const store = usePackageStore()
store.loading = false
store.packages = [
setRows(store, [
{
id: '1',
registry: 'npm',
@@ -96,17 +104,17 @@ describe('PackageList.vue', () => {
last_accessed: '2025-01-01T00:00:00Z',
download_count: 10,
},
]
])
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('test-package')
expect(wrapper.text()).toContain('1 version')
})
it('calls fetchPackages on mount', async () => {
it('asks the server for the first page on mount', async () => {
const store = usePackageStore()
// beforeEach already spied with mockResolvedValue; reuse that spy
const fetchSpy = store.fetchPackages as ReturnType<typeof vi.spyOn>
const fetchSpy = store.fetchPackagePage as ReturnType<typeof vi.spyOn>
fetchSpy.mockClear()
await mountWithRouter()
@@ -119,7 +127,7 @@ describe('PackageList.vue', () => {
const store = usePackageStore()
store.loading = false
store.packages = [
setRows(store, [
{
id: '1',
registry: 'npm',
@@ -140,7 +148,7 @@ describe('PackageList.vue', () => {
last_accessed: '2025-01-02T00:00:00Z',
download_count: 20,
},
]
])
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('test-package')
@@ -152,7 +160,7 @@ describe('PackageList.vue', () => {
const store = usePackageStore()
store.loading = false
store.packages = [
setRows(store, [
{
id: '1',
registry: 'npm',
@@ -163,18 +171,28 @@ describe('PackageList.vue', () => {
last_accessed: '2025-01-01T00:00:00Z',
download_count: 10,
},
]
])
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('1 MB')
})
it('applies correct registry badge classes', async () => {
it('prints every registry as a badge with its name', async () => {
const wrapper = await mountWithRouter()
const store = usePackageStore()
store.loading = false
store.packages = [
setRows(store, [
{
id: '3',
registry: 'go',
name: 'go-module',
version: '1.0.0',
size: 1024,
cached_at: '2025-01-01T00:00:00Z',
last_accessed: '2025-01-01T00:00:00Z',
download_count: 3,
},
{
id: '1',
registry: 'npm',
@@ -195,30 +213,113 @@ describe('PackageList.vue', () => {
last_accessed: '2025-01-01T00:00:00Z',
download_count: 5,
},
{
id: '3',
registry: 'go',
name: 'go-module',
version: '1.0.0',
size: 1024,
cached_at: '2025-01-01T00:00:00Z',
last_accessed: '2025-01-01T00:00:00Z',
download_count: 3,
},
]
])
await wrapper.vm.$nextTick()
// Verify that all registry badges are displayed
// Packages are grouped and sorted alphabetically, so order is: go-module, npm-package, python-package
// The server sends groups in name order: go-module, npm-package, python-package
expect(wrapper.text()).toContain('npm')
expect(wrapper.text()).toContain('pypi')
expect(wrapper.text()).toContain('go')
// Verify badge component is used with correct classes
// (matches getRegistryBadgeClass in src/composables/useBadgeStyles.ts)
const html = wrapper.html()
expect(html).toContain('bg-red-100') // npm badge
expect(html).toContain('bg-blue-100') // pypi badge
expect(html).toContain('bg-cyan-100') // go badge
// Each registry is printed as text in an outline badge, never as colour alone.
const badges = wrapper.findAll('[data-slot="badge"]').map((badge) => badge.text())
expect(badges).toEqual(['go', 'npm', 'pypi'])
})
it('shows the release version for a PyPI file row, not the file name', async () => {
const wrapper = await mountWithRouter()
const store = usePackageStore()
setRows(store, [
{
id: '1',
registry: 'pypi',
name: 'six',
version: 'six-1.17.0-py2.py3-none-any.whl',
release_version: '1.17.0',
size: 1,
cached_at: '2026-11-23T00:00:00Z',
last_accessed: '2026-11-23T00:00:00Z',
download_count: 0,
},
])
await wrapper.vm.$nextTick()
await wrapper.find('button[aria-expanded]').trigger('click')
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('v1.17.0')
expect(wrapper.text()).not.toContain('py2.py3-none-any.whl')
})
describe('server-side paging, search and registry filter', () => {
beforeEach(() => {
vi.useFakeTimers()
})
afterEach(() => {
vi.useRealTimers()
})
it('debounces the search box into one request with q and page 1', async () => {
const wrapper = await mountWithRouter()
const store = usePackageStore()
const fetchSpy = store.fetchPackagePage as ReturnType<typeof vi.spyOn>
fetchSpy.mockClear()
const input = wrapper.find('input[type="search"], input')
await input.setValue('l')
await input.setValue('le')
await input.setValue('left')
expect(fetchSpy).not.toHaveBeenCalled()
await vi.advanceTimersByTimeAsync(300)
expect(fetchSpy).toHaveBeenCalledTimes(1)
expect(fetchSpy).toHaveBeenCalledWith({ page: 1, pageSize: 25, registry: 'all', q: 'left' })
})
it('sends the registry of the route with every request', async () => {
const router = createTestRouter()
router.push('/packages/pypi')
await router.isReady()
const store = usePackageStore()
const fetchSpy = store.fetchPackagePage as ReturnType<typeof vi.spyOn>
fetchSpy.mockClear()
mount(PackageList, { props: { registry: 'pypi' }, global: { plugins: [router] } })
expect(fetchSpy).toHaveBeenCalledWith({ page: 1, pageSize: 25, registry: 'pypi', q: '' })
})
it('pages through the server, not the loaded rows', async () => {
const wrapper = await mountWithRouter()
const store = usePackageStore()
store.loading = false
store.packagePage = {
packages: [
{ id: '1', registry: 'npm', name: 'a', version: '1', size: 1, cached_at: '2025-01-01T00:00:00Z', last_accessed: '2025-01-01T00:00:00Z', download_count: 0 },
],
totalGroups: 60,
page: 1,
pageSize: 25,
}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Page 1 of 3 (60 total packages)')
const fetchSpy = store.fetchPackagePage as ReturnType<typeof vi.spyOn>
fetchSpy.mockClear()
window.scrollTo = vi.fn() as unknown as typeof window.scrollTo
const next = wrapper.findAll('button').find((b) => /next/i.test(b.attributes('aria-label') ?? b.text()))
await next!.trigger('click')
expect(fetchSpy).toHaveBeenCalledWith({ page: 2, pageSize: 25, registry: 'all', q: '' })
})
it('says no packages match when a filter empties the page', async () => {
const wrapper = await mountWithRouter()
const store = usePackageStore()
store.loading = false
setRows(store, [])
await wrapper.find('input').setValue('zzz')
await vi.advanceTimersByTimeAsync(300)
expect(wrapper.text()).toContain('No packages match')
expect(wrapper.text()).not.toContain('No packages cached yet')
})
})
})
+210 -321
View File
@@ -1,128 +1,90 @@
<template>
<div>
<div class="flex justify-between items-center mb-8">
<h2 class="text-3xl font-bold text-gray-900">Packages</h2>
<Button @click="store.fetchPackages()">
<i class="fas fa-sync-alt mr-2"></i>Refresh
</Button>
<div class="flex flex-col gap-6">
<PageHeader title="Packages" description="Everything the proxy has cached, grouped by package.">
<template #actions>
<Button variant="outline" :icon-start="faRotateRight" @click="load()">Refresh</Button>
</template>
</PageHeader>
<div class="flex flex-col gap-4 sm:flex-row sm:items-center">
<SegmentedControl
:model-value="selectedRegistry"
:options="REGISTRY_OPTIONS"
aria-label="Filter by registry"
@update:model-value="changeRegistryFilter"
/>
<SearchInput v-model="searchTerm" aria-label="Search packages" placeholder="Search packages..." class="w-full sm:ms-auto sm:w-64" />
</div>
<!-- Filter and Search Section -->
<div class="mb-6 flex flex-col sm:flex-row items-start sm:items-center gap-4">
<div class="flex items-center gap-2">
<span class="text-sm font-medium text-gray-700">Filter by registry:</span>
<div class="flex gap-2">
<Button
@click="changeRegistryFilter('all')"
:variant="selectedRegistry === 'all' ? 'default' : 'outline'"
size="sm"
>
All
</Button>
<Button
@click="changeRegistryFilter('npm')"
:variant="selectedRegistry === 'npm' ? 'default' : 'outline'"
size="sm"
>
<i class="fab fa-npm mr-2"></i>NPM
</Button>
<Button
@click="changeRegistryFilter('pypi')"
:variant="selectedRegistry === 'pypi' ? 'default' : 'outline'"
size="sm"
>
<i class="fab fa-python mr-2"></i>PyPI
</Button>
<Button
@click="changeRegistryFilter('go')"
:variant="selectedRegistry === 'go' ? 'default' : 'outline'"
size="sm"
>
<i class="fas fa-code mr-2"></i>Go
</Button>
</div>
</div>
<div class="flex items-center gap-2 w-full sm:w-auto sm:ml-auto">
<i class="fas fa-search text-gray-500"></i>
<Input
v-model="searchTerm"
type="text"
placeholder="Search packages..."
class="w-full sm:w-64"
/>
</div>
</div>
<LoadingState v-if="loading" variant="table" label="Loading packages..." />
<!-- Error Alert -->
<Alert v-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load packages"
:message="error"
@retry="load()"
/>
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading packages...</p>
</div>
<!-- Package List -->
<Card v-else>
<CardContent class="p-6">
<div v-if="packages.length === 0" class="text-center py-12 text-gray-500">
<i class="fas fa-inbox text-6xl mb-4"></i>
<p class="text-xl">No packages cached yet</p>
<p class="mt-2">Packages will appear here once they are downloaded through the proxy</p>
</div>
<CardContent>
<EmptyState
v-if="totalGroups === 0 && !filtersActive"
:icon="faBoxOpen"
title="No packages cached yet"
description="Packages will appear here once they are downloaded through the proxy."
/>
<EmptyState
v-else-if="groups.length === 0"
:icon="faMagnifyingGlass"
title="No packages match"
description="Change the registry filter or the search text."
/>
<Accordion v-else type="multiple" class="w-full">
<AccordionItem
v-for="group in groupedPackages"
:key="`${group.registry}:${group.name}`"
:value="`${group.registry}:${group.name}`"
class="border-b border-gray-200"
>
<AccordionTrigger class="px-4 py-4 hover:bg-gray-50">
<div class="flex items-center justify-between w-full pr-4">
<div class="flex items-center space-x-4">
<div class="text-left">
<h4 class="font-semibold text-gray-900">{{ group.name }}</h4>
<p class="text-sm text-gray-500">{{ group.versions.length }} version{{ group.versions.length > 1 ? 's' : '' }}</p>
</div>
</div>
<div class="flex items-center space-x-6">
<Badge variant="outline" :class="getRegistryBadgeClass(group.registry)">
{{ group.registry }}
</Badge>
<div class="text-right">
<p class="text-sm font-medium text-gray-900">{{ formatBytes(group.totalSize) }}</p>
<p class="text-xs text-gray-500">{{ formatNumber(group.totalDownloads) }} downloads</p>
</div>
</div>
</div>
</AccordionTrigger>
<AccordionContent class="px-4 pb-4">
<div class="space-y-3">
<div
v-for="version in group.versions"
:key="version.id"
class="flex items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100"
>
<div class="flex items-center space-x-4 flex-1">
<div class="flex-1">
<p class="font-medium text-gray-900">{{ version.version.startsWith('v') ? version.version : 'v' + version.version }}</p>
<div class="flex items-center space-x-4 mt-1 text-sm text-gray-500">
<span>
<i class="fas fa-download mr-1"></i>{{ formatNumber(version.download_count) }}
</span>
<span>
<i class="fas fa-hard-drive mr-1"></i>{{ formatBytes(version.size) }}
</span>
<span>
<i class="fas fa-clock mr-1"></i>{{ formatDate(version.cached_at) }}
</span>
</div>
<!-- Vulnerability Badge -->
<div v-if="version.vulnerabilities" class="mt-2">
<AccordionItem
v-for="group in groups"
:key="`${group.registry}:${group.name}`"
:value="`${group.registry}:${group.name}`"
>
<AccordionTrigger :heading-level="2">
<!-- Stacked below sm: a side-by-side row leaves the name ~90px at 320px and breaks scoped names mid-word. -->
<span class="flex w-full min-w-0 flex-col items-start gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
<span class="w-full min-w-0 text-start sm:w-auto">
<span class="block break-words font-semibold">{{ group.name }}</span>
<span class="block text-sm text-muted-foreground">
{{ group.versions.length }} version{{ group.versions.length > 1 ? 's' : '' }}
</span>
</span>
<span class="flex shrink-0 items-center gap-4">
<Badge variant="outline">{{ group.registry }}</Badge>
<span class="text-end tabular-nums">
<span class="block text-sm font-medium">{{ formatBytes(group.totalSize) }}</span>
<span class="block text-xs text-muted-foreground">{{ formatNumber(group.totalDownloads) }} downloads</span>
</span>
</span>
</span>
</AccordionTrigger>
<AccordionContent>
<Table :label="`Versions of ${group.name}`" layout="cards">
<TableHeader>
<TableRow>
<TableHead>Version</TableHead>
<TableHead align="right">Downloads</TableHead>
<TableHead align="right">Size</TableHead>
<TableHead>Cached</TableHead>
<TableHead>Vulnerabilities</TableHead>
<TableHead align="right">Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
<TableRow v-for="version in group.versions" :key="version.id">
<TableCell label="Version" class="font-medium">{{ withVersionPrefix(displayVersion(version)) }}</TableCell>
<TableCell label="Downloads" numeric>{{ formatNumber(version.download_count) }}</TableCell>
<TableCell label="Size" numeric>{{ formatBytes(version.size) }}</TableCell>
<TableCell label="Cached">{{ formatDate(version.cached_at) }}</TableCell>
<TableCell label="Vulnerabilities">
<VulnerabilityBadge
v-if="version.vulnerabilities"
:scanned="version.vulnerabilities.scanned"
:status="version.vulnerabilities.status"
:counts="version.vulnerabilities.counts"
@@ -131,111 +93,50 @@
:isBlocked="version.vulnerabilities.isBlocked"
@click="showVulnerabilityDetails(group.registry, group.name, version.version)"
/>
</div>
</div>
</div>
<button
@click="confirmDelete(version)"
class="text-red-600 hover:text-red-900 p-2"
title="Delete this version"
>
<i class="fas fa-trash"></i>
</button>
</div>
</div>
</AccordionContent>
</AccordionItem>
</TableCell>
<TableCell label="Actions" align="right">
<IconButton
:icon="faTrash"
:label="`Delete ${group.name} ${version.version}`"
@click="confirmDelete(version)"
/>
</TableCell>
</TableRow>
</TableBody>
</Table>
</AccordionContent>
</AccordionItem>
</Accordion>
<!-- Pagination -->
<div v-if="totalPages > 1" class="mt-6 flex items-center justify-between border-t pt-4">
<div class="text-sm text-gray-700">
Page {{ currentPage }} of {{ totalPages }} ({{ allGroupedPackages.length }} total packages)
</div>
<div class="flex items-center gap-2">
<Button
@click="changePage(currentPage - 1)"
:disabled="currentPage === 1"
variant="outline"
size="sm"
>
<i class="fas fa-chevron-left mr-2"></i>Previous
</Button>
<div class="flex gap-1">
<!-- First page -->
<Button
v-if="currentPage > 3"
@click="changePage(1)"
variant="outline"
size="sm"
>
1
</Button>
<span v-if="currentPage > 4" class="px-2">...</span>
<!-- Page numbers around current page -->
<Button
v-for="page in getPageNumbers()"
:key="page"
@click="changePage(page)"
:variant="page === currentPage ? 'default' : 'outline'"
size="sm"
>
{{ page }}
</Button>
<span v-if="currentPage < totalPages - 3" class="px-2">...</span>
<!-- Last page -->
<Button
v-if="currentPage < totalPages - 2"
@click="changePage(totalPages)"
variant="outline"
size="sm"
>
{{ totalPages }}
</Button>
</div>
<Button
@click="changePage(currentPage + 1)"
:disabled="currentPage === totalPages"
variant="outline"
size="sm"
>
Next<i class="fas fa-chevron-right ml-2"></i>
</Button>
</div>
<div v-if="totalPages > 1" class="mt-6 flex flex-col gap-3 border-t pt-4 sm:flex-row sm:items-center sm:justify-between">
<p class="m-0 text-sm text-muted-foreground">
Page {{ currentPage }} of {{ totalPages }} ({{ totalGroups }} total packages)
</p>
<Pagination
:page="currentPage"
:total="totalGroups"
:page-size="PAGE_SIZE"
:show-edges="false"
@update:page="changePage"
/>
</div>
</CardContent>
</Card>
<!-- Delete Confirmation Dialog -->
<Dialog v-model:open="showDeleteModal">
<DialogContent>
<DialogHeader>
<DialogTitle>Confirm Deletion</DialogTitle>
<DialogDescription>
Are you sure you want to delete <strong>{{ packageToDelete?.name }}@{{ packageToDelete?.version }}</strong>?
This action cannot be undone.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button @click="showDeleteModal = false" variant="outline">
Cancel
</Button>
<Button @click="deletePackage" variant="destructive">
Delete
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
<ConfirmDialog
v-model:open="showDeleteModal"
title="Delete package version?"
:description="`Delete ${packageToDelete?.name}@${packageToDelete?.version}? This action cannot be undone.`"
confirm-label="Delete version"
tone="danger"
destructive
@confirm="deletePackage"
/>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, computed, watch } from 'vue'
import { onBeforeUnmount, onMounted, ref, computed, watch } from 'vue'
import { storeToRefs } from 'pinia'
import { useRoute, useRouter } from 'vue-router'
import { usePackageStore, type Package } from '../stores/packages'
@@ -244,22 +145,30 @@ import {
AccordionContent,
AccordionItem,
AccordionTrigger,
} from '@/components/ui/accordion'
import { Button } from '@/components/ui/button'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Card, CardContent } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Input } from '@/components/ui/input'
Badge,
Button,
Card,
CardContent,
ConfirmDialog,
EmptyState,
ErrorState,
IconButton,
LoadingState,
PageHeader,
Pagination,
SearchInput,
SegmentedControl,
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
useToastStore,
} from '@perfect-design/ui'
import VulnerabilityBadge from './VulnerabilityBadge.vue'
import { getRegistryBadgeClass } from '@/composables/useBadgeStyles'
import { formatBytes, formatDate, formatNumber, displayVersion, withVersionPrefix } from '@/lib/format'
import { faBoxOpen, faMagnifyingGlass, faRotateRight, faTrash } from '@/lib/icons'
// Props from router
const props = defineProps<{
@@ -269,103 +178,89 @@ const props = defineProps<{
const route = useRoute()
const router = useRouter()
const store = usePackageStore()
const { packages, loading, error } = storeToRefs(store)
const toasts = useToastStore()
const { packagePage, loading, error } = storeToRefs(store)
const showDeleteModal = ref(false)
const packageToDelete = ref<Package | null>(null)
const REGISTRY_OPTIONS = [
{ value: 'all', label: 'All' },
{ value: 'npm', label: 'npm' },
{ value: 'pypi', label: 'PyPI' },
{ value: 'go', label: 'Go' },
]
const PAGE_SIZE = 25
const SEARCH_DEBOUNCE_MS = 300
const selectedRegistry = ref<string>(props.registry || 'all')
const searchTerm = ref<string>('')
// What the server was last asked: the search text lags the input by the debounce.
const activeQuery = ref<string>('')
const currentPage = ref<number>(1)
const itemsPerPage = ref<number>(10)
// Group packages by name
const allGroupedPackages = computed(() => {
const groups = new Map<string, Package[]>()
const totalGroups = computed(() => packagePage.value.totalGroups)
const totalPages = computed(() => Math.ceil(totalGroups.value / PAGE_SIZE))
const filtersActive = computed(() => selectedRegistry.value !== 'all' || activeQuery.value.trim() !== '')
// Filter packages by selected registry and search term
let filteredPackages = selectedRegistry.value === 'all'
? packages.value
: packages.value.filter(pkg => pkg.registry === selectedRegistry.value)
// Apply search filter if search term exists
if (searchTerm.value.trim()) {
const searchLower = searchTerm.value.toLowerCase()
filteredPackages = filteredPackages.filter(pkg =>
pkg.name.toLowerCase().includes(searchLower) ||
pkg.version.toLowerCase().includes(searchLower)
)
// The server pages whole (registry, name) groups and sends every version row of each.
const groups = computed(() => {
const byKey = new Map<string, { registry: string; name: string; versions: Package[] }>()
for (const pkg of packagePage.value.packages) {
const key = `${pkg.registry}\u0000${pkg.name}`
let group = byKey.get(key)
if (!group) {
group = { registry: pkg.registry, name: pkg.name, versions: [] }
byKey.set(key, group)
}
group.versions.push(pkg)
}
return Array.from(byKey.values()).map((group) => ({
...group,
totalSize: group.versions.reduce((sum, v) => sum + v.size, 0),
totalDownloads: group.versions.reduce((sum, v) => sum + v.download_count, 0),
}))
})
filteredPackages.forEach(pkg => {
const key = `${pkg.registry}:${pkg.name}`
if (!groups.has(key)) {
groups.set(key, [])
}
groups.get(key)!.push(pkg)
async function load() {
await store.fetchPackagePage({
page: currentPage.value,
pageSize: PAGE_SIZE,
registry: selectedRegistry.value,
q: activeQuery.value,
})
// Convert to array and sort versions within each group
return Array.from(groups.entries()).map(([key, versions]) => {
const [registry, name] = key.split(':')
return {
registry,
name,
versions: versions.sort((a, b) =>
new Date(b.cached_at).getTime() - new Date(a.cached_at).getTime()
),
totalSize: versions.reduce((sum, v) => sum + v.size, 0),
totalDownloads: versions.reduce((sum, v) => sum + v.download_count, 0),
}
}).sort((a, b) => a.name.localeCompare(b.name))
})
// Pagination
const totalPages = computed(() => Math.ceil(allGroupedPackages.value.length / itemsPerPage.value))
const groupedPackages = computed(() => {
const start = (currentPage.value - 1) * itemsPerPage.value
const end = start + itemsPerPage.value
return allGroupedPackages.value.slice(start, end)
})
}
function changePage(page: number) {
if (page >= 1 && page <= totalPages.value) {
currentPage.value = page
void load()
// Scroll to top of packages list
window.scrollTo({ top: 0, behavior: 'smooth' })
}
}
// Get page numbers to display around current page
function getPageNumbers(): number[] {
const pages: number[] = []
const start = Math.max(1, currentPage.value - 2)
const end = Math.min(totalPages.value, currentPage.value + 2)
for (let i = start; i <= end; i++) {
pages.push(i)
}
return pages
}
// Reset to page 1 when filters change
function resetPagination() {
currentPage.value = 1
}
// Watch for filter/search changes and reset pagination
watch([selectedRegistry, searchTerm], () => {
resetPagination()
// A burst of keystrokes asks the server once.
let searchTimer: ReturnType<typeof setTimeout> | undefined
watch(searchTerm, (term) => {
clearTimeout(searchTimer)
searchTimer = setTimeout(() => {
if (term === activeQuery.value) return
activeQuery.value = term
currentPage.value = 1
void load()
}, SEARCH_DEBOUNCE_MS)
})
onBeforeUnmount(() => clearTimeout(searchTimer))
// Watch for route parameter changes to update filter
watch(() => route.params.registry, (newRegistry) => {
selectedRegistry.value = (newRegistry as string) || 'all'
currentPage.value = 1
void load()
})
onMounted(async () => {
await store.fetchPackages()
})
onMounted(load)
function confirmDelete(pkg: Package) {
packageToDelete.value = pkg
@@ -373,33 +268,27 @@ function confirmDelete(pkg: Package) {
}
async function deletePackage() {
if (packageToDelete.value) {
await store.deletePackage(
packageToDelete.value.registry,
packageToDelete.value.name,
packageToDelete.value.version
)
showDeleteModal.value = false
packageToDelete.value = null
const target = packageToDelete.value
if (!target) return
await store.deletePackage(target.registry, target.name, target.version)
showDeleteModal.value = false
packageToDelete.value = null
const label = `${target.name}@${target.version}`
if (store.error) {
toasts.error('Could not delete package', `${label}: ${store.error}`)
// The toast reports it; the list loaded fine, so it must not be replaced by a load error.
store.error = null
} else {
toasts.success('Package deleted', label)
await load()
// Deleting the last group of the last page leaves that page empty.
if (packagePage.value.packages.length === 0 && totalGroups.value > 0 && currentPage.value > 1) {
currentPage.value = Math.max(totalPages.value, 1)
await load()
}
}
}
function formatNumber(num: number): string {
return new Intl.NumberFormat().format(num)
}
function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i]
}
function formatDate(date: string): string {
return new Date(date).toLocaleString()
}
function showVulnerabilityDetails(registry: string, name: string, version: string) {
// Navigate to the package details page
router.push({
@@ -0,0 +1,18 @@
<template>
<StatGroup :columns="4" :aria-label="label">
<KpiTile v-for="level in SEVERITY_LEVELS" :key="level" :label="formatSeverityName(level)" :value="counts[level]">
<template #icon><StatusDot :tone="SEVERITY_TONES[level]" /></template>
</KpiTile>
</StatGroup>
</template>
<script setup lang="ts">
import { KpiTile, StatGroup, StatusDot } from '@perfect-design/ui'
import type { VulnerabilityCounts } from '../stores/packages'
import { SEVERITY_LEVELS, SEVERITY_TONES, formatSeverityName } from '@/lib/severity'
defineProps<{
counts: VulnerabilityCounts
label: string
}>()
</script>
+72 -27
View File
@@ -1,17 +1,22 @@
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import { mount as mountWith } from '@vue/test-utils'
import { createPinia, setActivePinia } from 'pinia'
import Stats from './Stats.vue'
import { createTestRouter } from '@/test/router'
import { usePackageStore } from '../stores/packages'
describe('Stats.vue', () => {
beforeEach(() => {
let router: Awaited<ReturnType<typeof createTestRouter>>
const mount = (component: typeof Stats) => mountWith(component, { global: { plugins: [router] } })
beforeEach(async () => {
setActivePinia(createPinia())
router = await createTestRouter('/stats')
})
it('renders stats component', () => {
const wrapper = mount(Stats)
expect(wrapper.find('h2').text()).toBe('Statistics')
expect(wrapper.find('h1').text()).toBe('Statistics')
})
it('displays loading state when loading', async () => {
@@ -25,9 +30,11 @@ describe('Stats.vue', () => {
})
it('displays error message when error occurs', async () => {
const wrapper = mount(Stats)
const store = usePackageStore()
vi.spyOn(store, 'fetchStats').mockResolvedValue()
const wrapper = mount(Stats)
store.loading = false
store.error = 'Failed to fetch statistics'
await wrapper.vm.$nextTick()
@@ -51,7 +58,7 @@ describe('Stats.vue', () => {
}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Overall Statistics')
expect(wrapper.text()).toContain('Overall statistics')
expect(wrapper.text()).toContain('100')
expect(wrapper.text()).toContain('500')
})
@@ -73,9 +80,9 @@ describe('Stats.vue', () => {
}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Security Scanning')
expect(wrapper.text()).toContain('Scanned Packages')
expect(wrapper.text()).toContain('Vulnerable Packages')
expect(wrapper.text()).toContain('Security scanning')
expect(wrapper.text()).toContain('Scanned packages')
expect(wrapper.text()).toContain('Vulnerable packages')
})
it('displays registry breakdown', async () => {
@@ -112,13 +119,15 @@ describe('Stats.vue', () => {
}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Registry Breakdown')
expect(wrapper.text()).toContain('NPM Registry')
expect(wrapper.text()).toContain('PyPI Registry')
expect(wrapper.text()).toContain('Go Modules')
expect(wrapper.text()).toContain('50 packages')
expect(wrapper.text()).toContain('30 packages')
expect(wrapper.text()).toContain('20 packages')
expect(wrapper.text()).toContain('Registry breakdown')
expect(wrapper.text()).toContain('npm')
expect(wrapper.text()).toContain('PyPI')
expect(wrapper.text()).toContain('Go modules')
// The cards layout prefixes each cell with its column label.
const packageCounts = wrapper
.findAll('tbody tr')
.map((row) => row.findAll('td')[0].text().replace(/^Packages/, ''))
expect(packageCounts).toEqual(['50', '30', '20'])
})
it('formats bytes correctly in overall stats', async () => {
@@ -150,7 +159,7 @@ describe('Stats.vue', () => {
expect(fetchSpy).toHaveBeenCalled()
})
it('displays correct icon colors for different registries', async () => {
it('lists the registries in the order the API reports them', async () => {
const wrapper = mount(Stats)
const store = usePackageStore()
@@ -172,13 +181,8 @@ describe('Stats.vue', () => {
}
await wrapper.vm.$nextTick()
// Scope to the registry icon containers (w-12 h-12 rounded-full),
// excluding the storage progress bar which also uses rounded-full.
const containers = wrapper.findAll('.w-12.h-12.rounded-full')
expect(containers).toHaveLength(3)
expect(containers[0].classes()).toContain('bg-red-100') // npm
expect(containers[1].classes()).toContain('bg-blue-100') // pypi
expect(containers[2].classes()).toContain('bg-cyan-100') // go
const labels = wrapper.findAll('tbody th').map((cell) => cell.text().replace(/^Registry/, ''))
expect(labels).toEqual(['npm', 'PyPI', 'Go modules'])
})
it('handles empty registries data', async () => {
@@ -199,9 +203,50 @@ describe('Stats.vue', () => {
store.registries = {}
await wrapper.vm.$nextTick()
expect(wrapper.text()).toContain('Registry Breakdown')
// Should have no registry items
const registryItems = wrapper.findAll('.bg-gray-50')
expect(registryItems.length).toBe(3) // Only the overall stats cards
expect(wrapper.text()).toContain('Registry breakdown')
expect(wrapper.findAll('tbody th')).toHaveLength(0)
expect(wrapper.text()).toContain('No registries reported')
})
describe('idle eviction note', () => {
const baseStats = {
registry: '',
total_packages: 100,
total_size: 1073741824,
max_cache_size: 10737418240,
total_downloads: 500,
scanned_packages: 90,
vulnerable_packages: 5,
blocked_packages: 0,
}
async function render(idleTtl?: number) {
const wrapper = mount(Stats)
const store = usePackageStore()
store.loading = false
store.stats = idleTtl === undefined ? { ...baseStats } : { ...baseStats, idle_ttl: idleTtl }
await wrapper.vm.$nextTick()
return wrapper
}
it.each([
[604800, 'Cached items not requested for 7 days are removed.'],
[86400, 'Cached items not requested for 1 day are removed.'],
[129600, 'Cached items not requested for 36 hours are removed.'],
[5400, 'Cached items not requested for 90 minutes are removed.'],
])('shows the window for idle_ttl=%i', async (seconds, sentence) => {
const wrapper = await render(seconds)
expect(wrapper.text()).toContain(sentence)
})
it('hides the note when idle eviction is off', async () => {
const wrapper = await render(0)
expect(wrapper.text()).not.toContain('not requested')
})
it('hides the note when the API sends no idle_ttl', async () => {
const wrapper = await render()
expect(wrapper.text()).not.toContain('not requested')
})
})
})
+132 -183
View File
@@ -1,150 +1,91 @@
<template>
<div>
<h2 class="text-3xl font-bold text-gray-900 mb-8">Statistics</h2>
<div class="flex flex-col gap-6">
<PageHeader title="Statistics" description="Storage, traffic and scan results across every registry." />
<!-- Error Alert -->
<Alert v-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<LoadingState v-if="loading" variant="kpi-grid" :columns="3" label="Loading statistics..." />
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading statistics...</p>
</div>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load statistics"
:message="error"
@retry="refresh"
/>
<!-- Stats Cards -->
<div v-else>
<!-- Overall Stats -->
<Card class="mb-8">
<CardContent class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-6">
<i class="fas fa-chart-bar mr-2"></i>Overall Statistics
</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="text-center p-6 bg-gray-50 rounded-lg">
<p class="text-4xl font-bold text-primary-600 mb-2">
{{ formatNumber(stats?.total_packages || 0) }}
</p>
<p class="text-sm text-gray-600">Total Packages</p>
</div>
<div class="p-6 bg-gray-50 rounded-lg">
<div class="text-center mb-3">
<p class="text-2xl font-bold text-blue-600">
{{ formatBytes(stats?.total_size || 0) }} / {{ formatBytes(stats?.max_cache_size || 0) }}
</p>
<p class="text-sm text-gray-600 mt-1">Storage Used</p>
</div>
<div class="w-full bg-gray-200 rounded-full h-3 overflow-hidden">
<div
class="h-full bg-blue-600 rounded-full transition-all duration-300"
:style="{ width: storagePercentage + '%' }"
:class="{
'bg-green-600': storagePercentage < 50,
'bg-yellow-600': storagePercentage >= 50 && storagePercentage < 80,
'bg-orange-600': storagePercentage >= 80 && storagePercentage < 90,
'bg-red-600': storagePercentage >= 90
}"
></div>
</div>
<p class="text-xs text-gray-500 text-center mt-1">{{ storagePercentage.toFixed(1) }}% used</p>
</div>
<div class="text-center p-6 bg-gray-50 rounded-lg">
<p class="text-4xl font-bold text-green-600 mb-2">
{{ formatNumber(stats?.total_downloads || 0) }}
</p>
<p class="text-sm text-gray-600">Total Downloads</p>
</div>
</div>
</CardContent>
</Card>
<template v-else>
<Alert v-if="idleTtl > 0" variant="info">
<AlertDescription>Cached items not requested for {{ formatDuration(idleTtl) }} are removed.</AlertDescription>
</Alert>
<!-- Security Stats -->
<Card class="mb-8">
<CardContent class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-6">
<i class="fas fa-shield-alt mr-2"></i>Security Scanning
</h3>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="flex items-center justify-between p-6 bg-green-50 rounded-lg border border-green-200">
<div>
<p class="text-3xl font-bold text-green-600">
{{ formatNumber(stats?.scanned_packages || 0) }}
</p>
<p class="text-sm text-gray-600 mt-1">Scanned Packages</p>
</div>
<i class="fas fa-check-circle text-5xl text-green-400"></i>
</div>
<div
@click="showVulnerablePackages"
class="flex items-center justify-between p-6 bg-orange-50 rounded-lg border border-orange-200 cursor-pointer hover:bg-orange-100 transition-colors"
:class="{ 'opacity-50': (stats?.vulnerable_packages || 0) === 0 }"
>
<div>
<p class="text-3xl font-bold text-orange-600">
{{ formatNumber(stats?.vulnerable_packages || 0) }}
</p>
<p class="text-sm text-gray-600 mt-1">
Vulnerable Packages
<span v-if="(stats?.vulnerable_packages || 0) > 0" class="text-xs ml-1">(click to view)</span>
</p>
</div>
<i class="fas fa-exclamation-triangle text-5xl text-orange-400"></i>
</div>
<div
@click="showBlockedPackages"
class="flex items-center justify-between p-6 bg-red-50 rounded-lg border border-red-200 cursor-pointer hover:bg-red-100 transition-colors"
:class="{ 'opacity-50': (stats?.blocked_packages || 0) === 0 }"
>
<div>
<p class="text-3xl font-bold text-red-600">
{{ formatNumber(stats?.blocked_packages || 0) }}
</p>
<p class="text-sm text-gray-600 mt-1">
Blocked Packages
<span v-if="(stats?.blocked_packages || 0) > 0" class="text-xs ml-1">(click to view)</span>
</p>
</div>
<i class="fas fa-hand text-5xl text-red-400"></i>
</div>
</div>
</CardContent>
</Card>
<!-- Registry Breakdown -->
<Card>
<CardContent class="p-6">
<h3 class="text-xl font-semibold text-gray-900 mb-6">
<i class="fas fa-server mr-2"></i>Registry Breakdown
</h3>
<div class="space-y-4">
<div
v-for="registry in registries"
:key="registry.name"
class="flex items-center justify-between p-4 bg-gray-50 rounded-lg"
>
<div class="flex items-center space-x-4">
<div
class="w-12 h-12 rounded-full flex items-center justify-center"
:class="registry.color"
>
<i :class="registry.icon + ' text-2xl'"></i>
</div>
<div>
<p class="font-bold text-gray-900">{{ registry.label }}</p>
<p class="text-sm text-gray-600">{{ registry.packages }} packages</p>
</div>
</div>
<div class="text-right">
<p class="text-lg font-bold text-gray-900">{{ registry.size }}</p>
<p class="text-sm text-gray-600">{{ registry.downloads }} downloads</p>
</div>
</div>
</div>
<CardHeader>
<CardTitle as="h2">Overall statistics</CardTitle>
</CardHeader>
<CardContent>
<StatGroup :columns="3" aria-label="Overall statistics">
<KpiTile label="Total packages" :value="stats?.total_packages || 0" :icon="faBoxesStacked" />
<KpiTile
label="Storage used"
:value="`${formatBytes(stats?.total_size || 0)} / ${formatBytes(stats?.max_cache_size || 0)}`"
:hint="`${storagePercentage.toFixed(1)}% used`"
:progress="storagePercentage"
:tone="storageTone"
:icon="faHardDrive"
/>
<KpiTile label="Total downloads" :value="stats?.total_downloads || 0" :icon="faDownload" />
</StatGroup>
</CardContent>
</Card>
</div>
<Card>
<CardHeader>
<CardTitle as="h2">Security scanning</CardTitle>
</CardHeader>
<CardContent>
<StatGroup :columns="3" aria-label="Security scanning">
<KpiTile label="Scanned packages" :value="stats?.scanned_packages || 0" :icon="faCircleCheck" />
<KpiTile
as="button"
type="button"
variant="interactive"
label="Vulnerable packages"
:value="stats?.vulnerable_packages || 0"
:hint="(stats?.vulnerable_packages || 0) > 0 ? 'View the list' : undefined"
:icon="faTriangleExclamation"
:disabled="(stats?.vulnerable_packages || 0) === 0"
@click="showVulnerablePackages"
/>
<KpiTile
as="button"
type="button"
variant="interactive"
label="Blocked packages"
:value="stats?.blocked_packages || 0"
:hint="(stats?.blocked_packages || 0) > 0 ? 'View the list' : undefined"
:icon="faBan"
:disabled="(stats?.blocked_packages || 0) === 0"
@click="showBlockedPackages"
/>
</StatGroup>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle as="h2">Registry breakdown</CardTitle>
</CardHeader>
<CardContent>
<DataTable
label="Registry breakdown"
layout="cards"
row-key="name"
empty-text="No registries reported"
:columns="registryColumns"
:rows="registries"
/>
</CardContent>
</Card>
</template>
</div>
</template>
@@ -153,8 +94,23 @@ import { computed, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
import { usePackageStore } from '../stores/packages'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Card, CardContent } from '@/components/ui/card'
import {
Alert,
AlertDescription,
Card,
CardContent,
CardHeader,
CardTitle,
DataTable,
ErrorState,
KpiTile,
LoadingState,
PageHeader,
StatGroup,
type DataTableColumn,
} from '@perfect-design/ui'
import { formatBytes, formatDuration, formatNumber } from '@/lib/format'
import { faBan, faDownload, faHardDrive, faBoxesStacked, faCircleCheck, faTriangleExclamation } from '@/lib/icons'
const store = usePackageStore()
const { stats, loading, error } = storeToRefs(store)
@@ -180,60 +136,53 @@ function showBlockedPackages() {
router.push('/blocked-packages')
}
// Registry configuration for icons and colors
const registryConfig: Record<string, {label: string, icon: string, color: string}> = {
npm: {
label: 'NPM Registry',
icon: 'fab fa-npm text-red-500',
color: 'bg-red-100'
},
pypi: {
label: 'PyPI Registry',
icon: 'fab fa-python text-blue-500',
color: 'bg-blue-100'
},
go: {
label: 'Go Modules',
icon: 'fas fa-code text-cyan-500',
color: 'bg-cyan-100'
}
const REGISTRY_LABELS: Record<string, string> = {
npm: 'npm',
pypi: 'PyPI',
go: 'Go modules',
}
interface RegistryRow {
name: string
label: string
packages: number
size: string
downloads: number
}
const registryColumns: DataTableColumn<RegistryRow>[] = [
{ key: 'label', header: 'Registry', rowHeader: true },
{ key: 'packages', header: 'Packages', numeric: true, accessor: (r) => formatNumber(r.packages) },
{ key: 'size', header: 'Size', numeric: true },
{ key: 'downloads', header: 'Downloads', numeric: true, accessor: (r) => formatNumber(r.downloads) },
]
const registries = computed(() => {
const apiRegistries = store.registries || {}
return Object.entries(apiRegistries).map(([name, data]: [string, any]) => {
const config = registryConfig[name] || {
label: name.toUpperCase(),
icon: 'fas fa-box',
color: 'bg-gray-100'
}
return {
name,
label: config.label,
icon: config.icon,
color: config.color,
packages: data.count || 0,
size: formatBytes(data.size || 0),
downloads: data.downloads || 0
}
})
return Object.entries(apiRegistries).map(([name, data]: [string, any]): RegistryRow => ({
name,
label: REGISTRY_LABELS[name] ?? name.toUpperCase(),
packages: data.count || 0,
size: formatBytes(data.size || 0),
downloads: data.downloads || 0,
}))
})
const idleTtl = computed(() => stats.value?.idle_ttl || 0)
const storagePercentage = computed(() => {
const totalSize = stats.value?.total_size || 0
const maxSize = stats.value?.max_cache_size || 1
return (totalSize / maxSize) * 100
})
function formatNumber(num: number): string {
return new Intl.NumberFormat().format(num)
}
const storageTone = computed(() => {
if (storagePercentage.value >= 90) return 'danger'
if (storagePercentage.value >= 50) return 'warning'
return 'success'
})
function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i]
function refresh() {
void store.fetchStats()
}
</script>
+38 -96
View File
@@ -1,97 +1,58 @@
<template>
<div class="flex items-center gap-2">
<!-- Blocked Icon (if package exceeds thresholds) -->
<span
<div class="flex flex-wrap items-center gap-2">
<StatusBadge
v-if="isBlocked"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-red-600 text-white border border-red-700"
title="Download blocked - exceeds vulnerability thresholds"
>
<i class="fas fa-hand mr-1"></i>
BLOCKED
</span>
status="blocked"
label="Blocked"
variant="solid"
title="Download blocked: exceeds vulnerability thresholds"
/>
<!-- Critical Vulnerabilities -->
<button
v-if="counts.critical > 0"
@click="handleClick('critical')"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-red-100 text-red-800 hover:bg-red-200 border border-red-300 transition-colors cursor-pointer"
:title="`${counts.critical} critical vulnerabilities - click for details`"
v-for="level in presentLevels"
:key="level"
type="button"
:class="buttonVariants({ variant: 'ghost', size: 'xs' })"
:aria-label="`${counts[level]} ${level} ${counts[level] === 1 ? 'vulnerability' : 'vulnerabilities'}, view details`"
@click="handleClick(level)"
>
<i class="fas fa-shield-virus mr-1"></i>
CRITICAL: {{ counts.critical }}
<StatusBadge :status="level" :tones="SEVERITY_TONES" :label="`${formatSeverityName(level)}: ${counts[level]}`" />
</button>
<!-- High Vulnerabilities -->
<button
v-if="counts.high > 0"
@click="handleClick('high')"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-orange-100 text-orange-800 hover:bg-orange-200 border border-orange-300 transition-colors cursor-pointer"
:title="`${counts.high} high severity vulnerabilities - click for details`"
>
<i class="fas fa-exclamation-triangle mr-1"></i>
HIGH: {{ counts.high }}
</button>
<template v-if="status === 'clean' && total === 0">
<StatusBadge
status="clean"
label="Clean"
:tones="{ clean: 'success' }"
:title="scannedAt ? `No vulnerabilities found. Scanned ${formatDate(scannedAt)}` : 'No vulnerabilities found'"
/>
<RelativeTime v-if="scannedAt" :datetime="scannedAt" variant="muted" size="xs" />
</template>
<!-- Moderate Vulnerabilities -->
<button
v-if="counts.moderate > 0"
@click="handleClick('moderate')"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-yellow-100 text-yellow-800 hover:bg-yellow-200 border border-yellow-300 transition-colors cursor-pointer"
:title="`${counts.moderate} moderate severity vulnerabilities - click for details`"
>
<i class="fas fa-exclamation-circle mr-1"></i>
MODERATE: {{ counts.moderate }}
</button>
<!-- Low Vulnerabilities -->
<button
v-if="counts.low > 0"
@click="handleClick('low')"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-blue-100 text-blue-800 hover:bg-blue-200 border border-blue-300 transition-colors cursor-pointer"
:title="`${counts.low} low severity vulnerabilities - click for details`"
>
<i class="fas fa-info-circle mr-1"></i>
LOW: {{ counts.low }}
</button>
<!-- Clean Badge (no vulnerabilities) -->
<span
v-if="status === 'clean' && total === 0"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-green-100 text-green-800 border border-green-300"
:title="scannedAt ? `No vulnerabilities found - Scanned ${formatTimestamp(scannedAt)}` : 'No vulnerabilities found'"
>
<i class="fas fa-check-circle mr-1"></i>
CLEAN
<span v-if="scannedAt" class="ml-1 text-[10px] opacity-70">
({{ formatRelativeTime(scannedAt) }})
</span>
</span>
<!-- Pending Badge -->
<span
<StatusBadge
v-if="status === 'pending'"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300"
status="pending"
label="Scanning"
pulse
title="Security scan in progress"
>
<i class="fas fa-spinner fa-spin mr-1"></i>
SCANNING...
</span>
/>
<!-- Not Scanned Badge -->
<span
<StatusBadge
v-if="status === 'not_scanned' || !scanned"
class="inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-gray-100 text-gray-600 border border-gray-300"
status="not_scanned"
label="Not scanned"
:tones="{ not_scanned: 'neutral' }"
title="Not yet scanned for vulnerabilities"
>
<i class="fas fa-question-circle mr-1"></i>
NOT SCANNED
</span>
/>
</div>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { RelativeTime, StatusBadge, buttonVariants } from '@perfect-design/ui'
import type { VulnerabilityCounts } from '../stores/packages'
import { formatDate } from '@/lib/format'
import { NO_VULNERABILITIES, SEVERITY_LEVELS, SEVERITY_TONES, formatSeverityName } from '@/lib/severity'
interface Props {
scanned?: boolean
@@ -113,29 +74,10 @@ const emit = defineEmits<{
click: [severity: string]
}>()
const counts = computed(() => props.counts || { critical: 0, high: 0, moderate: 0, low: 0 })
const counts = computed(() => props.counts || NO_VULNERABILITIES)
const presentLevels = computed(() => SEVERITY_LEVELS.filter((level) => counts.value[level] > 0))
function handleClick(severity: string) {
emit('click', severity)
}
function formatTimestamp(timestamp: string): string {
const date = new Date(timestamp)
return date.toLocaleString()
}
function formatRelativeTime(timestamp: string): string {
const date = new Date(timestamp)
const now = new Date()
const diffMs = now.getTime() - date.getTime()
const diffMins = Math.floor(diffMs / 60000)
const diffHours = Math.floor(diffMs / 3600000)
const diffDays = Math.floor(diffMs / 86400000)
if (diffMins < 1) return 'just now'
if (diffMins < 60) return `${diffMins}m ago`
if (diffHours < 24) return `${diffHours}h ago`
if (diffDays < 7) return `${diffDays}d ago`
return formatTimestamp(timestamp).split(',')[0] // Just the date part
}
</script>
+121 -181
View File
@@ -1,159 +1,103 @@
<template>
<div class="max-w-7xl mx-auto px-4 py-8">
<!-- Header -->
<div class="mb-6">
<Button @click="goBack" variant="ghost" class="mb-4">
<i class="fas fa-arrow-left mr-2"></i>
Back to Stats
</Button>
<div class="flex items-center gap-3">
<i :class="showOnlyBlocked ? 'fas fa-hand' : 'fas fa-exclamation-triangle'" class="text-3xl text-red-600"></i>
<div>
<h1 class="text-3xl font-bold text-gray-900">
{{ showOnlyBlocked ? 'Blocked Packages' : 'Vulnerable Packages' }}
</h1>
<p class="text-gray-600 mt-1">
{{ showOnlyBlocked
? 'Packages blocked from download due to exceeding vulnerability thresholds'
: 'Packages with known security vulnerabilities, sorted by risk'
}}
</p>
</div>
</div>
</div>
<div class="flex flex-col gap-6">
<PageHeader
:title="showOnlyBlocked ? 'Blocked packages' : 'Vulnerable packages'"
:description="
showOnlyBlocked
? 'Packages blocked from download because they exceed the vulnerability thresholds.'
: 'Packages with known security vulnerabilities, sorted by risk.'
"
>
<template #back>
<Button variant="ghost" size="sm" :icon-start="faArrowLeft" @click="goBack">Back to stats</Button>
</template>
</PageHeader>
<!-- Loading State -->
<div v-if="loading" class="text-center py-12">
<i class="fas fa-spinner fa-spin text-4xl text-primary-600"></i>
<p class="mt-4 text-gray-600">Loading vulnerable packages...</p>
</div>
<LoadingState v-if="loading" variant="card" label="Loading vulnerable packages..." />
<!-- Error State -->
<Alert v-else-if="error" variant="destructive" class="mb-4">
<i class="fas fa-exclamation-circle mr-2"></i>
<AlertDescription>{{ error }}</AlertDescription>
</Alert>
<ErrorState
v-else-if="error"
variant="card"
title="Could not load vulnerable packages"
:message="error"
@retry="fetchVulnerablePackages"
/>
<!-- Empty State -->
<Card v-else-if="sortedVulnerablePackages.length === 0">
<CardContent class="text-center py-12">
<i class="fas fa-check-circle text-6xl text-green-500 mb-4"></i>
<p class="text-xl font-semibold text-gray-900">No Vulnerable Packages</p>
<p class="mt-2 text-gray-600">All your packages are clean and safe to use!</p>
<CardContent>
<EmptyState
tone="success"
:icon="faCircleCheck"
:title="showOnlyBlocked ? 'No blocked packages' : 'No vulnerable packages'"
description="Every cached package is clean."
/>
</CardContent>
</Card>
<!-- Vulnerable Packages List -->
<div v-else class="space-y-6">
<!-- Summary Card -->
<Card>
<CardContent class="p-6">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="text-center p-4 bg-red-50 rounded-lg border border-red-200">
<p class="text-3xl font-bold text-red-600">{{ criticalCount }}</p>
<p class="text-sm text-gray-600 mt-1">Critical</p>
</div>
<div class="text-center p-4 bg-orange-50 rounded-lg border border-orange-200">
<p class="text-3xl font-bold text-orange-600">{{ highCount }}</p>
<p class="text-sm text-gray-600 mt-1">High</p>
</div>
<div class="text-center p-4 bg-yellow-50 rounded-lg border border-yellow-200">
<p class="text-3xl font-bold text-yellow-600">{{ moderateCount }}</p>
<p class="text-sm text-gray-600 mt-1">Moderate</p>
</div>
<div class="text-center p-4 bg-blue-50 rounded-lg border border-blue-200">
<p class="text-3xl font-bold text-blue-600">{{ lowCount }}</p>
<p class="text-sm text-gray-600 mt-1">Low</p>
</div>
</div>
</CardContent>
</Card>
<template v-else>
<SeveritySummary :counts="totalCounts" label="Vulnerabilities by severity" />
<!-- Packages List -->
<Card>
<CardContent class="p-6">
<div class="mb-4">
<h3 class="text-xl font-semibold text-gray-900">
<i class="fas fa-list mr-2"></i>
Vulnerable Packages ({{ sortedVulnerablePackages.length }})
</h3>
<p class="text-sm text-gray-600 mt-1">
{{ groupedPackages.length }} unique package{{ groupedPackages.length !== 1 ? 's' : '' }} • Sorted by risk: Critical → High → Moderate → Low
</p>
</div>
<CardHeader>
<CardTitle as="h2">
{{ showOnlyBlocked ? 'Blocked' : 'Vulnerable' }} packages ({{ sortedVulnerablePackages.length }})
</CardTitle>
<CardDescription>
{{ groupedPackages.length }} unique package{{ groupedPackages.length !== 1 ? 's' : '' }}, most critical first
</CardDescription>
</CardHeader>
<CardContent>
<Accordion type="multiple" class="w-full">
<AccordionItem
v-for="group in groupedPackages"
:key="`${group.registry}:${group.name}`"
:value="`${group.registry}:${group.name}`"
class="border-b border-gray-200"
>
<AccordionTrigger class="px-4 py-4 hover:bg-gray-50">
<div class="flex items-center justify-between w-full pr-4">
<div class="flex items-center space-x-4 flex-1 min-w-0">
<div class="text-left flex-1 min-w-0">
<h4 class="font-semibold text-gray-900 break-words">{{ group.name }}</h4>
<p class="text-sm text-gray-500">{{ group.versions.length }} vulnerable version{{ group.versions.length > 1 ? 's' : '' }}</p>
</div>
</div>
<div class="flex items-center space-x-6 flex-shrink-0">
<Badge variant="outline" :class="getRegistryBadgeClass(group.registry)">
{{ group.registry }}
</Badge>
<div class="text-right whitespace-nowrap">
<p class="text-sm font-medium text-gray-900">{{ formatBytes(group.totalSize) }}</p>
<p class="text-xs text-gray-500">{{ formatNumber(group.totalDownloads) }} downloads</p>
</div>
</div>
</div>
<AccordionTrigger :heading-level="3">
<span class="flex w-full min-w-0 items-center justify-between gap-4">
<span class="min-w-0 text-start">
<span class="block break-words font-semibold">{{ group.name }}</span>
<span class="block text-sm text-muted-foreground">
{{ group.versions.length }} vulnerable version{{ group.versions.length > 1 ? 's' : '' }}
</span>
</span>
<span class="flex shrink-0 items-center gap-4">
<Badge variant="outline">{{ group.registry }}</Badge>
<span class="whitespace-nowrap text-end tabular-nums">
<span class="block text-sm font-medium">{{ formatBytes(group.totalSize) }}</span>
<span class="block text-xs text-muted-foreground">{{ formatNumber(group.totalDownloads) }} downloads</span>
</span>
</span>
</span>
</AccordionTrigger>
<AccordionContent class="px-4 pb-4">
<div class="space-y-3">
<div
v-for="version in group.versions"
:key="version.id"
class="flex items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 cursor-pointer"
@click="navigateToPackage(version)"
>
<div class="flex items-center space-x-4 flex-1">
<div class="flex-1">
<p class="font-medium text-gray-900">{{ version.version.startsWith('v') ? version.version : 'v' + version.version }}</p>
<div class="flex items-center space-x-4 mt-1 text-sm text-gray-500">
<span>
<i class="fas fa-download mr-1"></i>{{ formatNumber(version.download_count) }}
</span>
<span>
<i class="fas fa-hard-drive mr-1"></i>{{ formatBytes(version.size) }}
</span>
<span>
<i class="fas fa-clock mr-1"></i>{{ formatDate(version.cached_at) }}
</span>
</div>
<!-- Vulnerability Badge -->
<div v-if="version.vulnerabilities" class="mt-2">
<VulnerabilityBadge
:scanned="version.vulnerabilities.scanned"
:status="version.vulnerabilities.status"
:counts="version.vulnerabilities.counts"
:total="version.vulnerabilities.total"
:scannedAt="version.vulnerabilities.scannedAt"
:isBlocked="version.vulnerabilities.isBlocked"
@click.stop="navigateToPackage(version)"
/>
</div>
</div>
</div>
<div class="ml-4 flex-shrink-0">
<i class="fas fa-chevron-right text-gray-400"></i>
</div>
</div>
</div>
<AccordionContent>
<DataTable
:label="`Vulnerable versions of ${group.name}`"
layout="cards"
row-clickable
:columns="versionColumns"
:rows="group.versions"
@row-click="navigateToPackage"
>
<template #cell-vulnerabilities="{ row }">
<VulnerabilityBadge
v-if="row.vulnerabilities"
:scanned="row.vulnerabilities.scanned"
:status="row.vulnerabilities.status"
:counts="row.vulnerabilities.counts"
:total="row.vulnerabilities.total"
:scannedAt="row.vulnerabilities.scannedAt"
:isBlocked="row.vulnerabilities.isBlocked"
@click="navigateToPackage(row)"
/>
</template>
</DataTable>
</AccordionContent>
</AccordionItem>
</Accordion>
</CardContent>
</Card>
</div>
</template>
</div>
</template>
@@ -161,18 +105,30 @@
import { computed, onMounted, ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { usePackageStore, type Package } from '../stores/packages'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Card, CardContent } from '@/components/ui/card'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from '@/components/ui/accordion'
Badge,
Button,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
DataTable,
EmptyState,
ErrorState,
LoadingState,
PageHeader,
type DataTableColumn,
} from '@perfect-design/ui'
import VulnerabilityBadge from './VulnerabilityBadge.vue'
import { getRegistryBadgeClass } from '@/composables/useBadgeStyles'
import SeveritySummary from './SeveritySummary.vue'
import { formatBytes, formatDate, formatNumber, displayVersion, withVersionPrefix } from '@/lib/format'
import { faArrowLeft, faCircleCheck } from '@/lib/icons'
import { NO_VULNERABILITIES } from '@/lib/severity'
const store = usePackageStore()
const router = useRouter()
@@ -195,6 +151,11 @@ async function fetchVulnerablePackages() {
try {
await store.fetchPackages()
// The store records a failed request in store.error and resolves; surface it instead of an empty list.
if (store.error) {
error.value = store.error
return
}
vulnerablePackages.value = store.packages.filter(pkg => {
const isVulnerable = pkg.vulnerabilities?.status === 'vulnerable'
if (showOnlyBlocked.value) {
@@ -267,21 +228,28 @@ const groupedPackages = computed(() => {
})
// Calculate total counts across all packages
const criticalCount = computed(() =>
vulnerablePackages.value.reduce((sum, pkg) => sum + (pkg.vulnerabilities?.counts?.critical || 0), 0)
const totalCounts = computed(() =>
vulnerablePackages.value.reduce(
(sum, pkg) => {
const counts = pkg.vulnerabilities?.counts ?? NO_VULNERABILITIES
return {
critical: sum.critical + counts.critical,
high: sum.high + counts.high,
moderate: sum.moderate + counts.moderate,
low: sum.low + counts.low,
}
},
{ ...NO_VULNERABILITIES },
),
)
const highCount = computed(() =>
vulnerablePackages.value.reduce((sum, pkg) => sum + (pkg.vulnerabilities?.counts?.high || 0), 0)
)
const moderateCount = computed(() =>
vulnerablePackages.value.reduce((sum, pkg) => sum + (pkg.vulnerabilities?.counts?.moderate || 0), 0)
)
const lowCount = computed(() =>
vulnerablePackages.value.reduce((sum, pkg) => sum + (pkg.vulnerabilities?.counts?.low || 0), 0)
)
const versionColumns: DataTableColumn<Package>[] = [
{ key: 'version', header: 'Version', rowHeader: true, accessor: (pkg) => withVersionPrefix(displayVersion(pkg)) },
{ key: 'download_count', header: 'Downloads', numeric: true, accessor: (pkg) => formatNumber(pkg.download_count) },
{ key: 'size', header: 'Size', numeric: true, accessor: (pkg) => formatBytes(pkg.size) },
{ key: 'cached_at', header: 'Cached', accessor: (pkg) => formatDate(pkg.cached_at) },
{ key: 'vulnerabilities', header: 'Vulnerabilities', accessor: () => '' },
]
function navigateToPackage(pkg: Package) {
router.push(`/package/${pkg.registry}/${pkg.name}/${pkg.version}`)
@@ -290,32 +258,4 @@ function navigateToPackage(pkg: Package) {
function goBack() {
router.push('/stats')
}
function formatNumber(num: number): string {
return new Intl.NumberFormat().format(num)
}
function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const k = 1024
const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i]
}
function formatDate(dateString: string): string {
if (!dateString) return 'N/A'
try {
const date = new Date(dateString)
return date.toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit'
})
} catch {
return dateString
}
}
</script>
+50
View File
@@ -0,0 +1,50 @@
<script setup lang="ts">
import { computed } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
import { SidebarNav, type SidebarNavGroup } from '@perfect-design/ui'
import {
faBoxesStacked,
faChartColumn,
faChartPie,
faShieldHalved,
faTriangleExclamation,
} from '@/lib/icons'
// The sidebar slot of AppShell hides itself below md and the header's mobile slot only shows below md,
// so each placement renders one nav and the two never compete for the same viewport.
defineProps<{ readonly sheet?: boolean }>()
const GROUPS: SidebarNavGroup[] = [
{
items: [
{ label: 'Dashboard', to: '/', icon: faChartPie },
{ label: 'Packages', to: '/packages', icon: faBoxesStacked },
{ label: 'Vulnerable', to: '/vulnerable-packages', icon: faTriangleExclamation },
{ label: 'Bypasses', to: '/admin/bypasses', icon: faShieldHalved },
{ label: 'Stats', to: '/stats', icon: faChartColumn },
],
},
]
const SECTION_PREFIXES: ReadonlyArray<readonly [string, string]> = [
['/packages', '/packages'],
['/package/', '/packages'],
['/vulnerable-packages', '/vulnerable-packages'],
['/blocked-packages', '/vulnerable-packages'],
['/admin/bypasses', '/admin/bypasses'],
['/stats', '/stats'],
]
const route = useRoute()
const current = computed(() => SECTION_PREFIXES.find(([prefix]) => route.path.startsWith(prefix))?.[1] ?? '/')
</script>
<template>
<SidebarNav
:groups="GROUPS"
:current="current"
:link-as="RouterLink"
:label="sheet ? 'Sections menu' : 'Sections'"
class="w-full p-3"
/>
</template>
@@ -1,18 +0,0 @@
<script setup lang="ts">
import type { AccordionRootEmits, AccordionRootProps } from "reka-ui"
import {
AccordionRoot,
useForwardPropsEmits,
} from "reka-ui"
const props = defineProps<AccordionRootProps>()
const emits = defineEmits<AccordionRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
</script>
<template>
<AccordionRoot v-bind="forwarded">
<slot />
</AccordionRoot>
</template>
@@ -1,22 +0,0 @@
<script setup lang="ts">
import type { AccordionContentProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { AccordionContent } from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<AccordionContentProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = reactiveOmit(props, "class")
</script>
<template>
<AccordionContent
v-bind="delegatedProps"
class="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
>
<div :class="cn('pb-4 pt-0', props.class)">
<slot />
</div>
</AccordionContent>
</template>
@@ -1,22 +0,0 @@
<script setup lang="ts">
import type { AccordionItemProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { AccordionItem, useForwardProps } from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<AccordionItemProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = reactiveOmit(props, "class")
const forwardedProps = useForwardProps(delegatedProps)
</script>
<template>
<AccordionItem
v-bind="forwardedProps"
:class="cn('border-b', props.class)"
>
<slot />
</AccordionItem>
</template>
@@ -1,36 +0,0 @@
<script setup lang="ts">
import type { AccordionTriggerProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { ChevronDown } from "lucide-vue-next"
import {
AccordionHeader,
AccordionTrigger,
} from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<AccordionTriggerProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = reactiveOmit(props, "class")
</script>
<template>
<AccordionHeader class="flex">
<AccordionTrigger
v-bind="delegatedProps"
:class="
cn(
'flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
props.class,
)
"
>
<slot />
<slot name="icon">
<ChevronDown
class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
/>
</slot>
</AccordionTrigger>
</AccordionHeader>
</template>
@@ -1,4 +0,0 @@
export { default as Accordion } from "./Accordion.vue"
export { default as AccordionContent } from "./AccordionContent.vue"
export { default as AccordionItem } from "./AccordionItem.vue"
export { default as AccordionTrigger } from "./AccordionTrigger.vue"
@@ -1,17 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import type { AlertVariants } from "."
import { cn } from "@/lib/utils"
import { alertVariants } from "."
const props = defineProps<{
class?: HTMLAttributes["class"]
variant?: AlertVariants["variant"]
}>()
</script>
<template>
<div :class="cn(alertVariants({ variant }), props.class)" role="alert">
<slot />
</div>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div :class="cn('text-sm [&_p]:leading-relaxed', props.class)">
<slot />
</div>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<h5 :class="cn('mb-1 font-medium leading-none tracking-tight', props.class)">
<slot />
</h5>
</template>
-24
View File
@@ -1,24 +0,0 @@
import type { VariantProps } from "class-variance-authority"
import { cva } from "class-variance-authority"
export { default as Alert } from "./Alert.vue"
export { default as AlertDescription } from "./AlertDescription.vue"
export { default as AlertTitle } from "./AlertTitle.vue"
export const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
{
variants: {
variant: {
default: "bg-background text-foreground",
destructive:
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
},
},
defaultVariants: {
variant: "default",
},
},
)
export type AlertVariants = VariantProps<typeof alertVariants>
@@ -1,17 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import type { BadgeVariants } from "."
import { cn } from "@/lib/utils"
import { badgeVariants } from "."
const props = defineProps<{
variant?: BadgeVariants["variant"]
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div :class="cn(badgeVariants({ variant }), props.class)">
<slot />
</div>
</template>
-26
View File
@@ -1,26 +0,0 @@
import type { VariantProps } from "class-variance-authority"
import { cva } from "class-variance-authority"
export { default as Badge } from "./Badge.vue"
export const badgeVariants = cva(
"inline-flex gap-1 items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
default:
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
secondary:
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
destructive:
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
outline: "text-foreground",
},
},
defaultVariants: {
variant: "default",
},
},
)
export type BadgeVariants = VariantProps<typeof badgeVariants>
@@ -1,28 +0,0 @@
<script setup lang="ts">
import type { PrimitiveProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import type { ButtonVariants } from "."
import { Primitive } from "reka-ui"
import { cn } from "@/lib/utils"
import { buttonVariants } from "."
interface Props extends PrimitiveProps {
variant?: ButtonVariants["variant"]
size?: ButtonVariants["size"]
class?: HTMLAttributes["class"]
}
const props = withDefaults(defineProps<Props>(), {
as: "button",
})
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="cn(buttonVariants({ variant, size }), props.class)"
>
<slot />
</Primitive>
</template>
@@ -1,38 +0,0 @@
import type { VariantProps } from "class-variance-authority"
import { cva } from "class-variance-authority"
export { default as Button } from "./Button.vue"
export const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
destructive:
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
"default": "h-9 px-4 py-2",
"xs": "h-7 rounded px-2",
"sm": "h-8 rounded-md px-3 text-xs",
"lg": "h-10 rounded-md px-8",
"icon": "h-9 w-9",
"icon-sm": "size-8",
"icon-lg": "size-10",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
)
export type ButtonVariants = VariantProps<typeof buttonVariants>
-21
View File
@@ -1,21 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div
:class="
cn(
'rounded-xl border bg-card text-card-foreground shadow',
props.class,
)
"
>
<slot />
</div>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div :class="cn('p-6 pt-0', props.class)">
<slot />
</div>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<p :class="cn('text-sm text-muted-foreground', props.class)">
<slot />
</p>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div :class="cn('flex items-center p-6 pt-0', props.class)">
<slot />
</div>
</template>
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div :class="cn('flex flex-col gap-y-1.5 p-6', props.class)">
<slot />
</div>
</template>
@@ -1,18 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<h3
:class="
cn('font-semibold leading-none tracking-tight', props.class)
"
>
<slot />
</h3>
</template>
-6
View File
@@ -1,6 +0,0 @@
export { default as Card } from "./Card.vue"
export { default as CardContent } from "./CardContent.vue"
export { default as CardDescription } from "./CardDescription.vue"
export { default as CardFooter } from "./CardFooter.vue"
export { default as CardHeader } from "./CardHeader.vue"
export { default as CardTitle } from "./CardTitle.vue"
@@ -1,15 +0,0 @@
<script setup lang="ts">
import type { DialogRootEmits, DialogRootProps } from "reka-ui"
import { DialogRoot, useForwardPropsEmits } from "reka-ui"
const props = defineProps<DialogRootProps>()
const emits = defineEmits<DialogRootEmits>()
const forwarded = useForwardPropsEmits(props, emits)
</script>
<template>
<DialogRoot v-bind="forwarded">
<slot />
</DialogRoot>
</template>
@@ -1,12 +0,0 @@
<script setup lang="ts">
import type { DialogCloseProps } from "reka-ui"
import { DialogClose } from "reka-ui"
const props = defineProps<DialogCloseProps>()
</script>
<template>
<DialogClose v-bind="props">
<slot />
</DialogClose>
</template>
@@ -1,46 +0,0 @@
<script setup lang="ts">
import type { DialogContentEmits, DialogContentProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { X } from "lucide-vue-next"
import {
DialogClose,
DialogContent,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<DialogContentProps & { class?: HTMLAttributes["class"] }>()
const emits = defineEmits<DialogContentEmits>()
const delegatedProps = reactiveOmit(props, "class")
const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>
<template>
<DialogPortal>
<DialogOverlay
class="fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
/>
<DialogContent
v-bind="forwarded"
:class="
cn(
'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
props.class,
)"
>
<slot />
<DialogClose
class="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
>
<X class="w-4 h-4" />
<span class="sr-only">Close</span>
</DialogClose>
</DialogContent>
</DialogPortal>
</template>
@@ -1,22 +0,0 @@
<script setup lang="ts">
import type { DialogDescriptionProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { DialogDescription, useForwardProps } from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<DialogDescriptionProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = reactiveOmit(props, "class")
const forwardedProps = useForwardProps(delegatedProps)
</script>
<template>
<DialogDescription
v-bind="forwardedProps"
:class="cn('text-sm text-muted-foreground', props.class)"
>
<slot />
</DialogDescription>
</template>
@@ -1,19 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{ class?: HTMLAttributes["class"] }>()
</script>
<template>
<div
:class="
cn(
'flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2',
props.class,
)
"
>
<slot />
</div>
</template>
@@ -1,16 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
const props = defineProps<{
class?: HTMLAttributes["class"]
}>()
</script>
<template>
<div
:class="cn('flex flex-col gap-y-1.5 text-center sm:text-left', props.class)"
>
<slot />
</div>
</template>
@@ -1,55 +0,0 @@
<script setup lang="ts">
import type { DialogContentEmits, DialogContentProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { X } from "lucide-vue-next"
import {
DialogClose,
DialogContent,
DialogOverlay,
DialogPortal,
useForwardPropsEmits,
} from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<DialogContentProps & { class?: HTMLAttributes["class"] }>()
const emits = defineEmits<DialogContentEmits>()
const delegatedProps = reactiveOmit(props, "class")
const forwarded = useForwardPropsEmits(delegatedProps, emits)
</script>
<template>
<DialogPortal>
<DialogOverlay
class="fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
>
<DialogContent
:class="
cn(
'relative z-50 grid w-full max-w-lg my-8 gap-4 border border-border bg-background p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
props.class,
)
"
v-bind="forwarded"
@pointer-down-outside="(event) => {
const originalEvent = event.detail.originalEvent;
const target = originalEvent.target as HTMLElement;
if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
event.preventDefault();
}
}"
>
<slot />
<DialogClose
class="absolute top-4 right-4 p-0.5 transition-colors rounded-md hover:bg-secondary"
>
<X class="w-4 h-4" />
<span class="sr-only">Close</span>
</DialogClose>
</DialogContent>
</DialogOverlay>
</DialogPortal>
</template>
@@ -1,27 +0,0 @@
<script setup lang="ts">
import type { DialogTitleProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { DialogTitle, useForwardProps } from "reka-ui"
import { cn } from "@/lib/utils"
const props = defineProps<DialogTitleProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = reactiveOmit(props, "class")
const forwardedProps = useForwardProps(delegatedProps)
</script>
<template>
<DialogTitle
v-bind="forwardedProps"
:class="
cn(
'text-lg font-semibold leading-none tracking-tight',
props.class,
)
"
>
<slot />
</DialogTitle>
</template>
@@ -1,12 +0,0 @@
<script setup lang="ts">
import type { DialogTriggerProps } from "reka-ui"
import { DialogTrigger } from "reka-ui"
const props = defineProps<DialogTriggerProps>()
</script>
<template>
<DialogTrigger v-bind="props">
<slot />
</DialogTrigger>
</template>
@@ -1,9 +0,0 @@
export { default as Dialog } from "./Dialog.vue"
export { default as DialogClose } from "./DialogClose.vue"
export { default as DialogContent } from "./DialogContent.vue"
export { default as DialogDescription } from "./DialogDescription.vue"
export { default as DialogFooter } from "./DialogFooter.vue"
export { default as DialogHeader } from "./DialogHeader.vue"
export { default as DialogScrollContent } from "./DialogScrollContent.vue"
export { default as DialogTitle } from "./DialogTitle.vue"
export { default as DialogTrigger } from "./DialogTrigger.vue"
@@ -1,24 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { useVModel } from "@vueuse/core"
import { cn } from "@/lib/utils"
const props = defineProps<{
defaultValue?: string | number
modelValue?: string | number
class?: HTMLAttributes["class"]
}>()
const emits = defineEmits<{
(e: "update:modelValue", payload: string | number): void
}>()
const modelValue = useVModel(props, "modelValue", emits, {
passive: true,
defaultValue: props.defaultValue,
})
</script>
<template>
<input v-model="modelValue" :class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)">
</template>
@@ -1 +0,0 @@
export { default as Input } from "./Input.vue"
@@ -1,29 +0,0 @@
<script setup lang="ts">
import type { SeparatorProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { Separator } from "reka-ui"
import { cn } from "@/lib/utils"
const props = withDefaults(defineProps<
SeparatorProps & { class?: HTMLAttributes["class"] }
>(), {
orientation: "horizontal",
decorative: true,
})
const delegatedProps = reactiveOmit(props, "class")
</script>
<template>
<Separator
v-bind="delegatedProps"
:class="
cn(
'shrink-0 bg-border',
props.orientation === 'horizontal' ? 'h-px w-full' : 'w-px h-full',
props.class,
)
"
/>
</template>
@@ -1 +0,0 @@
export { default as Separator } from "./Separator.vue"
@@ -1,14 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from "vue"
import { cn } from "@/lib/utils"
interface SkeletonProps {
class?: HTMLAttributes["class"]
}
const props = defineProps<SkeletonProps>()
</script>
<template>
<div :class="cn('animate-pulse rounded-md bg-primary/10', props.class)" />
</template>
@@ -1 +0,0 @@
export { default as Skeleton } from "./Skeleton.vue"
@@ -1,15 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<div class="relative w-full overflow-auto">
<table :class="cn('w-full caption-bottom text-sm', props.class)">
<slot />
</table>
</div>
</template>
@@ -1,13 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<tbody :class="cn('[&_tr:last-child]:border-0', props.class)">
<slot />
</tbody>
</template>
@@ -1,13 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<td :class="cn('p-4 align-middle [&:has([role=checkbox])]:pr-0', props.class)">
<slot />
</td>
</template>
@@ -1,13 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<th :class="cn('h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0', props.class)">
<slot />
</th>
</template>
@@ -1,13 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<thead :class="cn('[&_tr]:border-b', props.class)">
<slot />
</thead>
</template>
@@ -1,13 +0,0 @@
<script setup lang="ts">
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: string
}>()
</script>
<template>
<tr :class="cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', props.class)">
<slot />
</tr>
</template>
@@ -1,6 +0,0 @@
export { default as Table } from './Table.vue'
export { default as TableHeader } from './TableHeader.vue'
export { default as TableBody } from './TableBody.vue'
export { default as TableRow } from './TableRow.vue'
export { default as TableHead } from './TableHead.vue'
export { default as TableCell } from './TableCell.vue'
@@ -0,0 +1,107 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import axios from 'axios'
import { flushPromises } from '@vue/test-utils'
import App from '@/App.vue'
import Dashboard from './Dashboard.vue'
import PackageList from './PackageList.vue'
import PackageDetails from './PackageDetails.vue'
import VulnerablePackages from './VulnerablePackages.vue'
import BypassManagementPanel from './BypassManagementPanel.vue'
import Stats from './Stats.vue'
import { __resetRealtimeSingleton, useRealtimeStore } from '@/stores/realtime'
import { mountStrict } from '@/test/mountStrict'
import { createTestRouter } from '@/test/router'
vi.mock('axios')
const FAILURE = Object.assign(new Error('Request failed with status code 502'), {
response: { status: 502, data: {} },
})
// What each view must not say when the request failed: an empty state would tell the operator there is nothing to see.
const EMPTY_TEXT: Record<string, string> = {
Dashboard: 'No packages cached yet',
PackageList: 'No packages cached yet',
VulnerablePackages: 'No vulnerable packages',
Stats: 'No registries reported',
BypassManagementPanel: 'No bypasses found',
}
const CASES: Array<[string, Parameters<typeof mountStrict>[0], string]> = [
['Dashboard', Dashboard, '/'],
['PackageList', PackageList, '/packages'],
['PackageDetails', PackageDetails, '/package/npm/left-pad/1.3.0'],
['VulnerablePackages', VulnerablePackages, '/vulnerable-packages'],
['BypassManagementPanel', BypassManagementPanel, '/admin/bypasses'],
['Stats', Stats, '/stats'],
]
let restore: (() => void) | undefined
beforeEach(() => {
setActivePinia(createPinia())
__resetRealtimeSingleton()
vi.mocked(axios.get).mockRejectedValue(FAILURE)
localStorage.setItem('admin_api_key', 'test-key')
})
afterEach(() => {
restore?.()
restore = undefined
localStorage.clear()
vi.restoreAllMocks()
})
describe('an API failure renders ErrorState, never an empty state', () => {
it.each(CASES)('%s', async (name, component, path) => {
const router = await createTestRouter(path)
const pinia = createPinia()
setActivePinia(pinia)
vi.spyOn(useRealtimeStore(), 'connect').mockImplementation(() => {})
vi.spyOn(console, 'error').mockImplementation(() => {})
const mounted = await mountStrict(component, { global: { plugins: [pinia, router] } })
restore = mounted.restore
await flushPromises()
const state = mounted.wrapper.find('[data-slot="error-state"]')
expect(state.exists()).toBe(true)
expect(state.text()).toContain('502')
expect(state.find('button').text()).toMatch(/try again/i)
expect(mounted.wrapper.find('[data-slot="empty-state"]').exists()).toBe(false)
if (EMPTY_TEXT[name]) expect(mounted.wrapper.text()).not.toContain(EMPTY_TEXT[name])
})
it('retry fetches again and clears the error when the backend is back', async () => {
const router = await createTestRouter('/vulnerable-packages')
const pinia = createPinia()
setActivePinia(pinia)
const mounted = await mountStrict(VulnerablePackages, { global: { plugins: [pinia, router] } })
restore = mounted.restore
vi.mocked(axios.get).mockResolvedValue({ data: { packages: [] } })
await mounted.wrapper.find('[data-slot="error-state"] button').trigger('click')
await flushPromises()
expect(mounted.wrapper.find('[data-slot="error-state"]').exists()).toBe(false)
expect(mounted.wrapper.text()).toContain('No vulnerable packages')
})
})
describe('unknown routes', () => {
it('render NotFound with a link to the dashboard', async () => {
vi.mocked(axios.get).mockResolvedValue({ data: {} })
const router = await createTestRouter('/vulnerable')
const pinia = createPinia()
setActivePinia(pinia)
vi.spyOn(useRealtimeStore(), 'connect').mockImplementation(() => {})
const mounted = await mountStrict(App, { global: { plugins: [pinia, router] } })
restore = mounted.restore
await flushPromises()
expect(mounted.problems).toEqual([])
const main = mounted.wrapper.find('main')
expect(main.find('h1').text()).toBe('Page not found')
expect(main.find('[data-slot="empty-state"]').text()).toContain('/vulnerable')
const link = main.find('a[href="/"]')
expect(link.text()).toMatch(/dashboard/i)
})
})
+305
View File
@@ -0,0 +1,305 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import axios from 'axios'
import { flushPromises } from '@vue/test-utils'
import App from '@/App.vue'
import Dashboard from './Dashboard.vue'
import PackageList from './PackageList.vue'
import PackageDetails from './PackageDetails.vue'
import VulnerablePackages from './VulnerablePackages.vue'
import BypassManagementPanel from './BypassManagementPanel.vue'
import Stats from './Stats.vue'
import VulnerabilityBadge from './VulnerabilityBadge.vue'
import { __resetRealtimeSingleton, useRealtimeStore } from '@/stores/realtime'
import { usePackageStore } from '@/stores/packages'
import { BYPASSES, PACKAGES, REGISTRIES, STATS, TIMESERIES, VULNERABILITY_REPORT } from '@/test/fixtures'
import { mountStrict } from '@/test/mountStrict'
import { createTestRouter } from '@/test/router'
vi.mock('axios')
const API_KEY_STORAGE = 'admin_api_key'
function respond(url: string) {
if (url.startsWith('/api/stats/timeseries')) return { data: TIMESERIES }
if (url.startsWith('/api/stats')) return { data: { stats: STATS, registries: REGISTRIES } }
if (url.endsWith('/vulnerabilities')) return { data: VULNERABILITY_REPORT }
if (url.startsWith('/api/admin/bypasses')) return { data: { bypasses: BYPASSES } }
if (url.startsWith('/api/packages')) return { data: { packages: PACKAGES } }
throw new Error(`unexpected request: ${url}`)
}
let restore: (() => void) | undefined
beforeEach(() => {
setActivePinia(createPinia())
__resetRealtimeSingleton()
vi.mocked(axios.get).mockImplementation(async (url: string) => respond(url) as never)
localStorage.setItem(API_KEY_STORAGE, 'test-key')
})
afterEach(() => {
restore?.()
restore = undefined
localStorage.clear()
vi.restoreAllMocks()
})
async function smoke(component: Parameters<typeof mountStrict>[0], path: string, props: Record<string, unknown> = {}) {
const router = await createTestRouter(path)
const pinia = createPinia()
setActivePinia(pinia)
vi.spyOn(useRealtimeStore(), 'connect').mockImplementation(() => {})
const mounted = await mountStrict(component, { props, global: { plugins: [pinia, router] } })
restore = mounted.restore
return mounted
}
describe('view smoke tests (strict mode throw, fixture data)', () => {
it('Dashboard renders the tiles, chart, feed and recent packages', async () => {
const router = await createTestRouter('/')
const pinia = createPinia()
setActivePinia(pinia)
const rt = useRealtimeStore()
vi.spyOn(rt, 'connect').mockImplementation(() => {})
rt.events = [{ type: 'package_cached', payload: { name: 'left-pad', version: '1.3.0', registry: 'npm' }, timestamp: Date.now() }]
const { wrapper, problems, restore: r } = await mountStrict(Dashboard, { global: { plugins: [pinia, router] } })
restore = r
await flushPromises()
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('Dashboard')
expect(wrapper.text()).toContain('Total packages')
expect(wrapper.find('[data-testid="ws-event-feed"]').text()).toContain('left-pad')
expect(wrapper.find('[role="img"]').exists()).toBe(true)
expect(wrapper.text()).toContain('Recent packages')
expect(wrapper.text()).toContain('github.com/example/module')
})
it('PackageList groups fixture packages and shows severity words', async () => {
const { wrapper, problems } = await smoke(PackageList, '/packages')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('Packages')
expect(wrapper.text()).toContain('left-pad')
expect(wrapper.text()).toContain('2 versions')
expect(wrapper.text()).toContain('requests')
const trigger = wrapper.findAll('button').find((b) => b.text().includes('left-pad'))
await trigger!.trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('Critical: 1')
expect(wrapper.text()).toContain('Blocked')
})
it('PackageDetails renders the report, severity table and expanded row', async () => {
const { wrapper, problems } = await smoke(PackageDetails, '/package/npm/left-pad/1.3.0')
const router = (wrapper.vm as unknown as { $router: Awaited<ReturnType<typeof createTestRouter>> }).$router
await router.push('/package/npm/left-pad/1.3.0')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('left-pad')
expect(wrapper.text()).toContain('Security scan summary')
expect(wrapper.text()).toContain('trivy')
// Most severe first: CRITICAL, HIGH, then LOW.
const ids = wrapper.findAll('tbody td.font-mono').map((td) => td.text().replace('CVE ID', ''))
expect(ids.slice(0, 3)).toEqual(['CVE-2026-0002', 'CVE-2026-0003', 'CVE-2026-0001'])
await wrapper.find('button[aria-label^="Show details for CVE-2026-0002"]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('Bypass active')
expect(wrapper.text()).toContain('No fix available')
})
it('VulnerablePackages lists the vulnerable fixture packages', async () => {
const { wrapper, problems } = await smoke(VulnerablePackages, '/vulnerable-packages')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('Vulnerable packages')
expect(wrapper.text()).toContain('left-pad')
expect(wrapper.text()).not.toContain('requests')
expect(wrapper.text()).toContain('Critical')
})
it('VulnerablePackages on the blocked route keeps only blocked packages', async () => {
const { wrapper, problems } = await smoke(VulnerablePackages, '/blocked-packages')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('Blocked packages')
expect(wrapper.text()).toContain('1 vulnerable version')
})
it('BypassManagementPanel lists bypasses and opens the create dialog', async () => {
const { wrapper, problems } = await smoke(BypassManagementPanel, '/admin/bypasses')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('CVE bypass management')
expect(wrapper.text()).toContain('CVE-2026-0002')
expect(wrapper.text()).toContain('Expired')
const create = wrapper.findAll('button').find((b) => b.text() === 'Create bypass')
await create!.trigger('click')
await flushPromises()
expect(document.body.textContent).toContain('Create a temporary bypass for a CVE or package.')
expect(document.body.querySelector('textarea')).not.toBeNull()
})
it('BypassManagementPanel asks for the admin key in a dialog, not a native prompt', async () => {
localStorage.clear()
const prompt = vi.spyOn(window, 'prompt')
const { wrapper, problems } = await smoke(BypassManagementPanel, '/admin/bypasses')
await flushPromises()
expect(problems).toEqual([])
expect(prompt).not.toHaveBeenCalled()
expect(document.body.textContent).toContain('Enter your admin API key to manage bypasses.')
const input = document.body.querySelector<HTMLInputElement>('input[type="password"]')
expect(input).not.toBeNull()
input!.value = 'secret-key'
input!.dispatchEvent(new Event('input', { bubbles: true }))
await flushPromises()
document.body.querySelector<HTMLFormElement>('input[type="password"]')!.form!.requestSubmit()
await flushPromises()
expect(localStorage.getItem('admin_api_key')).toBe('secret-key')
expect(vi.mocked(axios.get)).toHaveBeenCalledWith(
expect.stringContaining('/api/admin/bypasses'),
expect.objectContaining({ headers: { Authorization: 'Bearer secret-key' } }),
)
expect(wrapper.text()).toContain('CVE-2026-0002')
})
it('Stats renders totals, the storage tile and the registry table', async () => {
const { wrapper, problems } = await smoke(Stats, '/stats')
expect(problems).toEqual([])
expect(wrapper.find('h1').text()).toBe('Statistics')
expect(wrapper.text()).toContain('5 GB / 10 GB')
expect(wrapper.text()).toContain('50.0% used')
expect(wrapper.text()).toContain('Go modules')
expect(wrapper.find('[role="progressbar"]').exists()).toBe(true)
})
it('VulnerabilityBadge prints the severity word for every tone', async () => {
const { wrapper, problems } = await smoke(VulnerabilityBadge, '/', {
scanned: true,
status: 'vulnerable',
counts: { critical: 1, high: 2, moderate: 3, low: 4 },
total: 10,
isBlocked: true,
})
expect(problems).toEqual([])
const text = wrapper.text()
for (const word of ['Blocked', 'Critical: 1', 'High: 2', 'Moderate: 3', 'Low: 4']) expect(text).toContain(word)
const tones = wrapper.findAll('[data-slot="status-badge"]').map((b) => b.attributes('data-tone'))
expect(tones).toEqual(['danger', 'danger', 'warning', 'info', 'neutral'])
})
it('App renders one banner, one main, a skip link first and the five sections', async () => {
const { wrapper, problems } = await smoke(App, '/')
expect(problems).toEqual([])
// A page's own <header> inside <main> is not a banner landmark.
expect(document.body.querySelectorAll('header:not(main header)').length).toBe(1)
expect(document.body.querySelectorAll('main').length).toBe(1)
const first = document.body.querySelector<HTMLElement>('a[href], button')
expect(first?.getAttribute('href')).toBe('#main-content')
const nav = wrapper.find('nav[aria-label="Sections"]')
expect(nav.findAll('a').map((a) => a.text())).toEqual(['Dashboard', 'Packages', 'Vulnerable', 'Bypasses', 'Stats'])
expect(document.documentElement.getAttribute('data-style')).toBe('workbench')
// Brand column and sidebar items share one left edge: 6 spacing units each.
expect(document.body.querySelector('header')?.className).toContain('[&>div]:px-6')
expect(nav.classes()).toContain('p-3')
})
it('PackageList still fetches through the store on mount', async () => {
await smoke(PackageList, '/packages')
expect(usePackageStore().packagePage.packages.length).toBe(PACKAGES.length)
})
})
describe('PyPI rows show the release version, not the file name', () => {
const FILE = 'six-1.17.0-py2.py3-none-any.whl'
const SIX = {
id: 'pypi-six',
registry: 'pypi',
name: 'six',
version: FILE,
release_version: '1.17.0',
size: 1,
cached_at: '2026-02-01T10:00:00Z',
last_accessed: '2026-02-01T10:00:00Z',
download_count: 1,
vulnerabilities: {
scanned: true,
status: 'vulnerable',
counts: { critical: 1, high: 0, moderate: 0, low: 0 },
total: 1,
scannedAt: '2026-02-01T10:05:00Z',
isBlocked: false,
},
}
beforeEach(() => {
vi.mocked(axios.get).mockImplementation(async (url: string) => {
if (url.endsWith('/vulnerabilities')) {
return { data: { ...VULNERABILITY_REPORT, package: { release_version: '1.17.0' } } } as never
}
if (url.startsWith('/api/packages')) return { data: { packages: [SIX] } } as never
return respond(url) as never
})
})
it('Dashboard recent packages', async () => {
const { wrapper } = await smoke(Dashboard, '/')
await flushPromises()
expect(wrapper.text()).toContain('v1.17.0')
expect(wrapper.text()).not.toContain('py2.py3-none-any.whl')
})
it('Dashboard activity feed', async () => {
const router = await createTestRouter('/')
const pinia = createPinia()
setActivePinia(pinia)
const rt = useRealtimeStore()
vi.spyOn(rt, 'connect').mockImplementation(() => {})
rt.events = [{ type: 'package_cached', payload: { name: 'six', version: FILE, release_version: '1.17.0', registry: 'pypi' }, timestamp: Date.now() }]
const { wrapper, restore: r } = await mountStrict(Dashboard, { global: { plugins: [pinia, router] } })
restore = r
await flushPromises()
const feed = wrapper.find('[data-testid="ws-event-feed"]').text()
expect(feed).toContain('[email protected]')
expect(feed).not.toContain('whl')
})
it('VulnerablePackages version column', async () => {
const { wrapper } = await smoke(VulnerablePackages, '/vulnerable-packages')
await flushPromises()
await wrapper.find('button[aria-expanded]').trigger('click')
await flushPromises()
expect(wrapper.text()).toContain('v1.17.0')
expect(wrapper.text()).not.toContain('py2.py3-none-any.whl')
})
it('PackageDetails header badge', async () => {
const { wrapper } = await smoke(PackageDetails, `/package/pypi/six/${FILE}`)
const router = (wrapper.vm as unknown as { $router: Awaited<ReturnType<typeof createTestRouter>> }).$router
await router.push(`/package/pypi/six/${FILE}`)
await flushPromises()
expect(wrapper.text()).toContain('v1.17.0')
expect(wrapper.text()).not.toContain('py2.py3-none-any.whl')
})
it('PackageDetails falls back to the route version without a release version', async () => {
vi.mocked(axios.get).mockImplementation(async (url: string) => respond(url) as never)
const { wrapper } = await smoke(PackageDetails, '/package/npm/left-pad/1.3.0')
const router = (wrapper.vm as unknown as { $router: Awaited<ReturnType<typeof createTestRouter>> }).$router
await router.push('/package/npm/left-pad/1.3.0')
await flushPromises()
expect(wrapper.text()).toContain('v1.3.0')
})
it('bypass form tells PyPI users to use the release version', async () => {
const { wrapper } = await smoke(BypassManagementPanel, '/admin/bypasses')
await wrapper.findAll('button').find((b) => b.text() === 'Create bypass')!.trigger('click')
await flushPromises()
const pkg = Array.from(document.body.querySelectorAll<HTMLElement>('button, [role="radio"]')).find((e) => e.textContent?.trim() === 'Package bypass')
pkg!.click()
await flushPromises()
expect(document.body.textContent).toContain('pypi/[email protected]')
})
})
@@ -1,59 +0,0 @@
/**
* Shared badge styling utilities for consistent UI across the application
*/
/**
* Get Tailwind CSS classes for severity badges (light theme)
* @param severity - Severity level (CRITICAL, HIGH, MODERATE/MEDIUM, LOW)
* @returns Tailwind CSS class string
*/
export function getSeverityBadgeClass(severity: string): string {
const classes: Record<string, string> = {
CRITICAL: 'bg-red-100 text-red-800 border-red-300',
HIGH: 'bg-orange-100 text-orange-800 border-orange-300',
MEDIUM: 'bg-yellow-100 text-yellow-800 border-yellow-300',
MODERATE: 'bg-yellow-100 text-yellow-800 border-yellow-300',
LOW: 'bg-blue-100 text-blue-800 border-blue-300',
}
return classes[severity.toUpperCase()] || 'bg-gray-100 text-gray-800 border-gray-300'
}
/**
* Get Tailwind CSS classes for registry badges (light theme)
* @param registry - Registry name (npm, pypi, go)
* @returns Tailwind CSS class string
*/
export function getRegistryBadgeClass(registry: string): string {
const classes: Record<string, string> = {
npm: 'bg-red-100 text-red-800 border-red-300',
pypi: 'bg-blue-100 text-blue-800 border-blue-300',
go: 'bg-cyan-100 text-cyan-800 border-cyan-300',
}
return classes[registry.toLowerCase()] || 'bg-gray-100 text-gray-800 border-gray-300'
}
/**
* Get Tailwind CSS classes for vulnerability border indicators
* @param severity - Severity level (CRITICAL, HIGH, MODERATE/MEDIUM, LOW)
* @returns Tailwind CSS class string for left border
*/
export function getVulnerabilityBorderClass(severity: string): string {
const classes: Record<string, string> = {
CRITICAL: 'border-l-4 border-l-red-600',
HIGH: 'border-l-4 border-l-orange-500',
MEDIUM: 'border-l-4 border-l-yellow-500',
MODERATE: 'border-l-4 border-l-yellow-500',
LOW: 'border-l-4 border-l-blue-500',
}
return classes[severity.toUpperCase()] || 'border-l-4 border-l-gray-500'
}
/**
* Format severity name for display (title case)
* @param severity - Severity level (e.g., "CRITICAL", "HIGH")
* @returns Formatted severity name (e.g., "Critical", "High")
*/
export function formatSeverityName(severity: string): string {
const normalized = severity.toUpperCase()
return normalized.charAt(0) + normalized.slice(1).toLowerCase()
}
+15
View File
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest'
import { formatDuration } from './format'
describe('formatDuration', () => {
it.each([
[604800, '7 days'],
[86400, '1 day'],
[129600, '36 hours'],
[3600, '1 hour'],
[5400, '90 minutes'],
[60, '1 minute'],
])('formats %i seconds as %s', (seconds, expected) => {
expect(formatDuration(seconds)).toBe(expected)
})
})
+42
View File
@@ -0,0 +1,42 @@
const BYTE_UNITS = ['B', 'KB', 'MB', 'GB', 'TB']
const BYTES_PER_UNIT = 1024
export function formatNumber(num: number): string {
return new Intl.NumberFormat().format(num)
}
export function formatBytes(bytes: number): string {
if (bytes === 0) return '0 B'
const i = Math.floor(Math.log(bytes) / Math.log(BYTES_PER_UNIT))
return Math.round((bytes / Math.pow(BYTES_PER_UNIT, i)) * 100) / 100 + ' ' + BYTE_UNITS[i]
}
const SECONDS_PER_DAY = 86400
const SECONDS_PER_HOUR = 3600
const SECONDS_PER_MINUTE = 60
function plural(n: number, unit: string): string {
return `${n} ${unit}${n === 1 ? '' : 's'}`
}
/** Whole days, hours or minutes, using the largest unit that divides the span evenly. */
export function formatDuration(seconds: number): string {
if (seconds % SECONDS_PER_DAY === 0) return plural(seconds / SECONDS_PER_DAY, 'day')
if (seconds % SECONDS_PER_HOUR === 0) return plural(seconds / SECONDS_PER_HOUR, 'hour')
return plural(Math.round(seconds / SECONDS_PER_MINUTE), 'minute')
}
export function formatDate(date: string): string {
if (!date) return 'N/A'
const parsed = new Date(date)
return Number.isNaN(parsed.getTime()) ? date : parsed.toLocaleString()
}
/** PyPI rows key on the file name; show the release version when the API sends one. */
export function displayVersion(pkg: { version: string; release_version?: string }): string {
return pkg.release_version || pkg.version
}
export function withVersionPrefix(version: string): string {
return version.startsWith('v') ? version : 'v' + version
}
+24
View File
@@ -0,0 +1,24 @@
export {
faArrowLeft,
faBan,
faBox,
faBoxOpen,
faBoxesStacked,
faChartColumn,
faChartLine,
faChartPie,
faDownload,
faHardDrive,
faPen,
faShieldHalved,
faTrash,
faTriangleExclamation,
} from '@fortawesome/free-solid-svg-icons'
export {
faCircleCheck,
faMagnifyingGlass,
faPlus,
faRotateRight,
faChevronDown,
faChevronUp,
} from '@perfect-design/ui/lib/icons'
+33
View File
@@ -0,0 +1,33 @@
import type { VulnerabilityCounts } from '@/stores/packages'
export type SeverityTone = 'danger' | 'warning' | 'info' | 'neutral'
export const SEVERITY_TONES: Record<string, SeverityTone> = {
critical: 'danger',
high: 'warning',
moderate: 'info',
medium: 'info',
low: 'neutral',
}
export const SEVERITY_RANK: Record<string, number> = {
critical: 4,
high: 3,
moderate: 2,
medium: 2,
low: 1,
}
export const SEVERITY_LEVELS = ['critical', 'high', 'moderate', 'low'] as const
export type SeverityLevel = (typeof SEVERITY_LEVELS)[number]
export const NO_VULNERABILITIES: VulnerabilityCounts = { critical: 0, high: 0, moderate: 0, low: 0 }
export function severityRank(severity: string): number {
return SEVERITY_RANK[severity.toLowerCase()] ?? 0
}
export function formatSeverityName(severity: string): string {
const lower = severity.toLowerCase()
return lower.charAt(0).toUpperCase() + lower.slice(1)
}
-7
View File
@@ -1,7 +0,0 @@
import type { ClassValue } from "clsx"
import { clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
+3
View File
@@ -1,9 +1,12 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { configureStrictMode } from '@perfect-design/ui'
import router from './router'
import App from './App.vue'
import './styles/main.css'
configureStrictMode(import.meta.env.DEV ? 'throw' : 'warn')
const app = createApp(App)
app.use(createPinia())
+51 -51
View File
@@ -1,53 +1,53 @@
import { createRouter, createWebHistory } from 'vue-router'
import Dashboard from '../components/Dashboard.vue'
import PackageList from '../components/PackageList.vue'
import PackageDetails from '../components/PackageDetails.vue'
import Stats from '../components/Stats.vue'
import VulnerablePackages from '../components/VulnerablePackages.vue'
import BypassManagementPanel from '../components/BypassManagementPanel.vue'
import { createRouter, createWebHistory, type RouteRecordRaw, type RouterHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'dashboard',
component: Dashboard,
},
{
path: '/packages/:registry?',
name: 'packages',
component: PackageList,
props: true,
},
{
// Separate route for package details - supports names with slashes (Go packages)
path: '/package/:registry/:name+/:version',
name: 'package-details',
component: PackageDetails,
props: true,
},
{
path: '/stats',
name: 'stats',
component: Stats,
},
{
path: '/vulnerable-packages',
name: 'vulnerable-packages',
component: VulnerablePackages,
},
{
path: '/blocked-packages',
name: 'blocked-packages',
component: VulnerablePackages,
},
{
path: '/admin/bypasses',
name: 'bypasses',
component: BypassManagementPanel,
},
],
})
export const routes: RouteRecordRaw[] = [
{
path: '/',
name: 'dashboard',
component: () => import('../components/Dashboard.vue'),
},
{
path: '/packages/:registry?',
name: 'packages',
component: () => import('../components/PackageList.vue'),
props: true,
},
{
// Separate route for package details - supports names with slashes (Go packages)
path: '/package/:registry/:name+/:version',
name: 'package-details',
component: () => import('../components/PackageDetails.vue'),
props: true,
},
{
path: '/stats',
name: 'stats',
component: () => import('../components/Stats.vue'),
},
{
path: '/vulnerable-packages',
name: 'vulnerable-packages',
component: () => import('../components/VulnerablePackages.vue'),
},
{
path: '/blocked-packages',
name: 'blocked-packages',
component: () => import('../components/VulnerablePackages.vue'),
},
{
path: '/admin/bypasses',
name: 'bypasses',
component: () => import('../components/BypassManagementPanel.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'not-found',
component: () => import('../components/NotFound.vue'),
},
]
export default router
export function createAppRouter(history: RouterHistory = createWebHistory()) {
return createRouter({ history, routes })
}
export default createAppRouter()
+120
View File
@@ -0,0 +1,120 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import axios from 'axios'
import { usePackageStore, RECENT_PACKAGES, type Package } from './packages'
vi.mock('axios')
function pkg(id: number, cachedAt: string, over: Partial<Package> = {}): Package {
return {
id: String(id),
registry: 'npm',
name: `p${id}`,
version: '1.0.0',
size: 1,
cached_at: cachedAt,
last_accessed: cachedAt,
download_count: 0,
...over,
}
}
describe('package store paging', () => {
beforeEach(() => {
setActivePinia(createPinia())
vi.mocked(axios.get).mockReset()
})
afterEach(() => vi.restoreAllMocks())
it('sends page, page_size, registry and q; skips the all-registries and empty values', async () => {
vi.mocked(axios.get).mockResolvedValue({ data: { packages: [], total_groups: 0 } })
const store = usePackageStore()
await store.fetchPackagePage({ page: 2, pageSize: 25, registry: 'pypi', q: ' six ' })
await store.fetchPackagePage({ page: 1, pageSize: 25, registry: 'all', q: '' })
expect(vi.mocked(axios.get).mock.calls.map((c) => c[0])).toEqual([
'/api/packages?page=2&page_size=25&registry=pypi&q=six',
'/api/packages?page=1&page_size=25',
])
})
it('keeps the server group count, and counts groups itself when the server sends none', async () => {
const store = usePackageStore()
vi.mocked(axios.get).mockResolvedValueOnce({ data: { packages: [pkg(1, '2026-01-01T00:00:00Z')], total_groups: 80 } })
await store.fetchPackagePage({ page: 3, pageSize: 25 })
expect(store.packagePage).toMatchObject({ totalGroups: 80, page: 3, pageSize: 25 })
vi.mocked(axios.get).mockResolvedValueOnce({
data: { packages: [pkg(1, '2026-01-01T00:00:00Z'), pkg(1, '2026-01-02T00:00:00Z', { version: '2.0.0' })] },
})
await store.fetchPackagePage({ page: 1, pageSize: 25 })
expect(store.packagePage.totalGroups).toBe(1)
})
it('drops the answer of a request a newer one has replaced', async () => {
const store = usePackageStore()
let release: (v: unknown) => void = () => {}
vi.mocked(axios.get)
.mockImplementationOnce(() => new Promise((resolve) => { release = resolve }))
.mockResolvedValueOnce({ data: { packages: [pkg(2, '2026-01-01T00:00:00Z')], total_groups: 1 } })
const slow = store.fetchPackagePage({ page: 1, pageSize: 25, q: 'old' })
await store.fetchPackagePage({ page: 1, pageSize: 25, q: 'new' })
release({ data: { packages: [pkg(1, '2026-01-01T00:00:00Z')], total_groups: 1 } })
await slow
expect(store.packagePage.packages.map((p) => p.id)).toEqual(['2'])
expect(store.loading).toBe(false)
})
it('reports a failed page request and leaves the last page in place', async () => {
const store = usePackageStore()
vi.spyOn(console, 'error').mockImplementation(() => {})
vi.mocked(axios.get).mockResolvedValueOnce({ data: { packages: [pkg(1, '2026-01-01T00:00:00Z')], total_groups: 1 } })
await store.fetchPackagePage({ page: 1, pageSize: 25 })
vi.mocked(axios.get).mockRejectedValueOnce(new Error('502'))
await store.fetchPackagePage({ page: 1, pageSize: 25 })
expect(store.error).toBe('502')
expect(store.packagePage.packages).toHaveLength(1)
expect(store.loading).toBe(false)
})
it('recent packages: small page sorted by cached_at, newest ten rows, newest first', async () => {
const rows = Array.from({ length: 14 }, (_, i) => pkg(i, `2026-01-${String(i + 1).padStart(2, '0')}T00:00:00Z`))
vi.mocked(axios.get).mockResolvedValue({ data: { packages: rows, total_groups: 14 } })
const store = usePackageStore()
await store.fetchRecentPackages()
expect(vi.mocked(axios.get)).toHaveBeenCalledWith(`/api/packages?page=1&page_size=${RECENT_PACKAGES}&sort=cached_at&order=desc`)
expect(store.recentPackages).toHaveLength(RECENT_PACKAGES)
expect(store.recentPackages[0].id).toBe('13')
expect(store.recentPackages[9].id).toBe('4')
})
it('loading stays on until the last overlapping request settles', async () => {
const store = usePackageStore()
const releases: Array<(v: unknown) => void> = []
vi.mocked(axios.get).mockImplementation(() => new Promise((resolve) => releases.push(resolve)))
const stats = store.fetchStats()
const recent = store.fetchRecentPackages()
expect(store.loading).toBe(true)
releases[0]({ data: { stats: { total_packages: 1 }, registries: {} } })
await stats
expect(store.loading).toBe(true)
releases[1]({ data: { packages: [] } })
await recent
expect(store.loading).toBe(false)
})
it('delete removes one version and leaves reloading to the caller', async () => {
vi.mocked(axios.delete).mockResolvedValue({})
const store = usePackageStore()
await store.deletePackage('npm', 'left-pad', '1.0.0')
expect(vi.mocked(axios.delete)).toHaveBeenCalledWith('/api/packages/npm/left-pad/1.0.0')
expect(vi.mocked(axios.get)).not.toHaveBeenCalled()
})
})
+114 -9
View File
@@ -23,6 +23,7 @@ export interface Package {
registry: string
name: string
version: string
release_version?: string
size: number
cached_at: string
last_accessed: string
@@ -39,18 +40,64 @@ export interface Stats {
scanned_packages: number
vulnerable_packages: number
blocked_packages: number
/** Seconds a cached item can go unrequested before cleanup removes it; 0 means never. */
idle_ttl?: number
}
export type PackageSort = 'name' | 'cached_at' | 'downloads' | 'size'
export interface PackagePageParams {
page: number
pageSize: number
/** Empty or 'all' means every registry. */
registry?: string
/** Case-insensitive match on name, version or release version. */
q?: string
sort?: PackageSort
order?: 'asc' | 'desc'
}
/** One page of package groups: every version row of each group, in group order. */
export interface PackagePage {
packages: Package[]
totalGroups: number
page: number
pageSize: number
}
/** Rows shown under "Recent packages". */
export const RECENT_PACKAGES = 10
function distinctGroups(rows: Package[]): number {
return new Set(rows.map((p) => `${p.registry}\u0000${p.name}`)).size
}
export const usePackageStore = defineStore('packages', () => {
const packages = ref<Package[]>([])
const packagePage = ref<PackagePage>({ packages: [], totalGroups: 0, page: 1, pageSize: 25 })
const recentPackages = ref<Package[]>([])
const stats = ref<Stats | null>(null)
const registries = ref<Record<string, any>>({})
const loading = ref(false)
const error = ref<string | null>(null)
async function fetchPackages() {
// Requests overlap (stats next to the recent list, a new search before the last answer),
// so loading stays on until the last one settles.
let inFlight = 0
function begin() {
inFlight++
loading.value = true
error.value = null
}
function settle() {
inFlight = Math.max(inFlight - 1, 0)
if (inFlight === 0) loading.value = false
}
let pageRequest = 0
/** Every package, unpaginated. Only views that filter on scan results need it. */
async function fetchPackages() {
begin()
try {
const response = await axios.get('/api/packages')
// Only update packages if we got valid data
@@ -65,13 +112,68 @@ export const usePackageStore = defineStore('packages', () => {
error.value = err.message
// Don't clear packages on error - keep showing the cached data
} finally {
loading.value = false
settle()
}
}
async function fetchPackagePage(params: PackagePageParams) {
const request = ++pageRequest
begin()
try {
const query = new URLSearchParams({ page: String(params.page), page_size: String(params.pageSize) })
if (params.registry && params.registry !== 'all') query.set('registry', params.registry)
if (params.q?.trim()) query.set('q', params.q.trim())
if (params.sort) query.set('sort', params.sort)
if (params.order) query.set('order', params.order)
const response = await axios.get(`/api/packages?${query.toString()}`)
// A newer request is on its way; its answer must win.
if (request !== pageRequest) return
const data = response.data
if (data && Array.isArray(data.packages)) {
packagePage.value = {
packages: data.packages,
totalGroups: Number.isFinite(data.total_groups) ? data.total_groups : distinctGroups(data.packages),
page: params.page,
pageSize: params.pageSize,
}
} else {
console.warn('Unexpected API response format:', data)
error.value = 'Unexpected response format from server'
}
} catch (err: any) {
if (request !== pageRequest) return
console.error('Failed to fetch packages:', err)
error.value = err.message
} finally {
settle()
}
}
async function fetchRecentPackages() {
begin()
try {
const response = await axios.get(
`/api/packages?page=1&page_size=${RECENT_PACKAGES}&sort=cached_at&order=desc`,
)
if (response.data && Array.isArray(response.data.packages)) {
// The page holds whole groups, so the newest rows are in there but not in order.
recentPackages.value = [...response.data.packages]
.sort((a: Package, b: Package) => new Date(b.cached_at).getTime() - new Date(a.cached_at).getTime())
.slice(0, RECENT_PACKAGES)
} else {
console.warn('Unexpected API response format:', response.data)
error.value = 'Unexpected response format from server'
}
} catch (err: any) {
console.error('Failed to fetch recent packages:', err)
error.value = err.message
} finally {
settle()
}
}
async function fetchStats(registry = '') {
loading.value = true
error.value = null
begin()
try {
const url = registry ? `/api/stats?registry=${registry}` : '/api/stats'
const response = await axios.get(url)
@@ -88,30 +190,33 @@ export const usePackageStore = defineStore('packages', () => {
error.value = err.message
// Don't clear stats on error - keep showing the cached data
} finally {
loading.value = false
settle()
}
}
/** Deletes one version; the caller reloads whichever list it shows. */
async function deletePackage(registry: string, name: string, version: string) {
loading.value = true
error.value = null
begin()
try {
await axios.delete(`/api/packages/${registry}/${name}/${version}`)
await fetchPackages()
} catch (err: any) {
error.value = err.message
} finally {
loading.value = false
settle()
}
}
return {
packages,
packagePage,
recentPackages,
stats,
registries,
loading,
error,
fetchPackages,
fetchPackagePage,
fetchRecentPackages,
fetchStats,
deletePackage,
}
+118 -80
View File
@@ -1,83 +1,121 @@
@import '@fortawesome/fontawesome-free/css/all.min.css';
@import "tailwindcss";
@import "@perfect-design/ui/theme.css";
@import "@perfect-design/ui/packs/workbench.css";
/* Only the library components the app imports, plus their transitive imports: scanning all of dist adds every component's classes. `pnpm sources` regenerates this list. */
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/ActivityFeed/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/BarChart/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/Card/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/CodeViewer/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/CodeViewer/tokenize/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/DataTable/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/DescriptionList/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/KpiTile/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/Sparkline/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/StatGroup/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/Table/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/_chart/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/data-display/_shared/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/Alert/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/ConfirmDialog/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/EmptyState/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/ErrorState/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/LoadingState/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/ToastItem/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/feedback/Toaster/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Checkbox/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/CheckboxCard/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Combobox/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Field/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Input/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/InputGroup/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Label/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/NativeSelect/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/SearchInput/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/SegmentedControl/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/forms/Textarea/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/layout/AppShell/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/layout/ConfigProvider/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/layout/Container/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/layout/PageHeader/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/Accordion/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/AppHeader/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/MobileNav/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/NavLink/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/Pagination/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/SidebarNav/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/navigation/ThemeToggle/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/overlays/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/overlays/AlertDialog/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/overlays/Dialog/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Avatar/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Badge/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Button/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Icon/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/IconButton/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Link/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/ScrollArea/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/Spinner/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/StatusBadge/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/primitives/StatusDot/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/typography/Markdown/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/typography/Markdown/parse/*.js";
@source "../../node_modules/@perfect-design/ui/dist/components/typography/RelativeTime/*.js";
@source "../../node_modules/@perfect-design/ui/dist/lib/*.js";
@source "../../node_modules/@perfect-design/ui/dist/stores/*.js";
@import 'tailwindcss';
@config '../../tailwind.config.js';
@custom-variant dark (&:is(.dark *));
@layer base {
:root {
/* Tailwind slate-50 for background */
--background: 210 40% 98%;
/* Tailwind slate-900 for foreground */
--foreground: 222 47% 11%;
/* White for cards */
--card: 0 0% 100%;
--card-foreground: 222 47% 11%;
--popover: 0 0% 100%;
--popover-foreground: 222 47% 11%;
/* Tailwind slate-700 for primary */
--primary: 215 25% 27%;
--primary-foreground: 0 0% 100%;
/* Tailwind slate-100 for secondary */
--secondary: 210 40% 96%;
--secondary-foreground: 222 47% 11%;
/* Tailwind slate-100 for muted */
--muted: 210 40% 96%;
/* Tailwind slate-500 for muted-foreground */
--muted-foreground: 215 20% 65%;
--accent: 210 40% 96%;
--accent-foreground: 222 47% 11%;
/* Tailwind red-500 for destructive */
--destructive: 0 84% 60%;
--destructive-foreground: 0 0% 98%;
/* Tailwind slate-200 for border */
--border: 214 32% 91%;
--input: 214 32% 91%;
/* Tailwind slate-700 for ring */
--ring: 215 25% 27%;
/* Chart colors using Tailwind palette with slate base */
--chart-1: 215 25% 27%;
--chart-2: 200 98% 39%;
--chart-3: 142 71% 45%;
--chart-4: 25 95% 53%;
--chart-5: 262 83% 58%;
--radius: 0.75rem;
}
.dark {
--background: 222 47% 11%;
--foreground: 210 40% 98%;
--card: 222 47% 11%;
--card-foreground: 210 40% 98%;
--popover: 222 47% 11%;
--popover-foreground: 210 40% 98%;
--primary: 200 98% 39%;
--primary-foreground: 0 0% 100%;
--secondary: 217 33% 17%;
--secondary-foreground: 210 40% 98%;
--muted: 217 33% 17%;
--muted-foreground: 215 20% 65%;
--accent: 217 33% 17%;
--accent-foreground: 210 40% 98%;
--destructive: 0 84% 60%;
--destructive-foreground: 0 0% 98%;
--border: 217 33% 17%;
--input: 217 33% 17%;
--ring: 200 98% 39%;
--chart-1: 200 98% 39%;
--chart-2: 142 71% 45%;
--chart-3: 262 83% 58%;
--chart-4: 25 95% 53%;
--chart-5: 340 82% 52%;
}
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
/* woff2 and Latin only: one file per face the interface uses. */
@font-face {
font-family: "IBM Plex Sans";
font-style: normal;
font-display: swap;
font-weight: 400;
src: url("../../node_modules/@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
font-family: "IBM Plex Sans";
font-style: normal;
font-display: swap;
font-weight: 500;
src: url("../../node_modules/@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
font-family: "IBM Plex Sans";
font-style: normal;
font-display: swap;
font-weight: 600;
src: url("../../node_modules/@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
font-family: "IBM Plex Mono";
font-style: normal;
font-display: swap;
font-weight: 400;
src: url("../../node_modules/@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
/* Custom component styles have been replaced with shadcn-vue components */
@theme {
--font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
/* AppHeader's bar height (its default h-14) and the sidebar's sticky offset. */
:root {
--header-h: calc(var(--spacing) * 14);
}
html {
scroll-padding-top: calc(var(--header-h) + var(--spacing) * 2);
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
+30
View File
@@ -0,0 +1,30 @@
// @vitest-environment node
import { describe, expect, it } from 'vitest'
import css from './main.css?raw'
import { librarySources } from '../../scripts/library-sources.mjs'
const root = new URL('../..', import.meta.url).pathname
describe('main.css', () => {
it('imports the library theme and the workbench pack', () => {
expect(css).toContain('@import "@perfect-design/ui/theme.css"')
expect(css).toContain('@import "@perfect-design/ui/packs/workbench.css"')
})
it('scans only the library directories the app imports (run `pnpm sources` after changing imports)', () => {
const declared = css.split('\n').filter((line: string) => line.startsWith('@source '))
expect(declared).toEqual(librarySources(root))
expect(css).not.toMatch(/@source "[^"]*\/dist"/)
})
it('loads the Plex faces as Latin woff2 only', () => {
const urls = [...css.matchAll(/url\("([^"]+)"\)/g)].map((m) => m[1])
expect(urls.length).toBe(4)
for (const url of urls) expect(url).toMatch(/-latin-\d{3}-normal\.woff2$/)
})
it('shares one header height token with the scroll offset', () => {
expect(css).toMatch(/--header-h:/)
expect(css).toMatch(/scroll-padding-top:\s*calc\(var\(--header-h\)/)
})
})
+160
View File
@@ -0,0 +1,160 @@
import type { Package, Stats } from '@/stores/packages'
export const STATS: Stats = {
registry: '',
total_packages: 4,
total_size: 5368709120,
max_cache_size: 10737418240,
total_downloads: 120,
scanned_packages: 3,
vulnerable_packages: 2,
blocked_packages: 1,
}
export const REGISTRIES = {
npm: { count: 2, size: 2147483648, downloads: 80 },
pypi: { count: 1, size: 1073741824, downloads: 30 },
go: { count: 1, size: 2147483648, downloads: 10 },
}
export const PACKAGES: Package[] = [
{
id: 'npm-1',
registry: 'npm',
name: 'left-pad',
version: '1.3.0',
size: 2048,
cached_at: '2026-01-03T10:00:00Z',
last_accessed: '2026-01-03T10:00:00Z',
download_count: 40,
vulnerabilities: {
scanned: true,
status: 'vulnerable',
counts: { critical: 1, high: 2, moderate: 0, low: 1 },
total: 4,
scannedAt: '2026-01-03T10:05:00Z',
isBlocked: true,
},
},
{
id: 'npm-2',
registry: 'npm',
name: 'left-pad',
version: '1.2.0',
size: 1024,
cached_at: '2026-01-02T10:00:00Z',
last_accessed: '2026-01-02T10:00:00Z',
download_count: 40,
vulnerabilities: {
scanned: true,
status: 'vulnerable',
counts: { critical: 0, high: 0, moderate: 3, low: 0 },
total: 3,
scannedAt: '2026-01-02T10:05:00Z',
isBlocked: false,
},
},
{
id: 'pypi-1',
registry: 'pypi',
name: 'requests',
version: '2.31.0',
size: 4096,
cached_at: '2026-01-01T10:00:00Z',
last_accessed: '2026-01-01T10:00:00Z',
download_count: 30,
vulnerabilities: { scanned: true, status: 'clean', total: 0, scannedAt: '2026-01-01T10:05:00Z' },
},
{
id: 'go-1',
registry: 'go',
name: 'github.com/example/module',
version: 'v0.4.1',
size: 512,
cached_at: '2026-01-04T10:00:00Z',
last_accessed: '2026-01-04T10:00:00Z',
download_count: 10,
vulnerabilities: { scanned: false, status: 'not_scanned' },
},
]
export const TIMESERIES = {
period: '1day',
registry: '',
data_points: [
{ timestamp: '2026-01-04T08:00:00Z', value: 3 },
{ timestamp: '2026-01-04T09:00:00Z', value: 7 },
{ timestamp: '2026-01-04T10:00:00Z', value: 5 },
],
}
export const VULNERABILITY_REPORT = {
scanned: true,
scanner: 'trivy+osv',
scanned_at: '2026-01-03T10:05:00Z',
status: 'vulnerable',
vulnerability_count: 3,
bypassed_count: 1,
severity_counts: { critical: 1, high: 1, moderate: 0, low: 1 },
vulnerabilities: [
{
id: 'CVE-2026-0001',
severity: 'LOW',
title: 'Low severity sample',
description: 'A **low** severity sample description.',
references: ['https://example.com/advisory/1'],
fixed_in: '1.3.1',
bypassed: false,
},
{
id: 'CVE-2026-0002',
severity: 'CRITICAL',
title: 'Critical severity sample',
description: 'A critical severity sample description.',
references: [],
fixed_in: '',
bypassed: true,
bypass: {
id: 'bypass-1',
reason: 'No fix available',
created_by: '[email protected]',
expires_at: '2026-02-01T00:00:00Z',
},
},
{
id: 'CVE-2026-0003',
severity: 'HIGH',
title: '',
description: 'A high severity sample description.',
references: [],
fixed_in: '2.0.0',
bypassed: false,
},
],
}
export const BYPASSES = [
{
id: 'bypass-1',
type: 'cve',
target: 'CVE-2026-0002',
reason: 'No fix available',
created_by: '[email protected]',
created_at: '2026-01-01T00:00:00Z',
expires_at: '2099-01-01T00:00:00Z',
applies_to: 'npm/[email protected]',
notify_on_expiry: true,
active: true,
},
{
id: 'bypass-2',
type: 'package',
target: 'npm/left-pad',
reason: 'Pinned until the next release',
created_by: '[email protected]',
created_at: '2025-01-01T00:00:00Z',
expires_at: '2025-02-01T00:00:00Z',
notify_on_expiry: false,
active: false,
},
]
+14
View File
@@ -0,0 +1,14 @@
import { describe, expect, it } from 'vitest'
import { defineComponent, h } from 'vue'
import { Input } from '@perfect-design/ui'
import { mountStrict } from './mountStrict'
describe('mountStrict', () => {
it('reports a library contract violation, so an empty list in a smoke test means something', async () => {
const Unnamed = defineComponent({ render: () => h(Input) })
const { problems, restore } = await mountStrict(Unnamed)
restore()
expect(problems.length).toBeGreaterThan(0)
expect(problems.join(' ')).toMatch(/accessible name/i)
})
})
+37
View File
@@ -0,0 +1,37 @@
import { configureStrictMode } from '@perfect-design/ui'
import { flushPromises, mount, type ComponentMountingOptions } from '@vue/test-utils'
import { vi } from 'vitest'
import type { Component } from 'vue'
/**
* Mounts under strict mode 'throw' and returns every Vue warning, Vue error and library ContractError seen,
* so a smoke test can assert the list is empty. The library runs its contract checks from async onMounted hooks.
*/
export async function mountStrict(component: Component, options: ComponentMountingOptions<any> = {}) {
configureStrictMode('throw')
const problems: string[] = []
const record = (kind: string) => (err: unknown) => {
problems.push(`${kind}: ${err instanceof Error ? err.message : String(err)}`)
}
const warn = vi.spyOn(console, 'warn').mockImplementation((...args) => record('warn')(args.join(' ')))
const error = vi.spyOn(console, 'error').mockImplementation((...args) => record('error')(args.join(' ')))
const wrapper = mount(component, {
attachTo: document.body,
...options,
global: {
...options.global,
config: { errorHandler: record('error'), warnHandler: record('warn') },
},
})
await flushPromises()
await new Promise((resolve) => setTimeout(resolve, 0))
await flushPromises()
const restore = () => {
wrapper.unmount()
warn.mockRestore()
error.mockRestore()
}
return { wrapper, problems, restore }
}
+9
View File
@@ -0,0 +1,9 @@
import { createMemoryHistory } from 'vue-router'
import { createAppRouter } from '@/router'
export async function createTestRouter(initial = '/') {
const router = createAppRouter(createMemoryHistory())
await router.push(initial)
await router.isReady()
return router
}
-91
View File
@@ -1,91 +0,0 @@
/** @type {import('tailwindcss').Config} */
export default {
darkMode: ["class"],
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
extend: {
screens: {
'3xl': '2560px',
},
fontFamily: {
sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'],
},
colors: {
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
}
},
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
},
keyframes: {
'accordion-down': {
from: {
height: '0'
},
to: {
height: 'var(--reka-accordion-content-height)'
}
},
'accordion-up': {
from: {
height: 'var(--reka-accordion-content-height)'
},
to: {
height: '0'
}
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
}
},
plugins: [
require("tailwindcss-animate"),
require("@tailwindcss/typography"),
],
}
+15 -4
View File
@@ -1,17 +1,26 @@
import { defineConfig } from 'vite'
import { defineConfig, type Plugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import path from 'path'
import { themeBootScript } from '@perfect-design/ui/stores/theme-boot'
// Get backend URL from environment or use default
const BACKEND_URL = process.env.VITE_BACKEND_URL || 'http://localhost:8080'
const WS_ORIGIN = process.env.VITE_WS_ORIGIN
const FRONTEND_PORT = parseInt(process.env.VITE_PORT || '5173')
// Applies the saved colour mode before first paint so a dark system never flashes light.
function themeBoot(): Plugin {
return {
name: 'theme-boot',
transformIndexHtml: () => [{ tag: 'script', children: themeBootScript, injectTo: 'head' }],
}
}
export default defineConfig({
plugins: [vue(), tailwindcss()],
plugins: [vue(), tailwindcss(), themeBoot()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@': import.meta.dirname + '/src',
},
},
server: {
@@ -25,6 +34,8 @@ export default defineConfig({
target: BACKEND_URL.replace('http', 'ws'),
ws: true,
changeOrigin: true,
// A backend with an origin allowlist refuses the dev server origin; set this to an allowed one.
...(WS_ORIGIN ? { headers: { Origin: WS_ORIGIN } } : {}),
},
},
},
+3 -2
View File
@@ -1,6 +1,5 @@
import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import path from 'path'
export default defineConfig({
plugins: [vue()],
@@ -8,10 +7,12 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
// main.spec.ts reads main.css as text; vitest otherwise replaces stylesheets with an empty string.
css: { include: [/main\.css/] },
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@': import.meta.dirname + '/src',
},
},
})
+45 -45
View File
@@ -3,27 +3,28 @@ module github.com/lukaszraczylo/gohoarder
go 1.26.0
require (
github.com/aws/aws-sdk-go-v2 v1.47.5
github.com/aws/aws-sdk-go-v2/config v1.33.13
github.com/aws/aws-sdk-go-v2/credentials v1.20.13
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.6
github.com/cloudsoda/go-smb2 v0.0.0-20261029174947-95daac2ef783
github.com/aws/aws-sdk-go-v2 v1.48.0
github.com/aws/aws-sdk-go-v2/config v1.33.21
github.com/aws/aws-sdk-go-v2/credentials v1.21.3
github.com/aws/aws-sdk-go-v2/service/s3 v1.116.0
github.com/cloudsoda/go-smb2 v0.0.0-20261105190815-95be04a983b8
github.com/go-gormigrate/gormigrate/v2 v2.1.7
github.com/go-sql-driver/mysql v1.10.1
github.com/go-sql-driver/mysql v1.10.2
github.com/goccy/go-json v0.12.0
github.com/gofiber/fiber/v3 v3.6.1
github.com/gofiber/fiber/v3 v3.7.0
github.com/gorilla/websocket v1.5.3
github.com/lib/pq v1.12.3
github.com/prometheus/client_golang v1.25.0
github.com/prometheus/client_model v0.6.3
github.com/rs/zerolog v1.35.1
github.com/spf13/cobra v1.10.2
github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.12.1
github.com/testcontainers/testcontainers-go v0.44.0
github.com/testcontainers/testcontainers-go/modules/mysql v0.44.0
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0
golang.org/x/crypto v0.58.0
golang.org/x/sync v0.24.0
github.com/testcontainers/testcontainers-go v0.45.0
github.com/testcontainers/testcontainers-go/modules/mysql v0.45.0
github.com/testcontainers/testcontainers-go/modules/postgres v0.45.0
golang.org/x/crypto v0.59.0
golang.org/x/sync v0.25.0
golang.org/x/time v0.16.0
gorm.io/driver/mysql v1.6.0
gorm.io/driver/postgres v1.6.3
@@ -36,24 +37,24 @@ require (
filippo.io/edwards25519 v1.2.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 // indirect
github.com/Microsoft/go-winio v0.6.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.25 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.9 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.8 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.12.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.39.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 // indirect
github.com/aws/smithy-go v1.28.7 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.14.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.39.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.53.0 // indirect
github.com/aws/smithy-go v1.28.9 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc // indirect
github.com/cloudsoda/sddl v0.0.0-20261105185302-1c8f96799263 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.2.0 // indirect
@@ -62,7 +63,7 @@ require (
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.8.2 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/ebitengine/purego v0.11.2 // indirect
github.com/ebitengine/purego v0.11.3 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/geoffgarside/ber v1.2.0 // indirect
@@ -70,15 +71,15 @@ require (
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/gofiber/schema v1.9.2 // indirect
github.com/gofiber/utils/v2 v2.6.3 // indirect
github.com/gofiber/schema v1.10.0 // indirect
github.com/gofiber/utils/v2 v2.6.5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-uuid v1.0.4 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.12.0 // indirect
github.com/jackc/puddle/v2 v2.2.3 // indirect
github.com/jackc/pgx/v5 v5.13.0 // indirect
github.com/jackc/puddle/v2 v2.2.4 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.7.6 // indirect
@@ -87,16 +88,16 @@ require (
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/klauspost/compress v1.20.3 // indirect
github.com/klauspost/compress v1.20.5 // indirect
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 // indirect
github.com/magiconair/properties v1.18.12 // indirect
github.com/magiconair/properties v1.18.13 // indirect
github.com/mattn/go-colorable v0.1.16 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mattn/go-sqlite3 v1.14.52 // indirect
github.com/mattn/go-sqlite3 v1.14.53 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.3.3 // indirect
github.com/moby/moby/api v1.56.1 // indirect
github.com/moby/moby/client v0.6.2 // indirect
github.com/moby/moby/api v1.57.0 // indirect
github.com/moby/moby/client v0.6.3 // indirect
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/sys/sequential v0.7.0 // indirect
github.com/moby/sys/user v0.5.0 // indirect
@@ -110,32 +111,31 @@ require (
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/philhofer/fwd v1.2.1 // indirect
github.com/power-devops/perfstat v0.0.0-20260916203055-22a1a467d9f0 // indirect
github.com/prometheus/client_model v0.6.3 // indirect
github.com/prometheus/common v0.73.1 // indirect
github.com/prometheus/common v0.74.0 // indirect
github.com/prometheus/procfs v0.23.0 // indirect
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/shirou/gopsutil/v4 v4.26.10 // indirect
github.com/sirupsen/logrus v1.10.2 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/spf13/pflag v1.1.0 // indirect
github.com/stretchr/objx v0.8.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/tinylib/msgp v1.6.5 // indirect
github.com/tklauser/go-sysconf v0.4.0 // indirect
github.com/tklauser/numcpus v0.12.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.77.0 // indirect
github.com/valyala/fasthttp v1.79.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/auto/sdk v1.2.2 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect
go.opentelemetry.io/otel v1.47.0 // indirect
go.opentelemetry.io/otel/log v1.47.0 // indirect
go.opentelemetry.io/otel/metric v1.47.0 // indirect
go.opentelemetry.io/otel/trace v1.47.0 // indirect
go.yaml.in/yaml/v3 v3.0.6 // indirect
golang.org/x/net v0.62.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/text v0.43.0 // indirect
golang.org/x/net v0.63.0 // indirect
golang.org/x/sys v0.50.0 // indirect
golang.org/x/text v0.44.0 // indirect
google.golang.org/protobuf v1.36.12 // indirect
)
+100 -102
View File
@@ -8,52 +8,52 @@ github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4 h1:m2xcjRABtG288
github.com/Azure/go-ansiterm v0.0.0-20261006220739-8c912ac31dd4/go.mod h1:MTUE7ZuZO89FAtAwozGg6AWD83pcdefnEq5gF82MB8s=
github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyUc+g=
github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U=
github.com/aws/aws-sdk-go-v2 v1.47.5 h1:5yA+A+BiXbDq1ZLbYwPViwhEGDMdR0MEhL8Jh2LnLS4=
github.com/aws/aws-sdk-go-v2 v1.47.5/go.mod h1:iNIkogrRvFwm+1OQIUOP2lPBtlXZboOIUWiCa+pHEMw=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.25 h1:MW0Iql1SOTgQPj8mCxrU/eH/K/AIDWi08ItOsXaWRLU=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.25/go.mod h1:+ucVYmHYB3JqVueY0E1RHahdXAnKQbIHqybSbvOUbOM=
github.com/aws/aws-sdk-go-v2/config v1.33.13 h1:u52x6ISQOx172tpwM0VRxhJzEsTJYpMcEYUGM2A1wrw=
github.com/aws/aws-sdk-go-v2/config v1.33.13/go.mod h1:/ixtz6XPHb42zekjQ0LqD9XjTpTysNWhIGwufY1OzI4=
github.com/aws/aws-sdk-go-v2/credentials v1.20.13 h1:j4z41OtspmQ3ftQycaDunJ26b69a9SHfaSVUPqgRv8k=
github.com/aws/aws-sdk-go-v2/credentials v1.20.13/go.mod h1:SgPA1oS3b+dlMxZb618jDmGNscpXSCaxz15igS52OlE=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 h1:iXjy2SFhGYNB1jWZBhQqq8HbhsbPF23w+/zbMvPXsTg=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5/go.mod h1:k0RUiBnyXU0AXRJ9tJmY2jQke6XUIX2PNVnWtvgaPtc=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 h1:gzIWc3DTPfPbWKrQnmL6BV6WD7NPD1htxzgdk/bQ/Z4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8/go.mod h1:vvUA5cDAZWGo4R14FZPZfXfJCmgsafOWEq78Kg0D+ug=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 h1:PWv+vG8aCLS8qd+HPdYhK7Vees90aKHWFFQ1AGYD/8E=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8/go.mod h1:xxPZEpflYHJA12366ZGyq66z9dHPCoeCIu99Jck+MPw=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 h1:WOp5De9iWdEHDPh2Kb0tBP3vGBm/dVAuRGh4a4tqduo=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8/go.mod h1:z8W8YgfhbWl62XqcTtK+CxPrE+iHGRVUOtrrbIOp7ZY=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 h1:MCIR6iZaCKO4UE0hUvoWWLI6JVjppopV64JfAJaMjng=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23/go.mod h1:pphWFS+z0MmIPivj8c/6bATd1Z+Av7Ust75DPdEFsPA=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.9 h1:GACgECI422Xt5n4Pojr3O0aocPv8lfH4PJe2Aon5Wv8=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.9/go.mod h1:lPfnRkHpn1qWZJLbVEw10rIqSuCee1pNQTyGkUjAYh8=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 h1:+PMpWlJYOn2tm7sm6OZ/ZLd4jStl17T7wjNapd1Rczs=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8/go.mod h1:cnG3xZLGQL4c/bt8pjdzlFtZsW7epBBuNS04a5xMjdo=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.8 h1:RS1Wt+K0r4X0ci9Vf4JYTUfHzsQihYA2LgGJeEneKpk=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.8/go.mod h1:adMnTy5kyoUW86jhXnGSVc/mvMQI4GZd1qYWMeaS8M8=
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.6 h1:to7+Vr3rLkpYRwVKJ5QRriI0eE306vrVN/6TnVHgxvY=
github.com/aws/aws-sdk-go-v2/service/s3 v1.114.6/go.mod h1:Jc89ASa2k7HMAskj3bSnt8bf+k+p2IApzkoXnEjkgUw=
github.com/aws/aws-sdk-go-v2/service/signin v1.12.1 h1:WZLC+k/CZx11kZGQDqu9mpA8yhiXGX2I//jhuJE1FDo=
github.com/aws/aws-sdk-go-v2/service/signin v1.12.1/go.mod h1:wxAk0D2oVBSjuXEIzvcKxTZfM90zticdAbh/VD42L0Y=
github.com/aws/aws-sdk-go-v2/service/sso v1.39.1 h1:4VB/dnDo7pmXSLQMszSoBzWndENuc7mzwTpD6lQn77A=
github.com/aws/aws-sdk-go-v2/service/sso v1.39.1/go.mod h1:UGsEYgWz4Gi+46vDQ5zkFLqUgJziyOE2SXjZjgmfmHc=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.1 h1:w8yui2ZqdHmGwVBDGvazoIvKw/DnLENBLkYnN8q8iqo=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.1/go.mod h1:gJSdIY6YUzDvqQLcMtPVZgBRHrFwzHryvpE8Igzbxps=
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 h1:BVjKrtRUtSYKztBCCfE1oAB+d3ViKcW2cKZfserOqMQ=
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6/go.mod h1:eSukFLeLkPMm+1OxDR+F0joauZdyBkF47Ow7MqjZiJw=
github.com/aws/smithy-go v1.28.7 h1:h/n1SHrwVtaDYLz8mR1/Kq4Xh4RaFbFW7bOYckg9mfE=
github.com/aws/smithy-go v1.28.7/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/aws/aws-sdk-go-v2 v1.48.0 h1:tFU7EJVm7MfyaXLsXdYTZ0Vd6vwt9OljCyqq0gqk0Mc=
github.com/aws/aws-sdk-go-v2 v1.48.0/go.mod h1:oeKU5p+TQBnpeLmU42WZLWvzv+ORLn+74n4QVLnm/Z0=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27 h1:3dMP9eEmHVosFN1QiD24IJBKVY8m6iUfVYXqRCT118Q=
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.27/go.mod h1:KH4PKcqtjy1m0656eqQV2v53xE04ddJzuNloEKqlHkI=
github.com/aws/aws-sdk-go-v2/config v1.33.21 h1:NY1d3yXmplUSYnUAue0sR88svD+SJiaI+YJGp8TxSNg=
github.com/aws/aws-sdk-go-v2/config v1.33.21/go.mod h1:pVJNXUXaCLu9a/4/liTklg9zR3yO0xm/XBEQhgg5nzc=
github.com/aws/aws-sdk-go-v2/credentials v1.21.3 h1:bh+9VoJ4eDzJVEY6jfdNTBa0Dx7tdr+lWSPNovU1vXc=
github.com/aws/aws-sdk-go-v2/credentials v1.21.3/go.mod h1:4CNs0EBvjDEpyaXSYCdNeNRhFjHFX2Y373tFUaeTYXA=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.9 h1:oH1E0tjN0g+ZRusbX1dsuat4FJ0z05l8hWaycSbDuNc=
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.9/go.mod h1:3ZaQGigIoaS45x9HgnLZ4sP475Fs7QoxU3IsZX/J3h4=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12 h1:W0yUUzKBA8SofGQ0yZafEUuZq9UxfvijRgdc6vcRQPA=
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.12/go.mod h1:xwKv6vwBNdpPFOxEm/ld4IODZK2s/1ksHvdBqLfH6Gs=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12 h1:lqSi8qvAnKC1vfosImdmOsuiJLr/jdybZX5299beB6Q=
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.12/go.mod h1:rqPQE2vqkW9YHx5+Gp55sx1wsTM4xtGQLl+TKMjxxrs=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12 h1:uvX2yaL+aMjkmnrLPPlR/zwjoKFRMoNhhJfeGjfk6qc=
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.12/go.mod h1:dicT+2eNhHHqGkxHO7LoXw3QghIUGuzgdmFqaSTopgI=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25 h1:rKwkY3Z+fvt2W0msjdNs6uNewPmXzPayQ961oyuWhes=
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.25/go.mod h1:dBuAadQKd1F4Q4ZOg8gnFmuSHMRE40Pe3IfFwbtC4lE=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13 h1:U5HZ8FpTr6tyvulf1nT11Nw4KG1CAsXkuQGdUrIjZ/E=
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.13/go.mod h1:dUfvCU1NaE+b3vqNENDiJncUQW7Djl5pmgUlcjesVqk=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12 h1:wzAqMZ2O4+ij9HQqIrk+P9PBGacE0wOTuWB7Mo97//I=
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.12/go.mod h1:/0TfyruByHsOlphzP26xDTRe2DKD0J1I1Uyy2TyP8EI=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12 h1:H0IaQayT3TLiGIHiNnleQZTbndDlx7LGZ0NWZ5mDwjA=
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.12/go.mod h1:YuJJNxaOjnknLIrscBmkLhIpnmg9LzHd25sQRKUboGU=
github.com/aws/aws-sdk-go-v2/service/s3 v1.116.0 h1:0/glEMW6lLpeGOq7tDKn3314ookbLSvzRs71Oknt6gA=
github.com/aws/aws-sdk-go-v2/service/s3 v1.116.0/go.mod h1:8NhAIBVYkVHq0hIbbzujdoou0VkKwMdG+De9e5oX6qI=
github.com/aws/aws-sdk-go-v2/service/signin v1.14.0 h1:bIEk1HfTd3MGzvDa5YOQUodGr96D9+UTnmBLBB8ZJ10=
github.com/aws/aws-sdk-go-v2/service/signin v1.14.0/go.mod h1:LdwHjKqPE9VCC7sTlWcOAizZx3ZJYjmfwC/EW2tIIAE=
github.com/aws/aws-sdk-go-v2/service/sso v1.39.5 h1:ANAoa+qt3/9kXnvQVgUyxcTzhzZf4DqaBS+M2DQrELU=
github.com/aws/aws-sdk-go-v2/service/sso v1.39.5/go.mod h1:vsMi+SSR7xGQXtV430LVi49qbv/R+U+upHHSp1W/+QI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.5 h1:uIOBLMhef4N16WguadoHKuBy9etdz+RKTeqzchXErAI=
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.5/go.mod h1:NwWmkFLtsTVyXQpbzPOlYLwEoANkdCFjJRtrNcbg/vY=
github.com/aws/aws-sdk-go-v2/service/sts v1.53.0 h1:my9Y6lxcqvPV5k4OTqnxr8XbiTDDRos1leEh050Z93U=
github.com/aws/aws-sdk-go-v2/service/sts v1.53.0/go.mod h1:MG6N8U9+lY4LqchrlHPqCOSr7hyxw70XU0Et2YR3eNA=
github.com/aws/smithy-go v1.28.9 h1:zkZ058OpNX0iGTK24b+ZUEQSMc11CBA6oO7xtKZfzkY=
github.com/aws/smithy-go v1.28.9/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cloudsoda/go-smb2 v0.0.0-20261029174947-95daac2ef783 h1:nMiJfdX9TxRrf1RJpyTTvfR56jsuRMm0P2smJcuIqBQ=
github.com/cloudsoda/go-smb2 v0.0.0-20261029174947-95daac2ef783/go.mod h1:1pQXB0vAlzRlqcY7LYKOOZMw0wKfJPFxTLsJRF2Gswo=
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc h1:0xCWmFKBmarCqqqLeM7jFBSw/Or81UEElFqO8MY+GDs=
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc/go.mod h1:uvR42Hb/t52HQd7x5/ZLzZEK8oihrFpgnodIJ1vte2E=
github.com/cloudsoda/go-smb2 v0.0.0-20261105190815-95be04a983b8 h1:lBnZ8FJ6W+ftjYb3Exp5udAlHLLl5J3wO1nStg6abVI=
github.com/cloudsoda/go-smb2 v0.0.0-20261105190815-95be04a983b8/go.mod h1:LryNlMPoHo2c2K8tlyI/c0OH8yAryg9wPFvgRGmt2pA=
github.com/cloudsoda/sddl v0.0.0-20261105185302-1c8f96799263 h1:gua/EcVKg9gnxPrSrvHrz3jwrdnrYHKxmynexDwCrto=
github.com/cloudsoda/sddl v0.0.0-20261105185302-1c8f96799263/go.mod h1:uvR42Hb/t52HQd7x5/ZLzZEK8oihrFpgnodIJ1vte2E=
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
@@ -75,16 +75,16 @@ github.com/docker/go-connections v0.8.2 h1:9d9DEokx5W7qlr0shkFXIxEA7+TTD+llwzcyk
github.com/docker/go-connections v0.8.2/go.mod h1:no1qkHdjq7kLMGUXYAduOhYPSJxxvgWBh7ogVvptn3Q=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/ebitengine/purego v0.11.2 h1:WWiTx8rD8zYdOwSj8O/NiNbsOvSAgJMTlyV1XlbUSeU=
github.com/ebitengine/purego v0.11.2/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
github.com/ebitengine/purego v0.11.3 h1:OB+JLpdm7ioymhyA+6s5kbb/uOuYycAgL8NNTFc5MLg=
github.com/ebitengine/purego v0.11.3/go.mod h1:DCHPP08djqhNSoTfImcnHYQRZmd0qhakvrozqaEYhGQ=
github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc=
github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/fxamacker/cbor/v2 v2.9.6 h1:NHZPxuUjJXQjX9itA785y/5NKSlI4HQ+S7noZsmI7hs=
github.com/fxamacker/cbor/v2 v2.9.6/go.mod h1:4EaZp6ClVunETjQ4GHmGNzysDK91Lr+r6Yz6tJqzVCw=
github.com/fxamacker/cbor/v2 v2.10.0 h1:HVF3T5vYwLqO81ebPirWEPNv2SMrUMD3HLnKgEr6uWE=
github.com/fxamacker/cbor/v2 v2.10.0/go.mod h1:uSwlToFuT9BZAKRxxVm3qQC8DR4tlWl7D6pf20iRYH4=
github.com/geoffgarside/ber v1.2.0 h1:/loowoRcs/MWLYmGX9QtIAbA+V/FrnVLsMMPhwiRm64=
github.com/geoffgarside/ber v1.2.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc=
github.com/go-gormigrate/gormigrate/v2 v2.1.7 h1:PdT4jVPbRb4R+0Ey2R0yJOdctVf4Whiq1Qi4necaZdg=
@@ -97,18 +97,18 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
github.com/go-sql-driver/mysql v1.10.1 h1:arlSnNLq6a5yxGxV7qg9lF4j0C+KwD6NbQyKr9QL6ME=
github.com/go-sql-driver/mysql v1.10.1/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/go-sql-driver/mysql v1.10.2 h1:5TRvGvczDohUMOCRA5aCAXgfSZOo/oNDSFD/2RrChS0=
github.com/go-sql-driver/mysql v1.10.2/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk=
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/goccy/go-json v0.12.0 h1:pD+oWouAiz4yruwXIt/iT+lOMeyhr1aTtxzaMP/RgVI=
github.com/goccy/go-json v0.12.0/go.mod h1:3NdmfEkZlB7YI5UFw/qdFKq8XN1aiWR0YyRPWZNQltY=
github.com/gofiber/fiber/v3 v3.6.1 h1:wYjbgqpJm6VErIVLSGzGpX7lLZyTNgElsj8nQ1i+iFo=
github.com/gofiber/fiber/v3 v3.6.1/go.mod h1:+nxjBal3gw0EPf3gqK5EmtxaxTL01+zbSTagFletlDI=
github.com/gofiber/schema v1.9.2 h1:Gzw2PF1K5DpWgG2L51/9t9dkmxw4kqK6auKMvgD9mIU=
github.com/gofiber/schema v1.9.2/go.mod h1:219nYAgzIEBWl/aHCyhQtFoXBvfLjsC6+FI3DUN1+Ck=
github.com/gofiber/utils/v2 v2.6.3 h1:VlnOB89rFnonlXoYOkESOkXtIkAw4CBBwpBHu+/a/YQ=
github.com/gofiber/utils/v2 v2.6.3/go.mod h1:Mq3OXwyBPxORb3jPafy6Swki4/TJJW9TDPHeerXkXpg=
github.com/gofiber/fiber/v3 v3.7.0 h1:aF+GfB7nP9Dd0wVsv6wmr8675v66OGfjSyoDhPmvKEo=
github.com/gofiber/fiber/v3 v3.7.0/go.mod h1:7dlbpUZ789TJg4q/VfdS1UWDtB6Fl/Smk6ZYZusMpAQ=
github.com/gofiber/schema v1.10.0 h1:d/2/NpHOVD0f29aNvM3KSPmaEDLJZvxW5edtN4Ymd8U=
github.com/gofiber/schema v1.10.0/go.mod h1:scfpXbReJ8y9xKlNnrwlewJ8nIGVZZmzoHZ4i5yGxG0=
github.com/gofiber/utils/v2 v2.6.5 h1:rU+8ao6LKi3fKOA3sEjfLv1T+2C2IwomeVmEKaqkr4A=
github.com/gofiber/utils/v2 v2.6.5/go.mod h1:OqPxdhDW7fPz0dupDanqf4e5O15IyFKy724y/EY9RI4=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -129,10 +129,10 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.12.0 h1:hWwax8YiGT0YiN50U1oIDn5kgR7KC2tG3rmavwpPkxY=
github.com/jackc/pgx/v5 v5.12.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds=
github.com/jackc/puddle/v2 v2.2.3 h1:f8HoREISb3l5eO9coPgK7U3hKLhWGokOFVcThl5jrao=
github.com/jackc/puddle/v2 v2.2.3/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jackc/pgx/v5 v5.13.0 h1:Hl08k64maU0nrRyVUEbwCnK6/gT0EhMrtAqBHz9/gA4=
github.com/jackc/pgx/v5 v5.13.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds=
github.com/jackc/puddle/v2 v2.2.4 h1:N6Mz6EGB9DL0bz3OEfxJ7eoOpjRHnnjpOh+G8kbLoG8=
github.com/jackc/puddle/v2 v2.2.4/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
@@ -149,8 +149,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4=
github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/klauspost/compress v1.20.5 h1:rJj5VjH4xQxbnLphg6eqUcDxRFCw1jpMdDY9qXlrwSs=
github.com/klauspost/compress v1.20.5/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -161,24 +161,24 @@ github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ=
github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5 h1:eveIIGn4BGM3qknO74omf6HYr30/exH+eVUTuAgwjZ0=
github.com/lufia/plan9stats v0.0.0-20260802145828-341c2f0c90b5/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
github.com/magiconair/properties v1.18.12 h1:sT9zQpvTB3B4gzrX0tmZNTEaGyg8Zw55MFYRE32Mr9I=
github.com/magiconair/properties v1.18.12/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/magiconair/properties v1.18.13 h1:UzIwH+0nODFR48wsJaaiWP4oCE1Xvp168ovLKsdqy0c=
github.com/magiconair/properties v1.18.13/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-colorable v0.1.16 h1:+2YjeAe7xP1OQbZW1jERPWWCDLlNqFNCvjiqGiAt84A=
github.com/mattn/go-colorable v0.1.16/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U=
github.com/mattn/go-sqlite3 v1.14.52/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/mattn/go-sqlite3 v1.14.53 h1:mnTM0owzUMrKuLo+0w51NUiB0ir2Fo7kFXlPt/l3BGs=
github.com/mattn/go-sqlite3 v1.14.53/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w=
github.com/mdelapenya/tlscert v0.2.0 h1:7H81W6Z/4weDvZBNOfQte5GpIMo0lGYEeWbkGp5LJHI=
github.com/mdelapenya/tlscert v0.2.0/go.mod h1:O4njj3ELLnJjGdkN7M/vIVCpZ+Cf0L6muqOG4tLSl8o=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/go-archive v0.3.3 h1:OxxR9paxsluYi+zDUEXTTaIxtkK3viymW+Ka7vRhhME=
github.com/moby/go-archive v0.3.3/go.mod h1:Npdv43fFqlhZW7Xo8fbm3ZMYFvAGNviUPqX21VERbcE=
github.com/moby/moby/api v1.56.1 h1:PpWkvVPB7Fr/No8w+TfyJ/I6rWZ2YPZhT3JorIg+06c=
github.com/moby/moby/api v1.56.1/go.mod h1:sZ+THbVWkjOmBPPfbnzdD/G1LuIexWhqlSHHPTDQ1Uk=
github.com/moby/moby/client v0.6.2 h1:ekSPlMccrZGcw6Scb8T9D39qE0mB+XupU/yS0zNw9N4=
github.com/moby/moby/client v0.6.2/go.mod h1:DGcnO7qmPJrqobx/ggQgQ/AUk+2wgVdQv7uxB0/mEsc=
github.com/moby/moby/api v1.57.0 h1:K2ykv5UZjwFCtmtL486T+SUEVrQ46w3v7isf214RCcw=
github.com/moby/moby/api v1.57.0/go.mod h1:pRZ1QRtx6AVhdckeFYo4DUX4ASNF0SCllhyY6aj2mgg=
github.com/moby/moby/client v0.6.3 h1:XJn2T8YdXBdMgQl7JrOx09NEBuzIpVXcsN2KDHufAKY=
github.com/moby/moby/client v0.6.3/go.mod h1:7CXNAnAhcwwqjwjXqLembJczRorLfM+5mu0d5363lCc=
github.com/moby/patternmatcher v0.6.1 h1:qlhtafmr6kgMIJjKJMDmMWq7WLkKIo23hsrpR3x084U=
github.com/moby/patternmatcher v0.6.1/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
github.com/moby/sys/mount v0.3.5 h1:eS3fsZTjHaBihwjp4/+5Z3jxqLXYsbwxqpVSfFv3M00=
@@ -214,19 +214,19 @@ github.com/prometheus/client_golang v1.25.0 h1:cDtW1TcFsMi1RJc8khwCKB4VhzwV04aKq
github.com/prometheus/client_golang v1.25.0/go.mod h1:j2X/4/kaQHLPnmyEU8zjmkndo1T317VpCIQEml8LTKk=
github.com/prometheus/client_model v0.6.3 h1:O0jaTVAYNxTHYInEPFJt5I3+sN8zqBtVMPTB1qyxiEo=
github.com/prometheus/client_model v0.6.3/go.mod h1:gpN5P9S7Rr6Yr92PiQ+Ixvhf6JZEkF1dnxsYL2aPBEM=
github.com/prometheus/common v0.73.1 h1:SZWh/j4AvhCdhX8jvYSnxvPxhWlC9QZkjJ+tOrEr7kU=
github.com/prometheus/common v0.73.1/go.mod h1:I9aA/Ukz9s1olOobh8KtCkU7B1mQPQsB9UvQPsUQ1Dk=
github.com/prometheus/common v0.74.0 h1:6iYW8MsYvmEnXFD9zLGgF0qmReaRhs3OMONu1c/nrLI=
github.com/prometheus/common v0.74.0/go.mod h1:i/02C+FCst5B1etKgWesNrD49n+onplJCqUCtUKkOeA=
github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4=
github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI=
github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4=
github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI=
github.com/shamaton/msgpack/v3 v3.2.6 h1:i8I++0ehiIO8yK4+ZU6j5MIWFz5e8J6EeJvdM/qeyTw=
github.com/shamaton/msgpack/v3 v3.2.6/go.mod h1:sgBYvEiyz8JR1NC3yGRoPVME9xXovpnh3l/plW1nfRo=
github.com/shamaton/msgpack/v3 v3.2.7 h1:YuVYjZq5+NLIREdW52txCmEfVGIi4ithcdhOJhAmU5A=
github.com/shamaton/msgpack/v3 v3.2.7/go.mod h1:sgBYvEiyz8JR1NC3yGRoPVME9xXovpnh3l/plW1nfRo=
github.com/shirou/gopsutil/v4 v4.26.10 h1:MJN6euesJx53MVEjscYeyRSRcrdIcy3sz5k9nosjldg=
github.com/shirou/gopsutil/v4 v4.26.10/go.mod h1:XpkIrcUMQhwte/dGxu57KtnMMFsbKelI7PP23zweKBk=
github.com/sirupsen/logrus v1.10.2 h1:G2SED73/qrAu6YwbdxOD6peLkCBI3z7L+ykJFTXJBBo=
@@ -238,8 +238,8 @@ github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qq
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.1.0 h1:6W6MbVUrnMb8PEhjkqwsVLY7ryuzRfFHF4mQd7L94ag=
github.com/spf13/pflag v1.1.0/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
@@ -257,12 +257,12 @@ github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWD
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/testcontainers/testcontainers-go v0.44.0 h1:/Fwh6HY1mIikhnm9e7HwoxGycx0lzRAE0f5VQpjFxzI=
github.com/testcontainers/testcontainers-go v0.44.0/go.mod h1:IcnwQrYTO86xHXu5bvMaBH7ATlbS3Qn1M1QWW3c66rE=
github.com/testcontainers/testcontainers-go/modules/mysql v0.44.0 h1:oJPJPxNE6YQ0zlq6mZKh06JOlyimCky4ruQUimdDet4=
github.com/testcontainers/testcontainers-go/modules/mysql v0.44.0/go.mod h1:MSOAU6ukCpehJVHQDN1k9JgOZXZuqHD+2pT20M3JkIg=
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0 h1:8fdv/9y3JMxjQ+ULAcOG8RtgeNu5t9XF9LolSXDuTwM=
github.com/testcontainers/testcontainers-go/modules/postgres v0.44.0/go.mod h1:CFr2LncGYokw+OKjXcr8ARCKG1SaC2UEnGxFBovE86g=
github.com/testcontainers/testcontainers-go v0.45.0 h1:ss9Stm9KDX6JLgGL4jr2fC5dwpabTbCBsRcGadBPR9k=
github.com/testcontainers/testcontainers-go v0.45.0/go.mod h1:VMJZ7M+qhgfEHWNbtjm596OyEOraULSTDaus/h0hmJI=
github.com/testcontainers/testcontainers-go/modules/mysql v0.45.0 h1:7bMiRqhS93pmbshw2rA4acBHUob8r+NbwE7y2MuSrM4=
github.com/testcontainers/testcontainers-go/modules/mysql v0.45.0/go.mod h1:zSmbgsxrsD09BtzsVpsfZF+LixiKCa1xcdnPB4bPH/s=
github.com/testcontainers/testcontainers-go/modules/postgres v0.45.0 h1:XsZa4fjEGqWVM3psvyJx04+dG3ZOPV0KkwFhJRqzcJM=
github.com/testcontainers/testcontainers-go/modules/postgres v0.45.0/go.mod h1:v59yuxG94bpGrtq6MTMmrH1It+196bg7mtGwtDx1QEY=
github.com/tinylib/msgp v1.6.5 h1:iAH6XTP7BpzErjBZlujJQXxA+GmRi2YWs6M4KdLtNbE=
github.com/tinylib/msgp v1.6.5/go.mod h1:RSp0LW9oSxFut3KzESt5Voq4GVWyS+PSulT77roAqEA=
github.com/tklauser/go-sysconf v0.4.0 h1:7H0uAN+7RkwWRaxhYXDLqa5V3LPrJeV8wmD9dRUgPQU=
@@ -271,15 +271,15 @@ github.com/tklauser/numcpus v0.12.0 h1:NR85qdvHA9pFse3x3weVZ0r0ST8R6l5RHbZrlRaqo
github.com/tklauser/numcpus v0.12.0/go.mod h1:ABHeXzJnr/qqwguhClkZKT1/8VABcYrsyUiUGobwWJg=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.77.0 h1:6mxBJdHabRmU4Cmw79Uqhgvjzsp6pjOaQk2t8COflzo=
github.com/valyala/fasthttp v1.77.0/go.mod h1:m8oTPC8riDDky07invpl+Gz3RixnAN5BbwyUuVB5H2o=
github.com/valyala/fasthttp v1.79.0 h1:32ur91W4kWG+1s6x3oDlP8/KNmjlZZlUzSSC4p9LSWE=
github.com/valyala/fasthttp v1.79.0/go.mod h1:NQN+PlgP93+JRPnCiApN5XwnI24oMQf8kuzrxtsTy9A=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/auto/sdk v1.2.2 h1:ErNn7NW2t1F9CFBLb9iyPMyLRbcEd07l5m/StCe9AEE=
go.opentelemetry.io/auto/sdk v1.2.2/go.mod h1:Ca3X8ec6gdTYjAirla//dnp05ECtQPfN4Ut74OJLVsQ=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw=
go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM=
@@ -296,16 +296,16 @@ go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrF
go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ=
go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v2 v2.4.5 h1:a5nxWvYi94DRl6QSLlTbLpVmutgx2qg8EVjnJtuFpwI=
go.yaml.in/yaml/v2 v2.4.5/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM=
go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54=
golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w=
golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c=
golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -313,12 +313,12 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
golang.org/x/net v0.63.0 h1:HCoTmNh9EpD1PpK8gBNFY4gcTY4N+KQEO8ylfIKqFJ0=
golang.org/x/net v0.63.0/go.mod h1:15JLg3IX1bLjHK264EZQEbIpTiR/KVLuo9CTRWd0pig=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA=
golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs=
golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -328,26 +328,26 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs=
golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM=
golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY=
golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk=
golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc=
golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s=
golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo=
golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY=
golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE=
golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI=
golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA=
golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs=
golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
@@ -365,5 +365,3 @@ gorm.io/gorm v1.31.2 h1:3o8FXNo9v9S858gil+3LlZA1LkCOzgb4g5BL64FgaCo=
gorm.io/gorm v1.31.2/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
pgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=
pgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
+2
View File
@@ -12,6 +12,7 @@ data:
read_timeout: {{ .Values.server.readTimeout | quote }}
write_timeout: {{ .Values.server.writeTimeout | quote }}
idle_timeout: {{ .Values.server.idleTimeout | quote }}
allowed_origins: {{ .Values.server.allowedOrigins | default list | toJson }}
tls:
enabled: false
@@ -73,6 +74,7 @@ data:
cache:
default_ttl: {{ .Values.cache.defaultTTL | quote }}
cleanup_interval: {{ .Values.cache.cleanupInterval | quote }}
idle_ttl: {{ .Values.cache.idleTTL | quote }}
max_size_bytes: {{ .Values.cache.maxSizeBytes }}
per_project_quota: {{ .Values.cache.perProjectQuota }}
ttl_overrides:
+8 -5
View File
@@ -93,6 +93,8 @@ server:
readTimeout: "5m"
writeTimeout: "5m"
idleTimeout: "2m"
# Browser origins allowed to use /api and /ws; empty = same-origin only
allowedOrigins: []
# Additional environment variables for server container
# Use this to override config via environment variables
@@ -375,14 +377,15 @@ migration:
# Cache configuration
cache:
defaultTTL: "168h" # 7 days
defaultTTL: "24h" # Freshness window for metadata pages; keep below the 72h client release-age gate
cleanupInterval: "1h"
idleTTL: "168h" # Remove cached items not requested for this long; "0" disables
maxSizeBytes: 536870912000 # 500GB
perProjectQuota: 53687091200 # 50GB
ttlOverrides:
npm: "168h"
pip: "168h"
go: "168h"
npm: "24h"
pip: "24h"
go: "24h"
# Security scanning configuration
security:
@@ -406,7 +409,7 @@ security:
osv:
enabled: false
apiUrl: "https://api.osv.dev"
apiUrl: "https://api.osv.dev/v1/query"
timeout: "30s"
grype:
+42
View File
@@ -0,0 +1,42 @@
// Package dbcount counts the SQL statements a GORM handle runs, for query-count tests.
package dbcount
import (
"context"
"sync/atomic"
"time"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
// Counter holds the number of statements seen since the last Reset.
type Counter struct {
n atomic.Int64
}
// Attach returns a session of db that counts every statement it executes. It
// swaps the logger instead of registering callbacks, because callback
// registration is not safe while other goroutines already run queries.
// GORM runs a subquery as a dry run with a discarded logger, so subqueries do not count.
func Attach(db *gorm.DB) (*gorm.DB, *Counter) {
c := &Counter{}
return db.Session(&gorm.Session{Logger: &countingLogger{Interface: logger.Discard, c: c}}), c
}
// Reset zeroes the count.
func (c *Counter) Reset() { c.n.Store(0) }
// Count returns the statements counted since the last Reset.
func (c *Counter) Count() int { return int(c.n.Load()) }
type countingLogger struct {
logger.Interface
c *Counter
}
func (l *countingLogger) LogMode(logger.LogLevel) logger.Interface { return l }
func (l *countingLogger) Trace(context.Context, time.Time, func() (string, int64), error) {
l.c.n.Add(1)
}
+1
View File
@@ -0,0 +1 @@
.lake/
+94
View File
@@ -0,0 +1,94 @@
# Lean audit findings
Audit of GoHoarder at c98720c (v0.1.303) with Lean 4 + Mathlib v4.36.0. Models live in
`lean4/Gohoarder/*.lean`; each cites the Go files it models. Statements are "proved about the model".
A Lean counterexample is never the evidence alone: every fixed row has a Go test that failed first.
Build: `cd lean4 && lake exe cache get && lake build && lake env lean scripts/Axioms.lean`.
Currency: `sh lean4/scripts/check_currency.sh origin/main`.
## Fixed
| id | area | claim | class | severity | evidence (Lean / Go test) | fix commit |
|----|------|-------|-------|----------|---------------------------|------------|
| GH-01 | PyPI fetch | the file fetched from `original_url` is the file the cache key names | security, CWE-345 | high | `Access.old_guard_allows_key_poisoning`, `fixed_guard_binds_key` / `TestHandlePackageFile_OriginalURLFilenameBound` | 5c9f7e6 |
| GH-02 | scan decision | a bypassed CVE never blocks, under any `block_on_severity` | correctness (over-block) | low | `Security.old_low_ignores_bypass`, `fully_bypassed_never_blocks` / `TestCheckVulnerabilities_BypassedCVENeverBlocks` | 4713524 |
| GH-03 | PyPI scan | scanners are asked about the release version, not the file name | security, CWE-693 | high when a block policy is set | `Security.scan_asks_release_version`, `file_name_is_not_release_version` / `TestScanAsksScannersForReleaseVersion` | 3143de3 |
| GH-04 | scan gate | an npm or PyPI package named `*.info` or `*.mod` is scanned | security, CWE-693 | medium | `Cache.npm_named_like_go_metadata_is_scanned`, `old_exempted_npm_package` / `TestCacheHitScansPackagesNamedLikeGoMetadata`, `TestIsMetadataEntry` | f0b37ea |
| GH-05 | storage quota | `used` equals bytes on disk after an overwrite | correctness | low | `Cache.put_keeps_usage_exact`, `old_put_inflates_usage` / `TestPutOverwriteKeepsUsageExact`, `TestPutOverwriteWithinQuota` | 1f31256 |
| GH-06 | LRU eviction | eviction terminates; an overlapping store waits instead of failing | correctness | medium | `Cache.old_evict_is_stuck`, `fixed_evict_measure_falls` / `TestEvictTerminatesWhenDeletesFail`, `TestEvictWaitsForRunningEviction` | 440279a |
| GH-07 | get vs purge | a purge between probe and open does not fail the request | correctness | low | `Cache.getOnce_errors_on_purge`, `getRetry_survives_one_purge` / `TestGetRecoversFromPurgeBetweenProbeAndOpen` | 990a1d3 |
| GH-08 | stats rollup | every completed day still held hourly is rolled up | correctness (data loss) | medium | `Stats.old_loses_day_on_one_skip`, `new_repairs_after_skip`, `early_tick_leaves_last_hour` / `TestDailyRollupKeepsLastHourOfDay`, `TestDailyRollupCoversMissedDay`, `TestPostgresDailyRollupCoversMissedDay` | ad4e848 |
| GH-09 | stats chart | a rollup never hides downloads counted after it ran | correctness | low | `Stats.chartOld_drops_late_download`, `chartNew_sound` / `TestTimeSeriesKeepsLateDownloadsAheadOfRollup` | 7192e4f |
| GH-15 | release age | a cached packument or index stays fresh no longer than the client's 72h release-age gate | correctness (config default) | low | `Release.compiled_ttl_within_gate`, `old_default_ttl_exceeded_gate` / `TestMetadataEntryDefaultTTLIsBelowReleaseAgeGate`, `TestMetadataEntryExplicitTTLWins`, `TestDefaultMetadataTTL`, `TestShippedExamplesKeepMetadataTTLWithinGate` | 549d56e |
| GH-17 | CORS, auth off | a page at a foreign origin cannot read `/api` or change state through a visitor's browser | security, CWE-352 / CWE-942 | medium with `auth.enabled: false` | `Access.old_cors_admits_any_page`, `fixed_refuses_foreign_origin` / `TestAPIDeleteFromDisallowedOriginForbidden`, `TestAPIDeleteFromAllowedOriginWorks`, `TestAPIPreflightAnswersOnlyAllowedOrigins`, `TestAPIGetStaysPublicWithoutWildcardCORS`, `TestAPISameOriginRuleWhenNoOriginsConfigured` | f204938 |
| GH-18 | api keys | `ValidateAPIKey` costs one bcrypt compare, whatever the number of stored keys | hardening, CWE-400 | low | `Access.old_cost_grows_with_keys`, `new_cost_independent_of_keys` / `TestValidateAPIKeyCostIndependentOfKeyCount`, `TestLegacyComparesAreConcurrencyBounded` | ae5167f |
| GH-19 | SSRF | every redirect hop passes the upstream allowlist, the scheme rule and a non-private address check | security, CWE-918 | medium | `Access.redirect_escapes_allowlist`, `fixed_redirect_stays_allowlisted` / `TestRedirectToDisallowedHostRefused`, `TestRedirectToLoopbackRefused`, `TestRedirectToPrivateLiteralRefused`, `TestRedirectAllowedToAllowedWorks`, `TestRedirectHopsCapped`, `TestSidecarRedirectOffAllowlistRefused` | 787c757 |
| GH-20 | stats, sqlite | SQLite upserts hourly and daily rows as PostgreSQL does, one row per bucket | correctness | low (SQLite only) | `Stats.old_sqlite_duplicates_rows`, `fixed_sqlite_package_row_keeps_late_events` / `TestSQLiteHourlyTotalsMatchPostgresSemantics`, `TestPostgresHourlyTotalsMatchSQLite`, `TestSQLiteDailyRollupIsIdempotent`, `TestSQLiteStatsDedupeMigration` | f46e079 |
| GH-21 | scan retry | a scan retry on S3 or SMB storage reads the stored blob instead of a removed temp file | correctness | low (file-based scanners on remote storage) | `Security.old_remote_retry_unreadable`, `fixed_retry_always_readable` / `TestScanRetryOnRemoteStorageReadsBlobAgain` | 31db940 |
### Exploit paths and reach
- **GH-01.** A client requests `/pypi/<victim>/<victim-file>?original_url=https://files.pythonhosted.org/.../<attacker-file>`.
The host is on the allowlist, the key is `pypi/<victim>/<victim-file>`, and an uncached key stores the attacker's
file. Every later client gets it; OSV judges the victim's name and version. The attacker publishes the file on PyPI
and needs no credentials. Reach: any network client of `/pypi`, unauthenticated when `auth.enabled` is false (production).
- **GH-03.** Live check against `api.osv.dev` for requests 2.19.0: the release version returns 10 advisories; the file name
returns 12, missing PYSEC-2023-74 and GHSA-j8r2-6x86-q33q. Production has `block_on_severity: none`, so it shows wrong
scan results rather than serving blocked packages; any deployment with a block policy served such packages.
- **GH-17.** A page at any origin issued `DELETE /api/packages/<registry>/<name>/<version>` from a visitor's browser, and
`Access-Control-Allow-Origin: *` let it read every `/api` response. Reach: any visitor to a hostile page when
`auth.enabled` is false (production); impact is cache eviction. Fixed by `apiOriginGuard` against `server.allowed_origins`;
with none set, only same-origin passes.
- **GH-19.** An allowed host that answered 302 reached any target (`169.254.169.254`, `127.0.0.1`, `10.x`), by name or by
DNS rebinding. No allowed host redirects today; the fix removes the dependency on that. Hops are capped at 10, limited to
http(s), vetted against the allowlist, and a hop to another host dials through a guard that refuses private, loopback,
link-local and carrier-grade addresses after resolution. A redirect inside one host is left alone: a private index is
operator-trusted.
- **GH-04.** The publisher of an npm or PyPI package named `x.info` skipped the scan and the block policy. Reach: any package
publisher; needs a block policy to matter.
### Notes on the fixed rows
- **GH-15.** `cache.ttl_overrides` has no consumer in the Go code (`grep TTLOverrides pkg cmd`: the field and its compiled default
only). The per-registry keys are kept and now default to 24h; they change nothing until something reads them.
- **GH-18.** New keys read `ghk_<id>.<secret>`; the hash covers the secret and one lookup selects the stored key. A miss
compares a dummy hash. Keys minted before are accepted through a legacy path capped at 4 concurrent bcrypt compares. They
cannot be migrated: the raw key holds no id and the stored hash covers the whole raw key. Re-issue them to leave the
legacy path. Production holds none.
- **GH-20.** SQLite startup merges old duplicate rows (package rows add up, derived rows keep one) and creates the unique indexes.
- **GH-21.** `RescanWorker` still skips remote storage ("No local file path available"); that is a separate, unchanged behaviour.
- **GH-17 cleanup.** The per-handler `Access-Control-Allow-Origin: *` lines in `pkg/app/handlers*.go` are now overridden by the
guard and are dead; remove them once the API performance work lands.
## Not fixed
| id | area | claim | verdict | why |
|----|------|-------|---------|-----|
| GH-10 | key path | `keyToPath` rewrites `..` instead of rejecting; distinct keys share a path | hardening, unreachable | `Keys.keyToPath_not_injective`. A probe through the full app showed the HTTP layer resolves literal `..` and answers 404 to encoded slashes (`/npm/lodash/-/lodash-1.0.0/../../x.tgz` reached upstream as `/lodash/-/lodash-x.tgz`). No key with `..` reaches storage. |
| GH-11 | cache hit | the stored SHA-256 is not re-verified on read | by-design | `Put` verifies the stream it just hashed; no doc promises read-side integrity. A check reads up to 2 GB per hit. Disk corruption is outside the proxy's threat model. |
| GH-12 | idle purge | check and delete are two steps, so a request inside the window loses its blob | by-design | `Cache.purge_window_deletes_fresh_entry`. The consequence is a refetch; GH-07 covers the in-flight request. |
| GH-13 | scan policy | with `fail_closed: false` a package whose scan keeps failing on infrastructure is served unscanned | by-design, accepted | See "Decision" below. |
| GH-14 | scan merge | one scanner failing while another returns clean saves a clean result and schedules no retry | by-design | `Security.partial_failure_reads_clean`. `scan` handles only the all-failed case; redundancy across scanners is the intent. |
| GH-16 | admin API | `requireAdmin` accepts the `bypasses:manage` permission and also guards key minting | tested-clean | Only the admin role holds that permission: `Access.admin_gate_implies_key_manager`. |
### Decision: `fail_closed: false` with recurring infrastructure errors
Served: a package with no scan row while a scan is in flight, and a package whose every scanner failed on infrastructure
(`Security.unscanned_served_iff`, `infra_error_served_forever`). Retries: at most 6 at 5 minute spacing, 7 scans, 30
minutes (`retry_terminates`, `retry_window_minutes`); after that the error row stays and the package stays served until
the rescan worker runs (needs `rescan_interval`). Quoted intent: `pkg/cache/cache.go` "A wait that times out serves the
package unless FailClosed is set"; `scanner.go` "Scan failed on infrastructure, serving package; scan will be retried";
production config "A scan that fails on infrastructure is retried and the package is served (fail_closed false)".
Verdict: acceptable for production, whose only scanner is OSV, a remote service that cannot be made to time out by package
content. Residual risk: with file-based scanners (trivy, grype, pip-audit) a crafted package that makes the scanner time out
is served unscanned, because a deadline counts as infrastructure. Run those with `fail_closed: true`. No code change.
## Negative matrices (do not re-run)
| surface | runs | a leak would look like | verdict |
|---------|------|------------------------|---------|
| frontend nginx blocklist (`Dockerfile.frontend` template on nginx:alpine, stub backend) | 30 raw paths: `//npm`, `/./npm`, `%6Epm`, `/api/../npm`, `/api/..%2fnpm`, `/health/..%2fnpm`, `/ws/..%2fnpm`, `/api/..\npm`, `/api/..;/npm`, `/api/%5c..%5cnpm`, `/api/..%252fnpm`, `/npm?x=1`, `/metrics/` and more | 200 from the backend for `/npm`, `/pypi`, `/go` or `/metrics` | all 404 or SPA. `/NPM/x` returns the SPA page, not the proxy. |
| backend re-interpretation of the six paths nginx forwarded raw | `/api/..\npm/x`, `/api/..;/npm/x`, `/api/%5c..%5cnpm/x`, `/api/%2e%2e%5cnpm/x`, `/api/..%252fnpm/x`, `/api/;/../npm/x` against the full app | 200 from the npm handler | all 404 |
| WebSocket origin check | `Access.default_port_equivalent`, `scheme_mismatch_rejected`, `port_mismatch_rejected`, `glob_rejects_label_prefix`, `glob_rejects_suffix_trick` | an origin outside the allowlist accepted | clean. Same-origin mode compares host only; documented: "the Origin host must match the Host header". |
| history totals under eviction | existing `TestPostgresHistoryTablesHaveNoPackageForeignKey`, `checkDeleteKeepsDownloadHistory` | totals fall after a package delete | clean: history tables carry no foreign key to packages. |
+6
View File
@@ -0,0 +1,6 @@
import Gohoarder.Cache
import Gohoarder.Keys
import Gohoarder.Security
import Gohoarder.Access
import Gohoarder.Release
import Gohoarder.Stats

Some files were not shown because too many files have changed in this diff Show More