• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

endatix / endatix-hub / 26183617452

20 May 2026 07:00PM UTC coverage: 51.833% (+0.6%) from 51.239%
26183617452

push

github

web-flow
feat!: Add S3 Storage provider (#637)

Merged after approval

1373 of 2342 branches covered (58.63%)

Branch coverage included in aggregate %.

1173 of 1884 new or added lines in 122 files covered. (62.26%)

12 existing lines in 11 files now uncovered.

5599 of 11109 relevant lines covered (50.4%)

9.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

4.17
/features/form-access/assert-path/assert-hub-object-access.ts
1
import type { ClientStorageConfig } from "@/features/asset-storage/infrastructure/providers/shared/client-storage-config";
2
import type { ParsedStorageObjectUrl } from "@/features/asset-storage/utils";
3
import type { HubStorageScope } from "../types";
4
import { assertUserFileBlobPath } from "./assert-user-file-blob-path";
5

6
const CONTENT_FORM_PREFIX = "f/";
3✔
7

8
/** Hub read-urls: content allows scoped or elevated `f/*` keys; user-files require form + submission. */
9
export function assertHubObjectAccess(
10
  parsed: ParsedStorageObjectUrl,
11
  scope: HubStorageScope,
12
  storageConfig: ClientStorageConfig,
13
): string | null {
14
  const userFilesContainer =
NEW
15
    storageConfig.containerNames.USER_FILES.toLowerCase();
×
NEW
16
  const contentContainer = storageConfig.containerNames.CONTENT.toLowerCase();
×
NEW
17
  const container = parsed.containerName.toLowerCase();
×
NEW
18
  const blobName = parsed.blobName;
×
19

NEW
20
  if (container === contentContainer) {
×
NEW
21
    if (!blobName.startsWith(CONTENT_FORM_PREFIX)) {
×
NEW
22
      return "Content object is not in hub content namespace";
×
23
    }
24

NEW
25
    if (
×
26
      scope.formId &&
27
      blobName.startsWith(`${CONTENT_FORM_PREFIX}${scope.formId}/`)
28
    ) {
NEW
29
      return null;
×
30
    }
31

NEW
32
    if (
×
33
      scope.templateId &&
34
      blobName.startsWith(`${CONTENT_FORM_PREFIX}${scope.templateId}/`)
35
    ) {
NEW
36
      return null;
×
37
    }
38

39
    // Hub editors may presign any content/f/* asset until per-image DB permissions exist.
NEW
40
    return null;
×
41
  }
42

NEW
43
  if (container !== userFilesContainer) {
×
NEW
44
    return "Unknown storage container";
×
45
  }
46

NEW
47
  if (!scope.formId) {
×
NEW
48
    return "Form context is required for user file access";
×
49
  }
50

NEW
51
  return assertUserFileBlobPath(
×
52
    blobName,
53
    { formId: scope.formId, submissionId: scope.submissionId },
54
    { requireSubmission: true },
55
  );
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc