atlas_rb 0.0.70 → 0.0.72

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: b2392f2625ba76eb3873b4caba26094903d50c47887c254e852756ab2bcf3d76
4
- data.tar.gz: dd6bf0fa874683b1836578ece439ed17241956b48d4fb4cf907cb5eb7f3a1b27
3
+ metadata.gz: a3382b898395c5e6b155eef5f113595105fe32b55e9389adc6a037172d3e99d2
4
+ data.tar.gz: f30c564a16b4c916beea13f633fa40046cd14c6ce7072a6d15fba483a090f955
5
5
  SHA512:
6
- metadata.gz: 7c7f80d9e6f3f8370c1466d3bfe0c3d13351ca17c63b038905728c73e0747e2d3885a415096d2db7a9381e8cd15fea8ed615591a90b8a52676ae1e9bcd553f27
7
- data.tar.gz: 90c3dc140848add9e6b74018b384982daabf96eacc053dbed9aa9b020ff631d3edaf4286cf74df6288b55d6675cee19e2cb3bf5979bf4c7c163f8bd16fa8c151
6
+ metadata.gz: 0ff63ca9167c2ba81665d96a00833b99fc47bf1b4c114e5d9ca5dfebc5b6a15b903e6c6f270681beebecddc932b40b60da4ef305047378639044b2559edb325b
7
+ data.tar.gz: 970d9b193fe51f5f41d745492cb89b10866a19cef0731431d7cda63eda8e8625c663d6f4917e1daa2592be391b3ddbee69829da926126335f92b5e9767c15be7
data/.version CHANGED
@@ -1 +1 @@
1
- 0.0.70
1
+ 0.0.72
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (0.0.70)
4
+ atlas_rb (0.0.72)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -10,21 +10,21 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  diff-lcs (1.6.1)
13
- faraday (2.13.1)
13
+ faraday (2.14.0)
14
14
  faraday-net_http (>= 2.0, < 3.5)
15
15
  json
16
16
  logger
17
17
  faraday-follow_redirects (0.3.0)
18
18
  faraday (>= 1, < 3)
19
- faraday-multipart (1.1.0)
19
+ faraday-multipart (1.1.1)
20
20
  multipart-post (~> 2.0)
21
- faraday-net_http (3.4.0)
22
- net-http (>= 0.5.0)
23
- json (2.12.0)
21
+ faraday-net_http (3.4.2)
22
+ net-http (~> 0.5)
23
+ json (2.16.0)
24
24
  logger (1.7.0)
25
25
  multipart-post (2.4.1)
26
- net-http (0.6.0)
27
- uri
26
+ net-http (0.8.0)
27
+ uri (>= 0.11.1)
28
28
  rake (13.2.1)
29
29
  rspec (3.13.0)
30
30
  rspec-core (~> 3.13.0)
@@ -39,7 +39,7 @@ GEM
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.13.0)
41
41
  rspec-support (3.13.3)
42
- uri (1.0.3)
42
+ uri (1.1.1)
43
43
 
44
44
  PLATFORMS
45
45
  x86_64-linux
@@ -5,12 +5,17 @@ module AtlasRb
5
5
  extend AtlasRb::FaradayHelper
6
6
 
7
7
  def self.login(nuid)
8
- JSON.parse(connection({ nuid: nuid }).post('/token')&.body)["token"]
8
+ # JSON.parse(connection({ nuid: nuid }).post('/token')&.body)["token"]
9
+ # need hash - id, name, token => ...
10
+ JSON.parse(connection({}, nuid).get('/user')&.body)
9
11
  end
10
12
 
11
13
  def self.groups(nuid)
12
- token = login(nuid)
13
- # TODO
14
+ # user_details = login(nuid)
15
+ # token = user_details[:token] ...
16
+ # TODO - need to update atlas login to give back name, id, and token upon logging in
17
+ # result = JSON.parse(connection({ token: token }).post('/users/2/groups')&.body)["user"]["groups"]
18
+ JSON.parse(connection({}, nuid).get('/user')&.body)["groups"]
14
19
  end
15
20
  end
16
21
  end
@@ -2,19 +2,29 @@
2
2
 
3
3
  module AtlasRb
4
4
  module FaradayHelper
5
- def connection(params)
5
+ def connection(params, nuid=nil)
6
6
  Faraday.new(
7
7
  url: ENV.fetch("ATLAS_URL", nil),
8
8
  params: params,
9
- headers: { "Content-Type" => "application/json" }
9
+ headers: {
10
+ "Content-Type" => "application/json",
11
+ "Authorization" => "Bearer vK6LgnPNq2tUWy8UrPwU",
12
+ "User" => "NUID #{nuid}"
13
+ }
10
14
  ) do |f|
11
15
  f.response :follow_redirects
12
16
  f.adapter Faraday.default_adapter
13
17
  end
14
18
  end
15
19
 
16
- def multipart(_params)
17
- Faraday.new(url: ENV.fetch("ATLAS_URL", nil)) do |f|
20
+ def multipart(_params, nuid=nil)
21
+ Faraday.new(
22
+ url: ENV.fetch("ATLAS_URL", nil),
23
+ headers: {
24
+ "Authorization" => "Bearer vK6LgnPNq2tUWy8UrPwU",
25
+ "User" => "NUID #{nuid}"
26
+ }
27
+ ) do |f|
18
28
  f.request :multipart
19
29
  f.request :url_encoded
20
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.70
4
+ version: 0.0.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-13 00:00:00.000000000 Z
11
+ date: 2025-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday