klaro-client 0.5.4 → 0.5.5

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: 861ca7e05a88b52d1a475a351a120f428d91ac21caacfbc06e12e5c6a9f84bc2
4
- data.tar.gz: 20d95370861307e0d5534fb698af187cb41882914962baeb99c478a1049881b3
3
+ metadata.gz: b5254e23cef2ad85ee5aad4c5bcdd4a4171ee31e15553b5fca1707b659fd2546
4
+ data.tar.gz: ef6d17c7c3d7f9aad73c594f2fb1368078165e7be179dae4daf578c7b1310d7a
5
5
  SHA512:
6
- metadata.gz: 28aee1dbfff5699f51493402a05c1bc7e973ea13912d8919b5719682e7cd904bffed37a72480b1179bb65df55f6ce47c7315440aa098971fb937b6f65c22d7be
7
- data.tar.gz: 7a9fb6bb70ddac52bfcdb1c424f7287c6fbf86adb6f6635cdba1ad1ce20f787bd2dfe493d54d5daa8f0c46a81a53494dc06e70297d11a07fd9c780edbb332bcd
6
+ metadata.gz: 0ab49ef56322aff2111b1c80e16cb83850da811704a4f61cea4441b337d873bef9dedefdf4df9f8e9f11073d250b08ea029656c318122383c4adfde8f13c7db6
7
+ data.tar.gz: 55f9d63ca3ae7afb22622e0354046f9b87e00723e33b40de52fa0da521108985a0ca90bebac59b2d22c0219ba10d82884cfd2aa56ef072e8ab6336999427f2a1
@@ -9,6 +9,7 @@ module Klaro
9
9
  @base_url = url.gsub(/\/api\/?$/, "")
10
10
  @token = nil
11
11
  @subdomain = nil
12
+ @workspace = nil
12
13
  end
13
14
 
14
15
  def authenticated?
@@ -25,12 +26,15 @@ module Klaro
25
26
  self
26
27
  end
27
28
 
28
- def authenticate(user, password)
29
- @token = get_token Http
30
- .headers({
31
- 'Content-Type' => 'application/json'
32
- })
33
- .post("#{base_url}/api/auth/tokens/", payload(user, password))
29
+ def authenticate(user, password, workspace = nil)
30
+ @workspace = workspace
31
+ @token = get_token(
32
+ Http
33
+ .headers({
34
+ 'Content-Type' => 'application/json'
35
+ })
36
+ .post("#{base_url}/api/auth/tokens/", payload(user, password))
37
+ )
34
38
  end
35
39
 
36
40
  def get(endpoint, raw = false)
@@ -80,6 +84,7 @@ module Klaro
80
84
  "Content-Type" => "application/json"
81
85
  }
82
86
  hs['Klaro-Project-Subdomain'] = @subdomain if @subdomain
87
+ hs['X-Klaro-ViewAs'] = @workspace if @workspace
83
88
  hs
84
89
  end
85
90
 
@@ -3,7 +3,7 @@ module Klaro
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 5
6
- TINY = 4
6
+ TINY = 5
7
7
  end
8
8
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
9
9
  end # class Client
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaro-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - enspirit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-09 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv