campact_user_service 4.0.0 → 4.1.0
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 +4 -4
- data/.ruby-version +1 -1
- data/VERSION +1 -1
- data/campact_user_service.gemspec +2 -2
- data/example.rb +3 -3
- data/lib/campact_user_service/account.rb +1 -0
- data/lib/campact_user_service/session.rb +2 -2
- data/lib/campact_user_service.rb +2 -2
- data/spec/campact_user_service_spec.rb +3 -3
- data/spec/session_spec.rb +3 -3
- 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: c7d69602148b8b3df344f8f4b744a5049308aa53b859ea93713c2f575f78b0fd
|
4
|
+
data.tar.gz: bd7747db8047a234d01b9fae9b96756ab29b410be0ae23e0e3739faa5a119b5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27385e2c3d2db0d9727681a2f44521cdee6f719868281d2b29e492c555aae41fcf226ca55ab89fea7f4de3194cb646905937dbdd50da0d4a26c9809d40225ea5
|
7
|
+
data.tar.gz: 6eadea906f3d3e0055bd7cda88878850e32b403be3f27438d064b811c5771e61b2473aebeb715787e7276be1e3280dced8c237bfd9d214eef9aed77d15cbd00e
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.1.0
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: campact_user_service 4.
|
5
|
+
# stub: campact_user_service 4.1.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "campact_user_service".freeze
|
9
|
-
s.version = "4.
|
9
|
+
s.version = "4.1.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
data/example.rb
CHANGED
@@ -62,10 +62,10 @@ when '1'
|
|
62
62
|
}
|
63
63
|
)
|
64
64
|
when '2'
|
65
|
-
puts "I'll need a user ID
|
66
|
-
|
65
|
+
puts "I'll need a user account ID. In practice I won't need this here because it can be derived through the session token"
|
66
|
+
external_account_id = gets.chomp
|
67
67
|
account = CampactUserService.account(
|
68
|
-
|
68
|
+
external_account_id,
|
69
69
|
{
|
70
70
|
host: 'weact-adapter.staging.campact.de',
|
71
71
|
topt_authorization: {user: username, secret: secret}
|
data/lib/campact_user_service.rb
CHANGED
@@ -9,9 +9,9 @@ module CampactUserService
|
|
9
9
|
CampactUserService::Session.new(client, session_id, session_cookie_name)
|
10
10
|
end
|
11
11
|
|
12
|
-
def account(
|
12
|
+
def account(external_account_id, options)
|
13
13
|
client = CampactUserService::Client.new(options)
|
14
|
-
CampactUserService::Account.new(client,
|
14
|
+
CampactUserService::Account.new(client, external_account_id)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -24,11 +24,11 @@ describe CampactUserService do
|
|
24
24
|
options = { foo: 'bar', foo2: 'bar2' }
|
25
25
|
client = double
|
26
26
|
expect(CampactUserService::Client).to receive(:new).with(options).and_return(client)
|
27
|
-
|
27
|
+
external_account_id = '189b6864-d58a-4f49-8370-4ae0b854a40e'
|
28
28
|
account_api = double
|
29
|
-
expect(CampactUserService::Account).to receive(:new).with(client,
|
29
|
+
expect(CampactUserService::Account).to receive(:new).with(client, external_account_id).and_return(account_api)
|
30
30
|
|
31
|
-
account = subject.account(
|
31
|
+
account = subject.account(external_account_id, options)
|
32
32
|
|
33
33
|
expect(account).to be(account_api)
|
34
34
|
end
|
data/spec/session_spec.rb
CHANGED
@@ -7,13 +7,13 @@ describe CampactUserService::Session do
|
|
7
7
|
|
8
8
|
subject { CampactUserService::Session.new(client, session_id, session_cookie_name) }
|
9
9
|
|
10
|
-
describe '#
|
10
|
+
describe '#external_user_id' do
|
11
11
|
it 'should be present' do
|
12
12
|
stub_request(:get, 'https://test.com/v1/sessions')
|
13
13
|
.with(headers: {'Cookie' => "cus-session=#{session_id};"})
|
14
|
-
.to_return(body: {
|
14
|
+
.to_return(body: {external_user_id: '189b6864-d58a-4f49-8370-4ae0b854a40e'}.to_json)
|
15
15
|
|
16
|
-
expect(subject.
|
16
|
+
expect(subject.external_user_id).to eq('189b6864-d58a-4f49-8370-4ae0b854a40e')
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: campact_user_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ControlShift
|
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
252
|
- !ruby/object:Gem::Version
|
253
253
|
version: '0'
|
254
254
|
requirements: []
|
255
|
-
rubygems_version: 3.
|
255
|
+
rubygems_version: 3.2.32
|
256
256
|
signing_key:
|
257
257
|
specification_version: 4
|
258
258
|
summary: Ruby wrapper for Campact User Service
|