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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 558b63f52138a71633f121ad7418b8903c7c781bea38c6f17cee3eb3ff168573
4
- data.tar.gz: f031af26c529fadfa0b2a8c0223154fa66624d2630e82c0bf7dd3d9f261ac671
3
+ metadata.gz: c7d69602148b8b3df344f8f4b744a5049308aa53b859ea93713c2f575f78b0fd
4
+ data.tar.gz: bd7747db8047a234d01b9fae9b96756ab29b410be0ae23e0e3739faa5a119b5c
5
5
  SHA512:
6
- metadata.gz: 40e314a23b014f000e2b2039c82e8bb669f640b32dd05731ec0cca583b94867d306da6d7f2e3d3cc97f05a38c84cb39ee7a189a57aca187389c5c4ca30f1f7a2
7
- data.tar.gz: 8b01531c1d7507181cb23fc5518f40f1b7528f1e0d8e9b8a983442806e7e2c608e3d6712706499c4697cb2c0aa678843de6392860a7c59ef3e8c31c56331e84a
6
+ metadata.gz: 27385e2c3d2db0d9727681a2f44521cdee6f719868281d2b29e492c555aae41fcf226ca55ab89fea7f4de3194cb646905937dbdd50da0d4a26c9809d40225ea5
7
+ data.tar.gz: 6eadea906f3d3e0055bd7cda88878850e32b403be3f27438d064b811c5771e61b2473aebeb715787e7276be1e3280dced8c237bfd9d214eef9aed77d15cbd00e
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.5
1
+ 3.0.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0
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.0.0 ruby lib
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.0.0"
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 (email address). In practice I won't need this here because it can be derived through the session token"
66
- user_id = gets.chomp
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
- user_id,
68
+ external_account_id,
69
69
  {
70
70
  host: 'weact-adapter.staging.campact.de',
71
71
  topt_authorization: {user: username, secret: secret}
@@ -2,6 +2,7 @@ module CampactUserService
2
2
  class Account
3
3
  attr_reader :client, :user_id
4
4
 
5
+ # user_id can either be the user's external_account_id or their email address
5
6
  def initialize(client, user_id)
6
7
  @client = client
7
8
  @user_id = user_id
@@ -8,8 +8,8 @@ module CampactUserService
8
8
  @session_cookie_name = session_cookie_name
9
9
  end
10
10
 
11
- def user_id
12
- session["user_id"]
11
+ def external_user_id
12
+ session["external_user_id"]
13
13
  end
14
14
 
15
15
  def has_soft_login_session?
@@ -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(user_id, options)
12
+ def account(external_account_id, options)
13
13
  client = CampactUserService::Client.new(options)
14
- CampactUserService::Account.new(client, user_id)
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
- user_id = 'test@example.com'
27
+ external_account_id = '189b6864-d58a-4f49-8370-4ae0b854a40e'
28
28
  account_api = double
29
- expect(CampactUserService::Account).to receive(:new).with(client, user_id).and_return(account_api)
29
+ expect(CampactUserService::Account).to receive(:new).with(client, external_account_id).and_return(account_api)
30
30
 
31
- account = subject.account(user_id, options)
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 '#user_id' do
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: {user_id: 'user@example.org'}.to_json)
14
+ .to_return(body: {external_user_id: '189b6864-d58a-4f49-8370-4ae0b854a40e'}.to_json)
15
15
 
16
- expect(subject.user_id).to eq('user@example.org')
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.0.0
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.1.6
255
+ rubygems_version: 3.2.32
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: Ruby wrapper for Campact User Service