]> source.dussan.org Git - jgit.git/commit
Add protocol configuration to Amazon S3 transport 17/201117/3
authorPat Patterson <pat@superpat.com>
Thu, 6 Apr 2023 15:05:56 +0000 (08:05 -0700)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 13 Apr 2023 12:49:48 +0000 (08:49 -0400)
commite06ce59607d1e8da0d83ae2e36777a6caef0a2e5
treed89f6e1bce7f81d67fd7516e8b7a691693626fd0
parent0e9708803f8f78efbe53b9b19bd568d50b412b50
Add protocol configuration to Amazon S3 transport

Before this change, attempting to use the jgit Amazon S3 transport with an S3-compatible service that requires https (for example, Backblaze B2) results in an error:

$ jgit push b2
fatal: amazon-s3://metadaddy-jgit/repos/test/objects: error in packed-refs

This change adds a "protocol" property to the Amazon S3 transport configuration, defaulting to http, and uses that value when constructing the URL for the S3 service.

Example configuration for Backblaze B2:

accesskey: <Your B2 Application Key>
secretkey: <Your B2 Application Key Id>
acl: private
protocol: https
domain: s3.us-west-004.backblazeb2.com
region: us-west-004
aws.api.signature.version: 4

Behavior after this change:

$ jgit push b2
Counting objects:       3
Finding sources:        100% (3/3)
Getting sizes:          100% (2/2)
Compressing objects:    100% (37/37)
Writing objects:        100% (3/3)
Put pack-673f9bb.idx:   100% (1/1)
To amazon-s3://.jgit_b2@metadaddy-jgit/repos/test
 * [new branch]      main -> main

Change-Id: I03bdbb3510fb81a416c225a720178f42eec41b21
org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java