fix linter

This commit is contained in:
modal-error 2026-01-27 07:23:52 -05:00
parent d3fafb0c4d
commit 82b1dc948e
2 changed files with 6 additions and 6 deletions

View file

@ -108,21 +108,21 @@ func (r *sceneResolver) Paths(ctx context.Context, obj *models.Scene) (*ScenePat
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
config := manager.GetInstance().Config
builder := urlbuilders.NewSceneURLBuilder(baseURL, obj)
// Use configurable expiry for signed URLs (only for AirPlay-compatible formats)
expires := time.Now().Add(time.Duration(config.GetSignedURLExpiry()) * time.Second)
// AirPlay-compatible formats: use signed URLs (streaming + captions)
streamPath, err := builder.GetSignedStreamURL(config.GetJWTSignKey(), expires)
if err != nil {
return nil, err
}
captionBasePath, err := builder.GetSignedCaptionURL(config.GetJWTSignKey(), expires)
if err != nil {
return nil, err
}
// Web-only formats: use unsigned URLs (rely on cookie authentication)
screenshotPath := builder.GetScreenshotURL()
previewPath := builder.GetStreamPreviewURL()

View file

@ -71,7 +71,7 @@ func VerifyURL(rawURL string, secret []byte) (bool, error) {
if len(parts) < 3 || (parts[0] != "scene" && parts[0] != "image" && parts[0] != "gallery") {
return false, nil
}
// For scene/image/gallery paths, the base path is /{type}/{id}/{action}
basePath := "/" + strings.Join([]string{parts[0], parts[1], parts[2]}, "/")
@ -84,4 +84,4 @@ func VerifyURL(rawURL string, secret []byte) (bool, error) {
expectedSig := hex.EncodeToString(h.Sum(nil))
return hmac.Equal([]byte(sig), []byte(expectedSig)), nil
}
}