safettp 0.2.1 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/safettp/http_options.rb +5 -5
- data/lib/safettp/request/net.rb +1 -1
- data/lib/safettp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aacb6665f1ef7a0e355843bc2accae2d4994e4c
|
4
|
+
data.tar.gz: d74f7dfbac3ca4feca94d6ff59848888b12676f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bd9caea86427d62a6ec42cdcb821ab01f835a2a42f85b29a316e587aa64b8e5a307d8b56976b4d32dea6a457bfb7a2bac894ed4f97561940fce7886fc81c8f1
|
7
|
+
data.tar.gz: 15644c03034daa143f7864e2c7c63a4921a1abc6f42ac8795a99c2641f0b927badb1ba966eb1e394873f977e29640580a522c41174dc6a8b4b0621268e1ee8bc
|
data/lib/safettp/http_options.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Safettp::HTTPOptions
|
2
|
-
|
2
|
+
AUTH_TYPES = {
|
3
3
|
none: Safettp::NoneAuthenticator,
|
4
4
|
basic: Safettp::BasicAuthenticator
|
5
5
|
}.freeze
|
@@ -31,9 +31,9 @@ class Safettp::HTTPOptions
|
|
31
31
|
options_hash.fetch(:body, "")
|
32
32
|
end
|
33
33
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
def auth
|
35
|
+
auth_options = options_hash.fetch(:auth, { type: :none })
|
36
|
+
AUTH_TYPES.fetch(auth_options[:type], Safettp::NoneAuthenticator)
|
37
|
+
.new(auth_options)
|
38
38
|
end
|
39
39
|
end
|
data/lib/safettp/request/net.rb
CHANGED
data/lib/safettp/version.rb
CHANGED