I am having an issue with S3 in IHP, or the IHP plugin for it.
I'm saving files to AWS storage, I get an url back to save in the database, but nothing gets saved in S3. And no error message from IHP.
I have double checked bucket name and region, and access keys is connected to an IAM with AmazonS3FullAccess permissions.
I get 403 forbidden when trying to access signed urls.
Any ideas where things could have gone wrong?
Currently my controller looks like this as I per the docs is instructed to save the whole link, using the createTemporaryDownloadUrlFromPath
won't work, so there are currently some holes in the docs.
action CreateDriverAction = do
let driver = newRecord @Driver
driver
|> buildDriver
|> validateNewDriver
>>= uploadToStorage #licenceBackUrl
>>= pure . validateField #licenceFrontUrl (nonEmpty |> withCustomErrorMessage "Bilde av forsiden på førerkortet er obligatorisk")
>>= pure . validateField #licenceBackUrl (nonEmpty |> withCustomErrorMessage "Bilde av baksiden på førerkortet er obligatorisk")
>>= ifValid \case
Left driver -> do
render NewView{..}
Right driver -> do
hashed <- hashPassword (get #passwordHash driver)
driver <- driver |> set #passwordHash hashed |> createRecord
login driver
redirectToPath "/driver/"