From 82b1dc948e5b241e45a85cbe4e40064d862384cb Mon Sep 17 00:00:00 2001 From: modal-error Date: Tue, 27 Jan 2026 07:23:52 -0500 Subject: [PATCH] fix linter --- internal/api/resolver_model_scene.go | 8 ++++---- pkg/signedurl/signedurl.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/api/resolver_model_scene.go b/internal/api/resolver_model_scene.go index a514807c7..85615c423 100644 --- a/internal/api/resolver_model_scene.go +++ b/internal/api/resolver_model_scene.go @@ -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() diff --git a/pkg/signedurl/signedurl.go b/pkg/signedurl/signedurl.go index 17f6a0076..206774c56 100644 --- a/pkg/signedurl/signedurl.go +++ b/pkg/signedurl/signedurl.go @@ -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 -} \ No newline at end of file +}