thoas / picfit

An image resizing server written in Go
http://bit.ly/1E7rSoi
MIT License
2.14k stars 177 forks source link

backblaze s3 v4 signing option #142

Closed theromis closed 1 year ago

theromis commented 3 years ago

trying to integrate picfit and backblaze storage, and getting:

The V2 signature authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256

seems like goamz still not support v4 https://github.com/goamz/goamz/pull/118 but I can see workaround discussion https://github.com/cloudflare/complainer/issues/13

does anybody made picfit working with backblaze?

PS: this is my test code

package main

import (
  "github.com/mitchellh/goamz/aws"
  "github.com/mitchellh/goamz/s3"
  "log"
  "fmt"
)

func main() {
  auth, err := aws.EnvAuth()
  fmt.Printf("%#v\n", auth)
  if err != nil {
    log.Fatal(err)
  }
  client := s3.New(auth, aws.USEast)
  client.S3Endpoint = "https://s3.us-west-002.backblazeb2.com"
  fmt.Printf("%#v\n", client)
  resp, err := client.ListBuckets()

  if err != nil {
    log.Fatal(err)
  }

  log.Print(fmt.Sprintf("%T %+v", resp.Buckets[0], resp.Buckets[0]))
}
theromis commented 3 years ago

Sorry, just found, vendor version is outdated and current https://github.com/ulule/gostorages uses github.com/aws/aws-sdk-go/aws is it possible to update it in picfit?

thoas commented 1 year ago

fixed, gostorages has been bumped