passfort 0.3.0 → 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/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/passfort/client.rb +2 -2
- data/lib/passfort/http.rb +5 -2
- data/lib/passfort/version.rb +1 -1
- data/spec/passfort/http_spec.rb +28 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6895fae5e18a47206f33b537029a9b9ada673f0dc2c707bcc3eb041e2b054746
|
4
|
+
data.tar.gz: 60682b4845fd07a3cf4b9f009a9362f0cff7f1d6825ee94f6e4de31ddb99ecca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2484850489eb6035f75e64e1baa608c2c1a6d75677ffbcbf2a2998c0face9cffacdd6631c3079da8aa4f76d68047ad79799b7a5844bcf4fd7066dda85094d83
|
7
|
+
data.tar.gz: a6b4fe95090fda50ec1fe4022383e5ac6c62bcba55d4e5ecfe03de381658c4fb98febc30adb0d42d7b2a5ce03a519748b11e57bc549b363e865721125ea771d0
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/passfort/client.rb
CHANGED
data/lib/passfort/http.rb
CHANGED
@@ -9,9 +9,12 @@ module Passfort
|
|
9
9
|
DOMAIN = "https://api.passfort.com"
|
10
10
|
ROOT_PATH = "/4.0"
|
11
11
|
|
12
|
-
|
12
|
+
attr_reader :api_key, :connection
|
13
|
+
|
14
|
+
def initialize(api_key, excon_opts = {})
|
13
15
|
@api_key = api_key
|
14
|
-
|
16
|
+
uri = excon_opts[:domain] || DOMAIN
|
17
|
+
@connection = Excon.new(uri, excon_opts.except(:domain))
|
15
18
|
end
|
16
19
|
|
17
20
|
def get(path)
|
data/lib/passfort/version.rb
CHANGED
data/spec/passfort/http_spec.rb
CHANGED
@@ -110,6 +110,34 @@ RSpec.describe Passfort::Http do
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
+
describe "#initialize" do
|
114
|
+
describe "with an API key" do
|
115
|
+
it "sets the .api_key" do
|
116
|
+
expect(http.api_key).to eq("api_key")
|
117
|
+
end
|
118
|
+
|
119
|
+
it "sets a default endpoint" do
|
120
|
+
expect(described_class::DOMAIN).to include(http.connection.data[:hostname])
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
it "accepts an alternate endpoint" do
|
125
|
+
example_endpoint = "https://example.net"
|
126
|
+
client = described_class.new("api_key", "domain": example_endpoint)
|
127
|
+
expect(example_endpoint).to include(client.connection.data[:hostname])
|
128
|
+
end
|
129
|
+
|
130
|
+
it "supports setting open_timeout" do
|
131
|
+
http = described_class.new("api_key", "open_timeout": 1)
|
132
|
+
expect(http.connection.data[:open_timeout]).to eq(1)
|
133
|
+
end
|
134
|
+
|
135
|
+
it "supports setting read_timeout" do
|
136
|
+
http = described_class.new("api_key", "read_timeout": 2)
|
137
|
+
expect(http.connection.data[:read_timeout]).to eq(2)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
113
141
|
describe "#get" do
|
114
142
|
subject { -> { http.get(path) } }
|
115
143
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passfort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|