lsst-git-lfs-s3 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e8e53b53772ac904e3368fba37ed0bdddc509e8d
4
- data.tar.gz: 10f464ba058e3290fc6b612b0bc736519ac96487
3
+ metadata.gz: ce34070d4f29b61cb8ae793bfdb97044191a2199
4
+ data.tar.gz: 7e14ad0f446ddd192ba519b528b3c709f0c38fa2
5
5
  SHA512:
6
- metadata.gz: 97cba6586c2d3068e5c0fb60adb1a84d2a955a869c10611025a74388eecc9ee1d1057ca68d91cc99b1769c7fd782e9e2e3b32327250a83ab47be25dbbbfd4a38
7
- data.tar.gz: 9b2a1afea4909ff49d2f0143e2f78e79201d70377ab7ab8cdd74ffd6a40dbcc92cb9394dd7b709ca1fd6963df7e7c5ec936a197281b93242ffd385e41f54fd9b
6
+ metadata.gz: 1fbb2b135d1c3c701eb2329d59c5ee7bdfe2779e99e91cfab4ca50c6423f44604ef2d7b7d2e18d5568006f8e0a63b674260e906217df3b246258c5e63be86f27
7
+ data.tar.gz: d53d6da0258db3ceb3181bd2220e4513165b5e21fd6e063b4a957027f907d4baa3b60418412c96e4568b62f3cfc1d48fa38692b0d13133b9f8583fa4ddb7fb80
data/bin/git-lfs-s3 CHANGED
@@ -9,6 +9,7 @@ GitLfsS3::Application.set :aws_access_key_id, ENV['AWS_ACCESS_KEY_ID']
9
9
  GitLfsS3::Application.set :aws_secret_access_key, ENV['AWS_SECRET_ACCESS_KEY']
10
10
  GitLfsS3::Application.set :s3_bucket, ENV['S3_BUCKET']
11
11
  GitLfsS3::Application.set :server_url, ENV['LFS_SERVER_URL']
12
+ GitLfsS3::Application.set :public_server, (ENV['LFS_PUBLIC_SERVER'] == 'true')
12
13
  GitLfsS3::Application.set :logger, Logger.new(STDOUT)
13
14
 
14
15
  GitLfsS3::Application.on_authenticate do |username, password, is_safe|
@@ -36,16 +36,7 @@ module GitLfsS3
36
36
  @auth.credentials[0], @auth.credentials[1], request.safe?
37
37
  )
38
38
  end
39
-
40
- def protected!
41
- unless authorized?
42
- response['WWW-Authenticate'] = %(Basic realm="Restricted Area")
43
- throw(:halt, [401, "Invalid username or password"])
44
- end
45
- end
46
-
47
- before { protected! }
48
-
39
+
49
40
  get '/' do
50
41
  "Git LFS S3 is online."
51
42
  end
@@ -75,6 +66,18 @@ module GitLfsS3
75
66
  body MultiJson.dump({message: 'Object not found'})
76
67
  end
77
68
  end
69
+
70
+ def protected!
71
+ unless authorized?
72
+ response['WWW-Authenticate'] = %(Basic realm="Restricted Area")
73
+ throw(:halt, [401, "Invalid username or password"])
74
+ end
75
+ end
76
+
77
+ before do
78
+ pass if request.safe? and settings.public_server
79
+ protected!
80
+ end
78
81
 
79
82
  post "/objects", provides: 'application/vnd.git-lfs+json' do
80
83
  logger.debug headers.inspect
@@ -1,3 +1,3 @@
1
1
  module GitLfsS3
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
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.1.2
4
+ version: 0.1.3
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-09-14 00:00:00.000000000 Z
12
+ date: 2015-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk