satz 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/.gems +1 -0
  3. data/CHANGELOG +4 -0
  4. data/lib/satz.rb +3 -10
  5. data/satz.gemspec +2 -1
  6. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ba6203a799d30cfc19fdfb62d9643ab03517cd3
4
- data.tar.gz: da7e27d5c3ef917ef35c6ddce5af6227c62c2526
3
+ metadata.gz: 527d7619ab15c936ca0bdf194f1a26c039df1308
4
+ data.tar.gz: 052df45b1c3496cef2af07ef95e2a5a1f2d78b09
5
5
  SHA512:
6
- metadata.gz: 248f6c91f6f02e76673a5b97efdfcd2cbfa474292d96b442b451e2ec71a3b405adcf79ece53e272e9839a7827419c2baad91b96dae65330207a363734f7fa6fc
7
- data.tar.gz: 416d6b5fbcead7d508152ccc152c590c4acad7a5175087fc5eb1dad83060b77553b08419f10196b2992d3a8924532b582ef8e22a75ad2d7493c923e0b31ec6de
6
+ metadata.gz: 9c9bd5c8d92e1cc753943f2f7f564c64073dc72eff7e51360e84270169958ea3df45371b343da4267e8644fb5782674bf50d1a46d8c1e960276451654593669d
7
+ data.tar.gz: 387a0f85f1130dcc26109061b407830d6315a796c8dfa6d01a9a705f91da42c5457ce552b38603f12133647a297f020c073237119c13b511fdb373df01b31c00
data/.gems CHANGED
@@ -1,2 +1,3 @@
1
1
  syro -v 2.0.0
2
2
  rack-test -v 0.6.3
3
+ basica -v 1.0.0
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.0.3
2
+
3
+ * Update homepage URL in gemspec
4
+
1
5
  0.0.2
2
6
 
3
7
  * Add customizable serializer
@@ -22,7 +22,7 @@
22
22
 
23
23
  require "syro"
24
24
  require "json"
25
- require "base64"
25
+ require "basica"
26
26
 
27
27
  class Satz
28
28
 
@@ -56,7 +56,7 @@ class Satz
56
56
  end
57
57
 
58
58
  class Deck < Syro::Deck
59
- HTTP_AUTHORIZATION = "HTTP_AUTHORIZATION".freeze
59
+ include Basica
60
60
 
61
61
  # Checks the Basic Auth headers and yields
62
62
  # user and pass if credentials are provided.
@@ -75,14 +75,7 @@ class Satz
75
75
  # end
76
76
  #
77
77
  def auth
78
- http_auth = env.fetch(HTTP_AUTHORIZATION) do
79
- return nil
80
- end
81
-
82
- cred = http_auth.split(" ")[1]
83
- user, pass = Base64.decode64(cred).split(":")
84
-
85
- yield(user, pass) || nil
78
+ basic_auth(env) { |user, pass| yield(user, pass) }
86
79
  end
87
80
 
88
81
  # Respond by default with JSON. The default charset
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "satz"
3
- s.version = "0.0.3"
3
+ s.version = "0.0.4"
4
4
  s.summary = "Framework for JSON microservices"
5
5
  s.description = "Framework for JSON microservices"
6
6
  s.authors = ["Michel Martens"]
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files`.split("\n")
12
12
 
13
13
  s.add_dependency "syro", "~> 2.0"
14
+ s.add_dependency "basica", "~> 1.0"
14
15
  s.add_development_dependency "cutest"
15
16
  s.add_development_dependency "rack-test"
16
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: satz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-05 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: syro
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: basica
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: cutest
29
43
  requirement: !ruby/object:Gem::Requirement