mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
27 issues fixed from multi-dimensional code review (4 Critical, 6 High, 11 Medium, 6 Low): Security (Critical): - Escape HTML in OAuth authorization page to prevent XSS (C1) - Add CSRF protection to OAuth authorize flow (C2) - Replace bypassable regex sanitizer with sanitize-html library (C3) - Enforce OAuth scopes on all Mastodon API routes (C4) Security (Medium/Low): - Fix SSRF via DNS resolution before private IP check (M1) - Add rate limiting to API, auth, and app registration endpoints (M2) - Validate redirect_uri on POST /oauth/authorize (M4) - Fix custom emoji URL injection with scheme validation + escaping (M5) - Remove data: scheme from allowed image sources (L6) - Add access token expiry (1hr) and refresh token rotation (90d) (M3) - Hash client secrets before storage (L3) Architecture: - Extract batch-broadcast.js — shared delivery logic (H1a) - Extract init-indexes.js — MongoDB index creation (H1b) - Extract syndicator.js — syndication logic (H1c) - Create federation-actions.js facade for controllers (M6) - index.js reduced from 1810 to ~1169 lines (35%) Performance: - Cache moderation data with 30s TTL + write invalidation (H6) - Increase inbox queue throughput to 10 items/sec (H5) - Make account enrichment non-blocking with fire-and-forget (H4) - Remove ephemeral getReplies/getLikes/getShares from ingest (M11) - Fix LRU caches to use true LRU eviction (L1) - Fix N+1 backfill queries with batch $in lookup (L2) UI/UX: - Split 3441-line reader.css into 15 feature-scoped files (H2) - Extract inline Alpine.js interaction component (H3) - Reduce sidebar navigation from 7 to 3 items (M7) - Add ARIA live regions for dynamic content updates (M8) - Extract shared CW/non-CW content partial (M9) - Document form handling pattern convention (M10) - Add accessible labels to functional emoji icons (L4) - Convert profile editor to Alpine.js (L5) Audit: documentation-central/audits/2026-03-24-activitypub-code-review.md Plan: documentation-central/plans/2026-03-24-activitypub-audit-fixes.md
243 lines
5.1 KiB
CSS
243 lines
5.1 KiB
CSS
/* ==========================================================================
|
|
Federation Management
|
|
========================================================================== */
|
|
|
|
.ap-federation__section {
|
|
margin-block-end: var(--space-l);
|
|
}
|
|
|
|
.ap-federation__section h2 {
|
|
margin-block-end: var(--space-s);
|
|
}
|
|
|
|
.ap-federation__stats-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
|
|
gap: var(--space-s);
|
|
}
|
|
|
|
.ap-federation__stat-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: var(--space-xs);
|
|
padding: var(--space-s);
|
|
background: var(--color-offset);
|
|
border-radius: var(--border-radius-small);
|
|
text-align: center;
|
|
}
|
|
|
|
.ap-federation__stat-count {
|
|
font-size: var(--font-size-xl);
|
|
font-weight: 600;
|
|
color: var(--color-on-background);
|
|
}
|
|
|
|
.ap-federation__stat-label {
|
|
font-size: var(--font-size-s);
|
|
color: var(--color-on-offset);
|
|
word-break: break-word;
|
|
}
|
|
|
|
.ap-federation__actions-row {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--space-s);
|
|
align-items: center;
|
|
}
|
|
|
|
.ap-federation__result {
|
|
margin-block-start: var(--space-xs);
|
|
color: var(--color-green50);
|
|
font-size: var(--font-size-s);
|
|
}
|
|
|
|
.ap-federation__error {
|
|
margin-block-start: var(--space-xs);
|
|
color: var(--color-red45);
|
|
font-size: var(--font-size-s);
|
|
}
|
|
|
|
.ap-federation__lookup-form {
|
|
display: flex;
|
|
gap: var(--space-s);
|
|
}
|
|
|
|
.ap-federation__lookup-input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
padding: 0.5rem 0.75rem;
|
|
border: var(--border-width-thin) solid var(--color-outline);
|
|
border-radius: var(--border-radius-small);
|
|
font: inherit;
|
|
color: var(--color-on-background);
|
|
background: var(--color-background);
|
|
}
|
|
|
|
.ap-federation__json-view {
|
|
margin-block-start: var(--space-s);
|
|
padding: var(--space-m);
|
|
background: var(--color-offset);
|
|
border-radius: var(--border-radius-small);
|
|
font-family: monospace;
|
|
font-size: var(--font-size-s);
|
|
color: var(--color-on-background);
|
|
max-height: 24rem;
|
|
overflow: auto;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.ap-federation__posts-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-xs);
|
|
}
|
|
|
|
.ap-federation__post-row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: var(--space-m);
|
|
padding: var(--space-s);
|
|
background: var(--color-offset);
|
|
border-radius: var(--border-radius-small);
|
|
}
|
|
|
|
.ap-federation__post-info {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--space-xs);
|
|
min-width: 0;
|
|
}
|
|
|
|
.ap-federation__post-title {
|
|
font-weight: 500;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.ap-federation__post-meta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-xs);
|
|
font-size: var(--font-size-s);
|
|
color: var(--color-on-offset);
|
|
}
|
|
|
|
.ap-federation__post-actions {
|
|
display: flex;
|
|
gap: var(--space-xs);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.ap-federation__post-btn {
|
|
padding: var(--space-xs) var(--space-s);
|
|
font-size: var(--font-size-s);
|
|
border: var(--border-width-thin) solid var(--color-outline);
|
|
border-radius: var(--border-radius-small);
|
|
background: var(--color-background);
|
|
color: var(--color-on-background);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ap-federation__post-btn:hover {
|
|
background: var(--color-offset);
|
|
}
|
|
|
|
.ap-federation__post-btn--danger {
|
|
color: var(--color-red45);
|
|
border-color: var(--color-red45);
|
|
}
|
|
|
|
.ap-federation__post-btn--danger:hover {
|
|
background: color-mix(in srgb, var(--color-red45) 10%, transparent);
|
|
}
|
|
|
|
.ap-federation__modal-overlay {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1000;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: hsl(var(--tint-neutral) 10% / 0.5);
|
|
}
|
|
|
|
.ap-federation__modal {
|
|
width: min(90vw, 48rem);
|
|
max-height: 80vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--color-background);
|
|
border-radius: var(--border-radius-small);
|
|
box-shadow: 0 4px 24px hsl(var(--tint-neutral) 10% / 0.2);
|
|
}
|
|
|
|
.ap-federation__modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: var(--space-s) var(--space-m);
|
|
border-block-end: var(--border-width-thin) solid var(--color-outline);
|
|
}
|
|
|
|
.ap-federation__modal-header h3 {
|
|
margin: 0;
|
|
font-size: var(--font-size-m);
|
|
}
|
|
|
|
.ap-federation__modal-close {
|
|
font-size: var(--font-size-xl);
|
|
line-height: 1;
|
|
padding: 0 var(--space-xs);
|
|
border: none;
|
|
background: none;
|
|
color: var(--color-on-offset);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.ap-federation__modal .ap-federation__json-view {
|
|
margin: 0;
|
|
border-radius: 0 0 var(--border-radius-small) var(--border-radius-small);
|
|
flex: 1;
|
|
overflow: auto;
|
|
}
|
|
|
|
@media (max-width: 40rem) {
|
|
.ap-federation__post-row {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.ap-federation__lookup-form {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
/* Follow request approve/reject actions */
|
|
.ap-follow-request {
|
|
margin-block-end: var(--space-m);
|
|
}
|
|
|
|
.ap-follow-request__actions {
|
|
display: flex;
|
|
gap: var(--space-s);
|
|
margin-block-start: var(--space-xs);
|
|
padding-inline-start: var(--space-l);
|
|
}
|
|
|
|
.ap-follow-request__form {
|
|
display: inline;
|
|
}
|
|
|
|
.button--danger {
|
|
background-color: var(--color-red45);
|
|
color: white;
|
|
}
|
|
|
|
.button--danger:hover {
|
|
background-color: var(--color-red35, #c0392b);
|
|
}
|