lsst-git-lfs-s3 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 9792c8954d97f23a8b1eae95b19b01e4fc3c9a96
4
- data.tar.gz: 0ace97ee10f3c4d70381362f88000d5db1af954b
3
+ metadata.gz: 5ba5d40163f92542e7c934d5a755911f769d7903
4
+ data.tar.gz: f77dd021ea75fc075007f80ad009c547f68956db
5
5
  SHA512:
6
- metadata.gz: ad1782fb03251892b1fd3c99da75e8ed6eaf8168bdd307b7963ac0197ba46d51dc92f5c9d8e57653396cb5f2fdcd7f359dfc99f4ed6b3bbe430ce12c5d385b9a
7
- data.tar.gz: 18e923be9a8de7d3ebade1a28000cef67aa832685109408507a4c392a4d069668ac543e58db2dd5c4407ceefe5e6437c1bcb403505e42d725753ba91d2560bf4
6
+ metadata.gz: 56dbf305a4b992ae9919139156aba41d85460bb4bcd2ccc1bbc0a3656f86372edb72cb9de233d20dc810bc0ae849abbcbc96fa40bc5900ec1fe455121cb4f032
7
+ data.tar.gz: 69852595fa41ed2361c2044ec27275719c2185e6b89455c9889306b18c68159198743af93835cc79f16a001eef5a3979c0d8ef7cb518cf696d705384d5b4f9a5
@@ -73,6 +73,13 @@ module GitLfsS3
73
73
  end
74
74
  end
75
75
 
76
+ def public_read_grant
77
+ grantee = Aws::S3::Types::Grantee.new(
78
+ display_name: nil, email_address: nil, id: nil, type: nil,
79
+ uri: "http://acs.amazonaws.com/groups/global/AllUsers")
80
+ Aws::S3::Types::Grant.new(grantee: grantee, permission: "READ")
81
+ end
82
+
76
83
  before do
77
84
  pass if request.safe? and settings.public_server
78
85
  protected!
@@ -86,12 +93,12 @@ module GitLfsS3
86
93
  status service.status
87
94
  body MultiJson.dump(service.response)
88
95
  end
89
-
96
+
90
97
  post '/verify', provides: 'application/vnd.git-lfs+json' do
91
98
  data = MultiJson.load(request.body.tap { |b| b.rewind }.read)
92
99
  object = object_data(data['oid'])
93
100
  if settings.public_server and settings.ceph_s3
94
- if object.exists?
101
+ if object.exists? and not object.acl.grants.include?(public_read_grant)
95
102
  object.acl.put(acl: "public-read")
96
103
  end
97
104
  end
@@ -1,3 +1,3 @@
1
1
  module GitLfsS3
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lsst-git-lfs-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan LeFevre
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-12 00:00:00.000000000 Z
12
+ date: 2015-10-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk