Is it possible to have two s3 presign endpoints?

My app uploads files to s3 using Shrine and Uppy, but I need to separate some files (docs) into their own bucket, and neither gem or package seem to allow for the creation of multiple presign endpoints.

How would you approach this? Different upload criteria for different model associations, but only one pattern for uploading. Model association isn’t transmitted until I hit submit, so I don’t think a conditional is possible. Unless I can break it out in the uploader?

routes.rb

get 's3/params', to: 'presigns#photo'` 
# get 'private/s3/params', to: 'presigns#doc'

PresignsController.rb

class PresignsController < ApplicationController
 # photos should go to public s3 bucket
 def photo
  set_rack_response PhotoUploader.presign_response(:cache, request.env)
 end

 # docs should go to private s3 bucket
 # def doc
  # set_rack_response DocUploader.presign_response(:cache, request.env)
 # end

 private
 def set_rack_response((status, headers, body))
  self.status = status
  self.headers.merge!(headers)
  self.response_body = body
 end
end

uppy file

.use(AwsS3, {
 companionUrl: '/', 
})

uploader

class PhotoUploader < Shrine
 require "image_processing/mini_magick"
 plugin :pretty_location
 plugin :derivatives, create_on_promote: true
 plugin :validation
 plugin :validation_helpers

 s3_public = { 
  bucket: ENV['S3_BUCKET_NAME_PUBLIC'],
  region: ENV['AWS_REGION'],
  access_key_id: ENV['AWS_ACCESS_KEY_ID'],
  secret_access_key: ENV['AWS_SECRET_ACCESS_KEY']
 }

 self.storages = { 
  cache: Shrine::Storage::S3.new(prefix: "cache", **s3_public), 
  store: Shrine::Storage::S3.new(public: true, upload_options: { acl: "public-read"}, **s3_public),
  }
 end

 ##imagine s3_private and storages are here too

 Attacher.validate do
  validate_max_size 10.megabytes, message: 'must be smaller than 10MB'
  validate_mime_type %w[image/jpeg image/png]
  validate_extension %w[jpg jpeg png]
 end

 Attacher.derivatives do |original|
  magick = ImageProcessing::MiniMagick.source(original)
  {
   small: magick.resize_and_pad!(225, 220),
   medium: magick.resize_to_limit!(1000, 1000)
  }
 end
end

i could do this:

Shrine.plugin :upload_options, store: -> (io, derivative: nil, **) do
  if derivative == :thumb
    { acl: "public-read" }
  else
    { acl: "private" }
  end
end

but i don’t want to base it on derivative, i want to base it on the model association