venus_media_library 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53f9b683221215b76b95f0248dd87938ebba0a7066c36ccc7b02dc23fece50e0
4
- data.tar.gz: acf9d06d3f9a7712568f9f05c9584ccc9fda2772de1bcad6e1b2090c1cf07e8f
3
+ metadata.gz: bcec0bd91adffafd52e55f0eecca9146046813df1fdde5252affd856a4584bf8
4
+ data.tar.gz: c84ee2c8fac6c7ac3faa00e7de4e4ae43ec4ab7bbb93b7213e466881e9ef8257
5
5
  SHA512:
6
- metadata.gz: e1d247beff66e7d45750fcfa96813cdcb0bb7ed5a2cb0eb500486602f4b8354001ffc280fe399fbb504ad094b2e97b3715cb578b29e2aabce34d34b82fd4037f
7
- data.tar.gz: e8928ccd013a969ff08cfef454886735297e5a74d84acc9b66a09335be91ede3a1a9f4f3dfbe59ede7a3b16acc4438b461b73b8c43c550e5ce01e989555b2999
6
+ metadata.gz: 15c65b27a87cc9e5e4b9d3d4e21050b3fcca50acffc9d0a36151f03b3d569a2cec51e15c9c1153454153518698ba189cb9f4c2bee54dd282305be2c5c60199f3
7
+ data.tar.gz: c5631b4d32836f90b2e4eb90ec982e331b2ffef76f0dafbd819b5779259d17941e8277f548c56260d85750d5bbc2317eb543bae1ab223bdf56981b6eb4c8ca9d
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project are documented here. The format is based on
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
5
5
  to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.1.1] - 2026-08-19
8
+
9
+ ### Fixed
10
+ - The picker now hands host URL fields (via `media_picker_field`, e.g. an
11
+ `og:image`) an **absolute, public** Active Storage URL (honoring
12
+ `config.url_type`) instead of the relative, owner-gated `/…/assets/:id` engine
13
+ route. Since 1.0.0 that route was not fetchable by external crawlers, silently
14
+ breaking og:image, social cards, and image SEO. In-admin grid thumbnails keep
15
+ using the gated route, and owner-scoped access is unchanged.
16
+
7
17
  ## [1.1.0] - 2026-08-18
8
18
 
9
19
  ### Added
@@ -19,16 +19,36 @@ module VenusMediaLibrary
19
19
  }
20
20
  end
21
21
 
22
- # Permanent URL to the original file. Active Storage route helpers live on the
23
- # host app, so they are reached through the `main_app` proxy. With
24
- # url_type = :proxy the URL streams through Rails (works for private buckets
25
- # and external crawlers); the default :redirect 302s to the storage URL.
22
+ # Permanent, PUBLIC URL to the original file — this is the value the picker
23
+ # writes into a host URL field (e.g. a page's og:image), so it must be
24
+ # absolute and fetchable by external crawlers (Facebook/Google/Twitter) with
25
+ # no session. It therefore uses Rails' public Active Storage routes, NOT the
26
+ # engine's owner-gated `asset_path` (an anonymous crawler hitting that route
27
+ # is bounced by the host's `authenticate_with` gate, silently breaking
28
+ # og:image / social cards). Owner-scoping still governs WHICH assets a member
29
+ # can SEE in the library (see visible_media_assets); it is orthogonal to the
30
+ # public URL a picked asset resolves to. Active Storage route helpers live on
31
+ # the host app, so they are reached through the `main_app` proxy. With
32
+ # url_type = :proxy the URL streams through Rails (works for private buckets);
33
+ # the default :redirect 302s to the storage URL. Mirrors PickerHelper's
34
+ # attach-mode preview so URL fields and attachment fields agree.
26
35
  def ml_blob_url(asset)
27
- venus_media_library.asset_path(asset)
36
+ if VenusMediaLibrary.configuration.url_type == :proxy
37
+ main_app.rails_storage_proxy_url(asset.blob)
38
+ else
39
+ main_app.rails_blob_url(asset.blob)
40
+ end
41
+ rescue StandardError
42
+ # Last resort only: a relative path keeps the admin grid rendering when a
43
+ # URL host is unavailable. Absolute public URLs above are what host URL
44
+ # fields need; this fallback should not be the stored og:image value.
45
+ main_app.rails_blob_path(asset.blob)
28
46
  end
29
47
 
30
- # Small variant used for the grid thumbnail. Falls back to the original URL
31
- # when the blob can't be variated (e.g. SVG).
48
+ # Small variant used for the in-admin grid thumbnail. This runs behind the
49
+ # engine's auth in the admin library UI, so the owner-scoped engine route is
50
+ # correct here (it also honors the per-tenant visibility rules). Only the
51
+ # picked `url` above needs to be public.
32
52
  def ml_thumb_url(asset)
33
53
  venus_media_library.thumbnail_asset_path(asset)
34
54
  end
@@ -1,3 +1,3 @@
1
1
  module VenusMediaLibrary
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: venus_media_library
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Good Works On Earth