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

supabase / storage / 25738155938

12 May 2026 01:38PM UTC coverage: 39.251% (-35.1%) from 74.366%
25738155938

Pull #1094

github

web-flow
Merge 0f3efcca0 into defbbb616
Pull Request #1094: feat: embedded vector store

2188 of 6152 branches covered (35.57%)

Branch coverage included in aggregate %.

88 of 280 new or added lines in 6 files covered. (31.43%)

3689 existing lines in 165 files now uncovered.

4312 of 10408 relevant lines covered (41.43%)

34.74 hits per line

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

17.65
/src/http/routes/render/renderAuthenticatedImage.ts
1
import { getTenantConfig } from '@internal/database'
2
import { ImageRenderer } from '@storage/renderer'
3
import { FastifyInstance } from 'fastify'
4
import { FromSchema } from 'json-schema-to-ts'
5
import { getConfig } from '../../../config'
6
import { transformationOptionsSchema } from '../../schemas/transformations'
7
import { ROUTE_OPERATIONS } from '../operations'
8

9
const { storageS3Bucket, isMultitenant } = getConfig()
2✔
10

11
const renderAuthenticatedImageParamsSchema = {
2✔
12
  type: 'object',
13
  properties: {
14
    bucketName: { type: 'string', examples: ['avatars'] },
15
    '*': { type: 'string', examples: ['folder/cat.png'] },
16
  },
17
  required: ['bucketName', '*'],
18
} as const
19

20
const renderImageQuerySchema = {
2✔
21
  type: 'object',
22
  properties: {
23
    ...transformationOptionsSchema,
24
    download: { type: 'string', examples: ['filename.png'] },
25
  },
26
} as const
27

28
interface renderImageRequestInterface {
29
  Params: FromSchema<typeof renderAuthenticatedImageParamsSchema>
30
  Querystring: FromSchema<typeof renderImageQuerySchema>
31
}
32

33
export default async function routes(fastify: FastifyInstance) {
UNCOV
34
  const summary = 'Render an authenticated image with the given transformations'
×
UNCOV
35
  fastify.get<renderImageRequestInterface>(
×
36
    '/authenticated/:bucketName/*',
37
    {
38
      schema: {
39
        params: renderAuthenticatedImageParamsSchema,
40
        querystring: renderImageQuerySchema,
41
        summary,
42
        response: { '4xx': { $ref: 'errorSchema#', description: 'Error response' } },
43
        tags: ['transformation'],
44
      },
45
      config: {
46
        operation: { type: ROUTE_OPERATIONS.RENDER_AUTH_IMAGE },
47
      },
48
    },
49
    async (request, response) => {
UNCOV
50
      const { download } = request.query
×
UNCOV
51
      const { bucketName } = request.params
×
UNCOV
52
      const objectName = request.params['*']
×
53

UNCOV
54
      const obj = await request.storage
×
55
        .from(bucketName)
56
        .findObject(objectName, 'id,version,metadata')
57

UNCOV
58
      const s3Key = request.storage.location.getKeyLocation({
×
59
        tenantId: request.tenantId,
60
        bucketId: bucketName,
61
        objectName,
62
      })
63

UNCOV
64
      const renderer = request.storage.renderer('image') as ImageRenderer
×
65

UNCOV
66
      if (isMultitenant) {
×
67
        const tenantConfig = await getTenantConfig(request.tenantId)
×
68
        renderer.setLimits({
×
69
          maxResolution: tenantConfig.features.imageTransformation.maxResolution,
70
        })
71
      }
72

UNCOV
73
      return renderer.setTransformations(request.query).render(request, response, {
×
74
        bucket: storageS3Bucket,
75
        key: s3Key,
76
        version: obj.version,
77
        download,
78
        xRobotsTag: obj.metadata?.['xRobotsTag'] as string | undefined,
79
        signal: request.signals.disconnect.signal,
80
      })
81
    }
82
  )
83
}
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