atlas_rb 1.6.4 → 1.6.6

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/lib/atlas_rb/person.rb +47 -14
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c1b8b2ec2ef5cadfe63ee85f618f8ef0ce394e9d7cc49637750250594ecd414
4
- data.tar.gz: d59e9ac145408d33e00ddcc89f92cee6126b32e5c1959467a042080f14f49bb6
3
+ metadata.gz: 73faf0ef6535c48fc4e56f6aead845d9110cd9cc41966a8fc336d397840040b0
4
+ data.tar.gz: 36ad840afae41129b06fafd5b4957502d9264800dc27b3998e36dfaa6d3c1a4a
5
5
  SHA512:
6
- metadata.gz: 42992114ad5685f700294dd0f52d5c55507182d4ae0f907a2077c35a534cb7e8052a5d4a7a266f435ae1964341ca15d28c85688e8ff559ff60eb067c48994a7d
7
- data.tar.gz: dc7a7df1a1fba8e4766a47c648c37f85a99244d105ebe6f564f09953fcda29837b111f41e730e871ca20afd032ed9db46dfe7dcd64e41badc550816d8c66f56e
6
+ metadata.gz: 830fc91838b5aaa0a6faa92f040657caa59aa5da3b304c251faf5966cea78807b045af0299220378a0a5c8214c88e8aad335c0aa98f9ff0ec8148204d36bb6a9
7
+ data.tar.gz: be1b28b4473fe3761c9d99f00e7138b9bb7ef7445bf62b58d990d94b9b34627434e5a72b4d9cfe9bb4666f0a5c1ec0a95a4a9f6d795aea97078b7b2bf8aa3ede
data/.version CHANGED
@@ -1 +1 @@
1
- 1.6.4
1
+ 1.6.6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atlas_rb (1.6.4)
4
+ atlas_rb (1.6.6)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -5,39 +5,72 @@ module AtlasRb
5
5
  # directory. A Person correlates the several `users` rows that share a NUID
6
6
  # and carries the authoritative, librarian-editable `display_name` (the SSO
7
7
  # `users.name` is frequently wrong and is clobbered on every login), plus
8
- # community affiliations.
8
+ # community affiliations and a stable **personal-root Collection**.
9
9
  #
10
- # Addressed by NUID, not NOID — the NUID is the correlation key consumers
11
- # hold. So the positional `id` argument below is the person's **NUID**, and
12
- # the `nuid:` / `on_behalf_of:` keywords keep their usual gem meaning (the
13
- # acting principal). The one exception is {.create}, whose `nuid:` keyword is
14
- # the *new person's* NUID (matching the gap's signature); the acting principal
15
- # there comes from the ambient `AtlasRb.config.default_nuid`.
10
+ # The returned Mash carries `personal_root_id` — the **NOID** of that personal
11
+ # root, the structural parent the weighted-deposit publish conduit writes the
12
+ # person's own Works under (then linked into a community showcase via
13
+ # {Work.add_linked_member}). Atlas mints it eagerly at create, so it is always
14
+ # present on a Person; read it straight off the resolve/find Mash, e.g.
15
+ # `AtlasRb::Work.create(person["personal_root_id"], depositor: person["nuid"])`.
16
+ #
17
+ # Addressed by **NOID** (like Work/Collection) — the staff-facing NUID is kept
18
+ # server-side and never put in a public URL. So the positional `id` argument
19
+ # below is the person's **NOID**, and the `nuid:` / `on_behalf_of:` keywords
20
+ # keep their usual gem meaning (the acting principal). NUID stays the key only
21
+ # for {.create} (one Person per NUID — and there `nuid:` is the *new person's*
22
+ # NUID, acting principal coming from the ambient `AtlasRb.config.default_nuid`)
23
+ # and {.resolve} (the server-side name-resolution batch). {.list} is the
24
+ # NOID-keyed People-index source.
16
25
  #
17
26
  # Create / update / affiliation writes are :system + admin on the server; a
18
27
  # non-privileged caller gets a 403.
19
28
  class Person < Resource
20
29
  ROUTE = "/people/"
21
30
 
22
- # Fetch a Person by NUID.
31
+ # Fetch a Person by NOID.
23
32
  #
