Skip to content

URL ID filter, error logging, and API key redaction#12

Merged
amorgan-atlas-sys merged 2 commits into
mainfrom
feature/36146/SupportMmisIdInUrl
May 13, 2026
Merged

URL ID filter, error logging, and API key redaction#12
amorgan-atlas-sys merged 2 commits into
mainfrom
feature/36146/SupportMmisIdInUrl

Conversation

@amorgan-atlas-sys
Copy link
Copy Markdown
Collaborator

  • ExtractIds: apply MMS/IE prefix filter (^99 / ^[125]1) to the URL match so non-ID values in the docid parameter are rejected.
  • WebClient: add GetWebExceptionMessage helper to surface HTTP error details (status + Alma's XML error body) instead of swallowing them.
  • WebClient: redact the configured Alma API key from logged URLs and exception bodies; key is set via WebClient.Initialize and hidden in a module-local.
  • AlmaApi: introduce Initialize(apiUrl, apiKey) as the single setup entry point; propagates the key to WebClient.Initialize.
  • Add nil-guards for failed Alma responses in ConvertIeIdsToMmsIds, RetrieveItems, and RetrieveItemsList so a failed call logs and skips instead of crashing the form.

- ExtractIds: apply MMS/IE prefix filter (^99 / ^[125]1) to the URL match
  so non-ID values in the docid parameter are rejected.
- WebClient: add GetWebExceptionMessage helper to surface HTTP error
  details (status + Alma's XML error body) instead of swallowing them.
- WebClient: redact the configured Alma API key from logged URLs and
  exception bodies; key is set via WebClient.Initialize and hidden in a
  module-local.
- AlmaApi: introduce Initialize(apiUrl, apiKey) as the single setup
  entry point; propagates the key to WebClient.Initialize.
- Add nil-guards for failed Alma responses in ConvertIeIdsToMmsIds,
  RetrieveItems, and RetrieveItemsList so a failed call logs and skips
  instead of crashing the form.
…ion, expand changelog

- WebClient: include response body in the message returned by
  GetWebExceptionMessage so Alma's XML error payload surfaces at Error
  level (previously only logged at Debug). Drop the now-redundant Debug
  log. Comment the luanet "Response" string-name quirk so future
  maintainers don't read it as dead code.
- AlmaApi: log mid-pagination failures at Error with partial-vs-total
  counts. Returning the accumulated xmlResult is intentional (degrade
  rather than crash), but it leaves total_record_count overstated, so
  the truncation now shows up clearly in logs. Offset 0 stays Warn.
- README: expand 2.0.1 notes to cover API-key redaction and improved
  HTTP error logging alongside the URL ID filter.
@amorgan-atlas-sys amorgan-atlas-sys merged commit b4242e8 into main May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants