• 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

83.33
/features/form-access/assert-path/assert-designer-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 { assertUserFileBlobPath } from "./assert-user-file-blob-path";
4
import { DesignerScope } from "@/lib/designer-runtime";
5

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

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

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

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

32
    if (
1✔
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.
40
    return null;
1✔
41
  }
42

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

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

51
  return assertUserFileBlobPath(
3✔
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