24
- # @param id [String] the person's NUID.
33
+ # @param id [String] the person's NOID.
25
34
  # @param nuid [String, nil] acting principal (signed into the assertion sub).
26
35
  # @param on_behalf_of [String, nil] acting-as target.
27
- # @return [AtlasRb::Mash] the unwrapped `"person"` object.
36
+ # @return [AtlasRb::Mash] the unwrapped `"person"` object (carries the
37
+ # server-side `nuid` for callers that need it, e.g. depositor gating, and
38
+ # `personal_root_id` for the publish-conduit parent).
28
39
  def self.find(id, nuid: nil, on_behalf_of: nil)
29
40
  AtlasRb::Mash.new(JSON.parse(
30
41
  connection({}, nuid, on_behalf_of: on_behalf_of).get(ROUTE + id)&.body
31
42
  ))["person"]
32
43
  end
33
44
 
45
+ # List people — the NOID-keyed People-index source. Returns the page's
46
+ # Persons (each with `noid`, `display_name`, the server-side `nuid`, and
47
+ # `personal_root_id`), so a consumer builds the index and profiles entirely
48
+ # through atlas_rb without
49
+ # routing People through the catalog/Solr or exposing a NUID publicly.
50
+ #
51
+ # @param page [Integer, nil] 1-based page (server default when nil).
52
+ # @param per_page [Integer, nil] page size (server default when nil; capped
53
+ # server-side).
54
+ # @param nuid [String, nil] acting principal.
55
+ # @param on_behalf_of [String, nil] acting-as target.
56
+ # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per row on the page.
57
+ def self.list(page: nil, per_page: nil, nuid: nil, on_behalf_of: nil)
58
+ params = { page: page, per_page: per_page }.compact
59
+ JSON.parse(
60
+ connection(params, nuid, on_behalf_of: on_behalf_of).get(ROUTE)&.body
61
+ )["people"].map { |entry| AtlasRb::Mash.new(entry["person"]) }
62
+ end
63
+
34
64
  # Batch-resolve people to their authoritative display_name in one call
35
65
  # (supersedes the SSO users directory's resolve). Unresolved NUIDs drop.
66
+ # The deposit fork reads `affiliated_community_ids` and `personal_root_id`
67
+ # off the same resolve Mash it already makes for the depositor's Person.
36
68
  #
37
69
  # @param nuids [Array<String>] the NUIDs to resolve.
38
70
  # @param nuid [String, nil] acting principal.
39
71
  # @param on_behalf_of [String, nil] acting-as target.
40
- # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per resolved NUID.
72
+ # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per resolved NUID
73
+ # (each carries `nuid`, `affiliated_community_ids`, and `personal_root_id`).
41
74
  def self.resolve(nuids, nuid: nil, on_behalf_of: nil)
42
75
  JSON.parse(
43
76
  connection({ nuids: Array(nuids).join(",") }, nuid, on_behalf_of: on_behalf_of).get(ROUTE)&.body
@@ -64,7 +97,7 @@ module AtlasRb
64
97
  # Edit a Person's authority fields. NUID is immutable and not patchable.
65
98
  # Only supplied fields are changed.
66
99
  #
67
- # @param id [String] the person's NUID.
100
+ # @param id [String] the person's NOID.
68
101
  # @param display_name [String, nil]
69
102
  # @param bio [String, nil]
70
103
  # @param orcid [String, nil]
@@ -81,7 +114,7 @@ module AtlasRb
81
114
 
82
115
  # Add a community affiliation (idempotent; audited server-side).
83
116
  #
84
- # @param id [String] the person's NUID.
117
+ # @param id [String] the person's NOID.
85
118
  # @param community_id [String] the community's NOID.
86
119
  # @param nuid [String, nil] acting principal.
87
120
  # @param on_behalf_of [String, nil] acting-as target.
@@ -96,7 +129,7 @@ module AtlasRb
96
129
 
97
130
  # Remove a community affiliation (tolerant; audited server-side).
98
131
  #
99
- # @param id [String] the person's NUID.
132
+ # @param id [String] the person's NOID.
100
133
  # @param community_id [String] the community's NOID.
101
134
  # @param nuid [String, nil] acting principal.
102
135
  # @param on_behalf_of [String, nil] acting-as target.
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: 1.6.4
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-18 00:00:00.000000000 Z
11
+ date: 2026-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday