mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
fix: fix download s3 images with jwt
This commit is contained in:
@@ -52,6 +52,8 @@
|
||||
|
||||
let imageUrl: string | undefined = $state(undefined)
|
||||
|
||||
let token = getContext<{ token?: string }>('AuthToken')
|
||||
|
||||
async function getS3Image(source: string | undefined, storage?: string, presigned?: string) {
|
||||
if (!source) return ''
|
||||
const appPathOrUser = defaultIfEmptyString(
|
||||
@@ -64,6 +66,9 @@
|
||||
params.append('storage', storage)
|
||||
}
|
||||
|
||||
if (token?.token && token.token != '') {
|
||||
params.append('token', token.token)
|
||||
}
|
||||
const forceViewerPolicies = computeForceViewerPolicies()
|
||||
if (forceViewerPolicies) {
|
||||
params.append('force_viewer_allowed_s3_keys', JSON.stringify([forceViewerPolicies]))
|
||||
|
||||
Reference in New Issue
Block a user