atlas_rb 1.6.4 → 1.6.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.
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 +33 -12
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c1b8b2ec2ef5cadfe63ee85f618f8ef0ce394e9d7cc49637750250594ecd414
4
- data.tar.gz: d59e9ac145408d33e00ddcc89f92cee6126b32e5c1959467a042080f14f49bb6
3
+ metadata.gz: 19c01cf68a6a94d94dceff16d5e8ea00e147b8db2c6fd51f8d6c1e9b8ec36fac
4
+ data.tar.gz: 457092385fc63ed58a2c2e871983bfb2a62d2d69448a74c78796d6a6f14506be
5
5
  SHA512:
6
- metadata.gz: 42992114ad5685f700294dd0f52d5c55507182d4ae0f907a2077c35a534cb7e8052a5d4a7a266f435ae1964341ca15d28c85688e8ff559ff60eb067c48994a7d
7
- data.tar.gz: dc7a7df1a1fba8e4766a47c648c37f85a99244d105ebe6f564f09953fcda29837b111f41e730e871ca20afd032ed9db46dfe7dcd64e41badc550816d8c66f56e
6
+ metadata.gz: 2008dd0082b8de90ca4016a8a66c378bc88a6a6cc61b44070d9fcf9c9fd13ed5d21f81787dbd1b0131194b8edbd10eaf4904366c5e496452fd689fe2eedab429
7
+ data.tar.gz: 801b406750972c2dc014c4e202fcb53a2d204e554197c5594015f4dd0c0b60d58839ad6aab8b7c8659399082618483be9bc918543355f06d6a7ad3d125ed7107
data/.version CHANGED
@@ -1 +1 @@
1
- 1.6.4
1
+ 1.6.5
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.5)
5
5
  faraday (~> 2.7)
6
6
  faraday-follow_redirects (~> 0.3.0)
7
7
  faraday-multipart (~> 1)
@@ -7,30 +7,51 @@ module AtlasRb
7
7
  # `users.name` is frequently wrong and is clobbered on every login), plus
8
8
  # community affiliations.
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
+ # Addressed by **NOID** (like Work/Collection) — the staff-facing NUID is kept
11
+ # server-side and never put in a public URL. So the positional `id` argument
12
+ # below is the person's **NOID**, and the `nuid:` / `on_behalf_of:` keywords
13
+ # keep their usual gem meaning (the acting principal). NUID stays the key only
14
+ # for {.create} (one Person per NUID and there `nuid:` is the *new person's*
15
+ # NUID, acting principal coming from the ambient `AtlasRb.config.default_nuid`)
16
+ # and {.resolve} (the server-side name-resolution batch). {.list} is the
17
+ # NOID-keyed People-index source.
16
18
  #
17
19
  # Create / update / affiliation writes are :system + admin on the server; a
18
20
  # non-privileged caller gets a 403.
19
21
  class Person < Resource
20
22
  ROUTE = "/people/"
21
23
 
22
- # Fetch a Person by NUID.
24
+ # Fetch a Person by NOID.
23
25
  #
24
- # @param id [String] the person's NUID.
26
+ # @param id [String] the person's NOID.
25
27
  # @param nuid [String, nil] acting principal (signed into the assertion sub).
26
28
  # @param on_behalf_of [String, nil] acting-as target.
27
- # @return [AtlasRb::Mash] the unwrapped `"person"` object.
29
+ # @return [AtlasRb::Mash] the unwrapped `"person"` object (carries the
30
+ # server-side `nuid` for callers that need it, e.g. depositor gating).
28
31
  def self.find(id, nuid: nil, on_behalf_of: nil)
29
32
  AtlasRb::Mash.new(JSON.parse(
30
33
  connection({}, nuid, on_behalf_of: on_behalf_of).get(ROUTE + id)&.body
31
34
  ))["person"]
32
35
  end
33
36
 
37
+ # List people — the NOID-keyed People-index source. Returns the page's
38
+ # Persons (each with `noid`, `display_name`, and the server-side `nuid`), so
39
+ # a consumer builds the index and profiles entirely through atlas_rb without
40
+ # routing People through the catalog/Solr or exposing a NUID publicly.
41
+ #
42
+ # @param page [Integer, nil] 1-based page (server default when nil).
43
+ # @param per_page [Integer, nil] page size (server default when nil; capped
44
+ # server-side).
45
+ # @param nuid [String, nil] acting principal.
46
+ # @param on_behalf_of [String, nil] acting-as target.
47
+ # @return [Array<AtlasRb::Mash>] one unwrapped `"person"` per row on the page.
48
+ def self.list(page: nil, per_page: nil, nuid: nil, on_behalf_of: nil)
49
+ params = { page: page, per_page: per_page }.compact
50
+ JSON.parse(
51
+ connection(params, nuid, on_behalf_of: on_behalf_of).get(ROUTE)&.body
52
+ )["people"].map { |entry| AtlasRb::Mash.new(entry["person"]) }
53
+ end
54
+
34
55
  # Batch-resolve people to their authoritative display_name in one call
35
56
  # (supersedes the SSO users directory's resolve). Unresolved NUIDs drop.
36
57
  #
@@ -64,7 +85,7 @@ module AtlasRb
64
85
  # Edit a Person's authority fields. NUID is immutable and not patchable.
65
86
  # Only supplied fields are changed.
66
87
  #
67
- # @param id [String] the person's NUID.
88
+ # @param id [String] the person's NOID.
68
89
  # @param display_name [String, nil]
69
90
  # @param bio [String, nil]
70
91
  # @param orcid [String, nil]
@@ -81,7 +102,7 @@ module AtlasRb
81
102
 
82
103
  # Add a community affiliation (idempotent; audited server-side).
83
104
  #
84
- # @param id [String] the person's NUID.
105
+ # @param id [String] the person's NOID.
85
106
  # @param community_id [String] the community's NOID.
86
107
  # @param nuid [String, nil] acting principal.
87
108
  # @param on_behalf_of [String, nil] acting-as target.
@@ -96,7 +117,7 @@ module AtlasRb
96
117
 
97
118
  # Remove a community affiliation (tolerant; audited server-side).
98
119
  #
99
- # @param id [String] the person's NUID.
120
+ # @param id [String] the person's NOID.
100
121
  # @param community_id [String] the community's NOID.
101
122
  # @param nuid [String, nil] acting principal.
102
123
  # @param on_behalf_of [String, nil] acting-as target.
metadata CHANGED
@@ -1,7 +1,7 @@
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cliff