Skip to content

Add reusable auth objects and migrate req_prepare() from auth_fn/auth_args to auth#83

Merged
jonthegeek merged 5 commits into
mainfrom
copilot/add-auth-prepare-function
May 10, 2026
Merged

Add reusable auth objects and migrate req_prepare() from auth_fn/auth_args to auth#83
jonthegeek merged 5 commits into
mainfrom
copilot/add-auth-prepare-function

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

This updates nectar’s authentication setup so auth can be defined independently of a request and reused cleanly. req_prepare() now consumes a single prepared auth object instead of the auth_fn + auth_args pair.

  • New auth constructors

    • Added auth_prepare(auth_fn, ...) to create nectar_auth objects (auth_fn + auth_args).
    • Added auth_api_key(...) as the exported preparer for req_auth_api_key().
  • req_prepare() API migration

    • Replaced auth_fn and auth_args arguments with auth.
    • Added auth object validation and application path (nectar_auth / NULL).
  • Documentation and shared params

    • Updated shared parameter definitions to document auth and remove auth_args.
    • Updated vignette examples from inline auth function wiring to prepared auth usage.
    • Regenerated NAMESPACE and relevant .Rd docs for new exports and signatures.
  • Focused test updates

    • Added tests for auth_prepare() and auth_api_key() object construction.
    • Added req_prepare() tests for applying prepared auth and rejecting unsupported auth objects.
req <- req_prepare(
  "https://api.crossref.org/works",
  query = list(rows = 10, cursor = "*"),
  auth = auth_api_key("mailto", api_key = "your@email.com", location = "query")
)

Copilot AI linked an issue May 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add auth_prepare function for authorization Add reusable auth objects and migrate req_prepare() from auth_fn/auth_args to auth May 9, 2026
Copilot AI requested a review from jonthegeek May 9, 2026 13:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

{qcthat} Report: User Acceptance

No issues are awaiting UAT.

This report was generated by this GitHub Actions run.

Last updated: 2026-05-10 15:59:23 UTC

Session Info ─ Session info ───────────────────────────────────────────────────────────────

setting value

version R version 4.6.0 (2026-04-24)

os Ubuntu 24.04.4 LTS

system x86_64, linux-gnu

ui X11

language (EN)

collate en_US.UTF-8

ctype en_US.UTF-8

tz UTC

date 2026-05-10

pandoc 3.1.3 @ /usr/bin/pandoc

quarto NA

─ Packages ───────────────────────────────────────────────────────────────────

package * version date (UTC) lib source

askpass 1.2.1 2024-10-04 [1] RSPM

astgrepr 0.1.1 2025-06-07 [1] RSPM

backports 1.5.1 2026-04-03 [1] RSPM

base * 4.6.0 2026-04-24 [2] local

base64enc 0.1-6 2026-02-02 [1] RSPM

boot 1.3-32 2025-08-29 [2] CRAN (R 4.6.0)

brew 1.0-10 2023-12-16 [1] RSPM

brio 1.1.5 2024-04-24 [1] RSPM

bslib 0.10.0 2026-01-26 [1] RSPM

cachem 1.1.0 2024-05-16 [1] RSPM

callr 3.7.6 2024-03-25 [1] RSPM

checkmate 2.3.4 2026-02-03 [1] RSPM

class 7.3-23 2025-01-01 [2] CRAN (R 4.6.0)

cli 3.6.6 2026-04-09 [1] RSPM

clipr 0.8.0 2022-02-22 [1] RSPM

cluster 2.1.8.2 2026-02-05 [2] CRAN (R 4.6.0)

codetools 0.2-20 2024-03-31 [2] CRAN (R 4.6.0)

commonmark 2.0.0 2025-07-07 [1] RSPM

compiler 4.6.0 2026-04-24 [2] local

covr 3.6.5 2025-11-09 [1] RSPM

crayon 1.5.3 2024-06-20 [1] RSPM

credentials 2.0.3 2025-09-12 [1] RSPM

curl 7.1.0 2026-04-22 [1] RSPM

datasets * 4.6.0 2026-04-24 [2] local

desc 1.4.3 2023-12-10 [1] RSPM

devtools 2.5.2 2026-04-30 [1] RSPM

diffobj 0.3.6 2025-04-21 [1] RSPM

digest 0.6.39 2025-11-19 [1] RSPM

docopt 0.7.2 2025-03-25 [1] RSPM (R 4.6.0)

downlit 0.4.5 2025-11-14 [1] RSPM

dplyr 1.2.1 2026-04-03 [1] RSPM

ellipsis 0.3.3 2026-04-04 [1] RSPM

emoji 16.0.0 2024-10-28 [1] RSPM

evaluate 1.0.5 2025-08-27 [1] RSPM

fansi 1.0.7 2025-11-19 [1] RSPM

fastmap 1.2.0 2024-05-15 [1] RSPM

fontawesome 0.5.3 2024-11-16 [1] RSPM

foreign 0.8-91 2026-01-29 [2] CRAN (R 4.6.0)

fs 2.1.0 2026-04-18 [1] RSPM

generics 0.1.4 2025-05-09 [1] RSPM

gert 2.3.1 2026-01-11 [1] RSPM

gh 1.5.0 2025-05-26 [1] RSPM

git2r 0.36.2 2025-03-29 [1] RSPM

gitcreds 0.1.2 2022-09-08 [1] RSPM

glue 1.8.1 2026-04-17 [1] RSPM

graphics * 4.6.0 2026-04-24 [2] local

grDevices * 4.6.0 2026-04-24 [2] local

grid 4.6.0 2026-04-24 [2] local

highr 0.12 2026-03-06 [1] RSPM

htmltools 0.5.9 2025-12-04 [1] RSPM

htmlwidgets 1.6.4 2023-12-06 [1] RSPM

httpuv 1.6.17 2026-03-18 [1] RSPM

httr 1.4.8 2026-02-13 [1] RSPM

httr2 1.2.2 2025-12-08 [1] RSPM

ini 0.3.1 2018-05-20 [1] RSPM

jquerylib 0.1.4 2021-04-26 [1] RSPM

jsonlite 2.0.0 2025-03-27 [1] RSPM

KernSmooth 2.23-26 2025-01-01 [2] CRAN (R 4.6.0)

knitr 1.51 2025-12-20 [1] RSPM

later 1.4.8 2026-03-05 [1] RSPM

lattice 0.22-9 2026-02-09 [2] CRAN (R 4.6.0)

lifecycle 1.0.5 2026-01-08 [1] RSPM

littler 0.3.23 2026-04-12 [1] RSPM (R 4.6.0)

magick 2.9.1 2026-02-28 [1] RSPM

magrittr 2.0.5 2026-04-04 [1] RSPM

MASS 7.3-65 2025-02-28 [2] CRAN (R 4.6.0)

Matrix 1.7-5 2026-03-21 [2] CRAN (R 4.6.0)

memoise 2.0.1 2021-11-26 [1] RSPM

methods * 4.6.0 2026-04-24 [2] local

mgcv 1.9-4 2025-11-07 [2] CRAN (R 4.6.0)

mime 0.13 2025-03-17 [1] RSPM

miniUI 0.1.2 2025-04-17 [1] RSPM

nectar 0.0.0.9007 2026-05-10 [1] local

nlme 3.1-169 2026-03-27 [2] CRAN (R 4.6.0)

nnet 7.3-20 2025-01-01 [2] CRAN (R 4.6.0)

openssl 2.4.0 2026-04-15 [1] RSPM

otel 0.2.0 2025-08-29 [1] RSPM

pak 0.9.5 2026-04-27 [1] RSPM (R 4.6.0)

parallel 4.6.0 2026-04-24 [2] local

pillar 1.11.1 2025-09-17 [1] RSPM

pkgbuild 1.4.8 2025-05-26 [1] RSPM

pkgconfig 2.0.3 2019-09-22 [1] RSPM

pkgdown 2.2.0 2025-11-06 [1] RSPM

pkgload 1.5.2 2026-04-22 [1] RSPM

praise 1.0.0 2015-08-11 [1] RSPM

prettyunits 1.2.0 2023-09-24 [1] RSPM

processx 3.9.0 2026-04-22 [1] RSPM

profvis 0.4.0 2024-09-20 [1] RSPM

promises 1.5.0 2025-11-01 [1] RSPM

ps 1.9.3 2026-04-20 [1] RSPM

purrr 1.2.2 2026-04-10 [1] RSPM

qcthat 1.1.2 2026-05-10 [1] Github (Gilead-BioStats/qcthat@d0958dc)

R6 2.6.1 2025-02-15 [1] RSPM

ragg 1.5.2 2026-03-23 [1] RSPM

rappdirs 0.3.4 2026-01-17 [1] RSPM

rcmdcheck 1.4.0 2021-09-27 [1] RSPM

Rcpp 1.1.1-1.1 2026-04-24 [1] RSPM

rex 1.2.2 2026-03-28 [1] RSPM

rlang 1.2.0 2026-04-06 [1] RSPM

rmarkdown 2.31 2026-03-26 [1] RSPM

roxygen2 8.0.0 2026-05-01 [1] RSPM

rpart 4.1.27 2026-03-27 [2] CRAN (R 4.6.0)

rprojroot 2.1.1 2025-08-26 [1] RSPM

rrapply 1.2.8 2025-11-25 [1] RSPM

rstudioapi 0.18.0 2026-01-16 [1] RSPM

rversions 3.0.0 2025-10-09 [1] RSPM

sass 0.4.10 2025-04-11 [1] RSPM

sessioninfo 1.2.3 2025-02-05 [1] RSPM

shiny 1.13.0 2026-02-20 [1] RSPM

sourcetools 0.1.7-2 2026-03-28 [1] RSPM

spatial 7.3-18 2025-01-01 [2] CRAN (R 4.6.0)

splines 4.6.0 2026-04-24 [2] local

stats * 4.6.0 2026-04-24 [2] local

stats4 4.6.0 2026-04-24 [2] local

stbl 0.3.0 2026-04-04 [1] RSPM

stringi 1.8.7 2025-03-27 [1] RSPM

stringr 1.6.0 2025-11-04 [1] RSPM

survival 3.8-6 2026-01-16 [2] CRAN (R 4.6.0)

sys 3.4.3 2024-10-04 [1] RSPM

systemfonts 1.3.2 2026-03-05 [1] RSPM

tcltk 4.6.0 2026-04-24 [2] local

testthat 3.3.2 2026-01-11 [1] RSPM

textshaping 1.0.5 2026-03-06 [1] RSPM

tibble 3.3.1 2026-01-11 [1] RSPM

tibblify 0.4.0.9000 2026-05-10 [1] Github (wranglezone/tibblify@8ebd2aa)

tidyr 1.3.2 2025-12-19 [1] RSPM

tidyselect 1.2.1 2024-03-11 [1] RSPM

tinytex 0.59 2026-03-28 [1] RSPM

tools 4.6.0 2026-04-24 [2] local

urlchecker 1.0.1 2021-11-30 [1] RSPM

usethis 3.2.1 2025-09-06 [1] RSPM

utf8 1.2.6 2025-06-08 [1] RSPM

utils * 4.6.0 2026-04-24 [2] local

vctrs 0.7.3 2026-04-11 [1] RSPM

waldo 0.6.2 2025-07-11 [1] RSPM

whisker 0.4.1 2022-12-05 [1] RSPM

withr 3.0.2 2024-10-28 [1] RSPM

xfun 0.57 2026-03-20 [1] RSPM

xml2 1.5.2 2026-01-17 [1] RSPM

xopen 1.0.1 2024-04-25 [1] RSPM

xtable 1.8-8 2026-02-22 [1] RSPM

yaml 2.3.12 2025-12-10 [1] RSPM

zip 2.3.3 2025-05-13 [1] RSPM

[1] /usr/local/lib/R/site-library

[2] /usr/local/lib/R/library

[3] /__w/_temp/Library

  • ── Packages attached to the search path.

──────────────────────────────────────────────────────────────────────────────

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

{qcthat} Reports

PR-Associated Issues

✅ A qcthat issue test matrix with 1 milestone, 1 issue, and 10 tests
└─█─Milestone: 0.1 (1 issue, 10 tests)
  └─📥─Feature 81: `auth_prepare()` function
    ├─✅─auth_prepare() constructs nectar_auth objects (#81)
    ├─✅─.as_nectar_auth() returns nectar_auth objects unchanged (#81)
    ├─✅─.as_nectar_auth() returns NULL auth_fn and empty auth_args for NULL input (#81)
    ├─✅─.as_nectar_auth() errors for list without auth_fn (#81)
    ├─✅─.as_nectar_auth() converts function input to nectar_auth (#81)
    ├─✅─.as_nectar_auth() merges auth_args with additional auth fields (#81)
    ├─✅─.as_nectar_auth() errors for non-listable auth_args (#81)
    ├─✅─auth_api_key() prepares req_auth_api_key auth (#81)
    ├─✅─req_prepare() applies prepared auth (#81)
    └─✅─req_prepare() errors for unsupported auth objects (#81)
# Issue state: 📥 = open, ☑️ = closed (completed), ⛔ = closed (won't fix)
# Test disposition: ✅ = passed, ❌ = failed, 🚫 = skipped
✅ All tests passed

🟢 All issues have at least one test


Completed Issues

✅ A qcthat issue test matrix with 1 milestone, 13 issues, and 55 tests
└─█─Milestone: 0.1 (13 issues, 55 tests)
  ├─☑️─Bug 76: Remove api key on `NULL`
  │ ├─✅─req_auth_api_key returns req unchanged if api_key is NA or empty (#76)
  │ └─✅─req_auth_api_key removes the key when api_key is NULL (#76)
  ├─☑️─Feature 10: Split call_api()
  │ ├─✅─req_prepare() applies user agent (#10, #29)
  │ ├─✅─req_prepare() deals with paths (#10)
  │ ├─✅─req_prepare() uses query parameters (#5, #10, #11, #19)
  │ ├─✅─req_prepare() uses body parameters (#10)
  │ └─✅─req_prepare() applies methods (#5, #10, #11, #19)
  ├─☑️─Feature 8: Authenticate with API Keys
  │ ├─✅─req_auth_api_key works for header (#8)
  │ └─✅─req_auth_api_key works for query (#8)
  ├─☑️─Feature 6: Standardize endpoint argument
  │ └─✅─bodies with paths are handled properly (#6)
  ├─☑️─Feature 5: req_perform() args
  │ ├─✅─req_prepare() uses query parameters (#5, #10, #11, #19)
  │ ├─✅─req_prepare() uses the .multi arg (#5, #11, #19)
  │ ├─✅─req_prepare() removes empty query parameters (#5, #11, #19)
  │ └─✅─req_prepare() applies methods (#5, #10, #11, #19)
  ├─☑️─Feature 44: resp_tidy policies
  │ ├─✅─req_tidy_policy errors informatively for bad fn (#44)
  │ ├─✅─req_tidy_policy applies resp_body_auto by default (#44)
  │ └─✅─req_tidy_policy applies the specified policy (#44)
  ├─☑️─Feature 40: resp_tidy()
  │ ├─✅─resp_body_auto works for json (#40)
  │ ├─✅─resp_body_auto works for xml (#40)
  │ ├─✅─resp_body_auto works for html (#40)
  │ ├─✅─resp_body_auto works for svg (#40)
  │ ├─✅─resp_body_auto works for csv (#40)
  │ ├─✅─resp_body_auto works for tsv (#40)
  │ ├─✅─resp_body_auto works for json subtypes (#40)
  │ ├─✅─resp_body_auto works for other strings (#40)
  │ ├─✅─resp_body_auto works for other things (#40)
  │ ├─✅─resp_body_csv extracts csv data (#40)
  │ ├─✅─resp_body_csv fails gracefully for bad data (#40)
  │ ├─✅─resp_body_tsv extracts tsv data (#40)
  │ ├─✅─resp_body_tsv fails gracefully for bad data (#40)
  │ ├─✅─resp_body_separate listifies responses (#40)
  │ ├─✅─resp_parse fails gracefully for unsupported classes (#40)
  │ ├─✅─resp_tidy_json fails gracefully with a bad subset_path (#40)
  │ ├─✅─resp_tidy_json returns NULL for an empty body (#40)
  │ ├─✅─resp_tidy_json tidies a response (#40)
  │ ├─✅─resp_tidy_json subsets a response (#40)
  │ ├─✅─resp_tidy_json tidies a response with a spec (#40)
  │ ├─✅─resp_tidy_json works with resp_tidy (#40)
  │ ├─✅─resp_tidy fails gracefully for non-responses (#40)
  │ ├─✅─resp_tidy fails gracefully for lists of non-responses (#40)
  │ ├─✅─resp_tidy parses json-containing httr2_response objects (#40)
  │ ├─✅─resp_tidy parses httr2_response objects with resp_tidy policy (#40)
  │ ├─✅─resp_tidy uses policies$resp_tidy$tidy_args (#40)
  │ ├─✅─resp_tidy parses and combines nectar_responses objects (#40)
  │ └─✅─resp_tidy parses and combines lists of httr2_response objects (#40)
  ├─☑️─Feature 35: req_pagination()
  │ ├─✅─req_pagination_policy errors informatively for bad fn (#35)
  │ ├─✅─req_pagination_policy applies the specified policy (#35)
  │ ├─✅─choose_pagination_fn returns NULL for no policy (#35)
  │ └─✅─choose_pagination_fn extracts the pagination_fn (#35)
  ├─☑️─Feature 32: Feature: smarter cursor pagination
  │ ├─✅─iterate_with_json_cursor repeats with non-empty cursor (#32)
  │ ├─✅─iterate_with_json_cursor stops with NULL cursor (#32)
  │ └─✅─iterate_with_json_cursor stops with blank cursor (#32)
  ├─☑️─Feature 30: Simpler cookies in req_auth_api_key()
  │ └─✅─req_auth_api_key works for cookies (#30)
  ├─☑️─Feature 29: User Agent Modifier
  │ ├─✅─req_pkg_user_agent adds a package agent (#29)
  │ ├─✅─req_pkg_user_agent adds a package agent and url (#29)
  │ ├─✅─Corner case of no supplied name works (#29)
  │ ├─✅─Corner case of no supplied agent works (#29)
  │ └─✅─req_prepare() applies user agent (#10, #29)
  ├─☑️─Feature 19: Export more autoreq pieces
  │ ├─✅─req_prepare() uses query parameters (#5, #10, #11, #19)
  │ ├─✅─req_prepare() uses the .multi arg (#5, #11, #19)
  │ ├─✅─req_prepare() removes empty query parameters (#5, #11, #19)
  │ └─✅─req_prepare() applies methods (#5, #10, #11, #19)
  └─☑️─Feature 11: Reconcile body parser
    ├─✅─req_prepare() uses query parameters (#5, #10, #11, #19)
    ├─✅─req_prepare() uses the .multi arg (#5, #11, #19)
    ├─✅─req_prepare() removes empty query parameters (#5, #11, #19)
    └─✅─req_prepare() applies methods (#5, #10, #11, #19)
# Issue state: 📥 = open, ☑️ = closed (completed), ⛔ = closed (won't fix)
# Test disposition: ✅ = passed, ❌ = failed, 🚫 = skipped
✅ All tests passed

🟢 All issues have at least one test

🙈 7 issues with label "qcthat-nocov" were ignored


This report was generated by this GitHub Actions run.

Last updated: 2026-05-10 15:59:24 UTC

Session Info ─ Session info ───────────────────────────────────────────────────────────────

setting value

version R version 4.6.0 (2026-04-24)

os Ubuntu 24.04.4 LTS

system x86_64, linux-gnu

ui X11

language (EN)

collate en_US.UTF-8

ctype en_US.UTF-8

tz UTC

date 2026-05-10

pandoc 3.1.3 @ /usr/bin/pandoc

quarto NA

─ Packages ───────────────────────────────────────────────────────────────────

package * version date (UTC) lib source

askpass 1.2.1 2024-10-04 [1] RSPM

astgrepr 0.1.1 2025-06-07 [1] RSPM

backports 1.5.1 2026-04-03 [1] RSPM

base * 4.6.0 2026-04-24 [2] local

base64enc 0.1-6 2026-02-02 [1] RSPM

boot 1.3-32 2025-08-29 [2] CRAN (R 4.6.0)

brew 1.0-10 2023-12-16 [1] RSPM

brio 1.1.5 2024-04-24 [1] RSPM

bslib 0.10.0 2026-01-26 [1] RSPM

cachem 1.1.0 2024-05-16 [1] RSPM

callr 3.7.6 2024-03-25 [1] RSPM

checkmate 2.3.4 2026-02-03 [1] RSPM

class 7.3-23 2025-01-01 [2] CRAN (R 4.6.0)

cli 3.6.6 2026-04-09 [1] RSPM

clipr 0.8.0 2022-02-22 [1] RSPM

cluster 2.1.8.2 2026-02-05 [2] CRAN (R 4.6.0)

codetools 0.2-20 2024-03-31 [2] CRAN (R 4.6.0)

commonmark 2.0.0 2025-07-07 [1] RSPM

compiler 4.6.0 2026-04-24 [2] local

covr 3.6.5 2025-11-09 [1] RSPM

crayon 1.5.3 2024-06-20 [1] RSPM

credentials 2.0.3 2025-09-12 [1] RSPM

curl 7.1.0 2026-04-22 [1] RSPM

datasets * 4.6.0 2026-04-24 [2] local

desc 1.4.3 2023-12-10 [1] RSPM

devtools 2.5.2 2026-04-30 [1] RSPM

diffobj 0.3.6 2025-04-21 [1] RSPM

digest 0.6.39 2025-11-19 [1] RSPM

docopt 0.7.2 2025-03-25 [1] RSPM (R 4.6.0)

downlit 0.4.5 2025-11-14 [1] RSPM

dplyr 1.2.1 2026-04-03 [1] RSPM

ellipsis 0.3.3 2026-04-04 [1] RSPM

emoji 16.0.0 2024-10-28 [1] RSPM

evaluate 1.0.5 2025-08-27 [1] RSPM

fansi 1.0.7 2025-11-19 [1] RSPM

fastmap 1.2.0 2024-05-15 [1] RSPM

fontawesome 0.5.3 2024-11-16 [1] RSPM

foreign 0.8-91 2026-01-29 [2] CRAN (R 4.6.0)

fs 2.1.0 2026-04-18 [1] RSPM

generics 0.1.4 2025-05-09 [1] RSPM

gert 2.3.1 2026-01-11 [1] RSPM

gh 1.5.0 2025-05-26 [1] RSPM

git2r 0.36.2 2025-03-29 [1] RSPM

gitcreds 0.1.2 2022-09-08 [1] RSPM

glue 1.8.1 2026-04-17 [1] RSPM

graphics * 4.6.0 2026-04-24 [2] local

grDevices * 4.6.0 2026-04-24 [2] local

grid 4.6.0 2026-04-24 [2] local

highr 0.12 2026-03-06 [1] RSPM

htmltools 0.5.9 2025-12-04 [1] RSPM

htmlwidgets 1.6.4 2023-12-06 [1] RSPM

httpuv 1.6.17 2026-03-18 [1] RSPM

httr 1.4.8 2026-02-13 [1] RSPM

httr2 1.2.2 2025-12-08 [1] RSPM

ini 0.3.1 2018-05-20 [1] RSPM

jquerylib 0.1.4 2021-04-26 [1] RSPM

jsonlite 2.0.0 2025-03-27 [1] RSPM

KernSmooth 2.23-26 2025-01-01 [2] CRAN (R 4.6.0)

knitr 1.51 2025-12-20 [1] RSPM

later 1.4.8 2026-03-05 [1] RSPM

lattice 0.22-9 2026-02-09 [2] CRAN (R 4.6.0)

lifecycle 1.0.5 2026-01-08 [1] RSPM

littler 0.3.23 2026-04-12 [1] RSPM (R 4.6.0)

magick 2.9.1 2026-02-28 [1] RSPM

magrittr 2.0.5 2026-04-04 [1] RSPM

MASS 7.3-65 2025-02-28 [2] CRAN (R 4.6.0)

Matrix 1.7-5 2026-03-21 [2] CRAN (R 4.6.0)

memoise 2.0.1 2021-11-26 [1] RSPM

methods * 4.6.0 2026-04-24 [2] local

mgcv 1.9-4 2025-11-07 [2] CRAN (R 4.6.0)

mime 0.13 2025-03-17 [1] RSPM

miniUI 0.1.2 2025-04-17 [1] RSPM

nectar 0.0.0.9007 2026-05-10 [1] local

nlme 3.1-169 2026-03-27 [2] CRAN (R 4.6.0)

nnet 7.3-20 2025-01-01 [2] CRAN (R 4.6.0)

openssl 2.4.0 2026-04-15 [1] RSPM

otel 0.2.0 2025-08-29 [1] RSPM

pak 0.9.5 2026-04-27 [1] RSPM (R 4.6.0)

parallel 4.6.0 2026-04-24 [2] local

pillar 1.11.1 2025-09-17 [1] RSPM

pkgbuild 1.4.8 2025-05-26 [1] RSPM

pkgconfig 2.0.3 2019-09-22 [1] RSPM

pkgdown 2.2.0 2025-11-06 [1] RSPM

pkgload 1.5.2 2026-04-22 [1] RSPM

praise 1.0.0 2015-08-11 [1] RSPM

prettyunits 1.2.0 2023-09-24 [1] RSPM

processx 3.9.0 2026-04-22 [1] RSPM

profvis 0.4.0 2024-09-20 [1] RSPM

promises 1.5.0 2025-11-01 [1] RSPM

ps 1.9.3 2026-04-20 [1] RSPM

purrr 1.2.2 2026-04-10 [1] RSPM

qcthat 1.1.2 2026-05-10 [1] Github (Gilead-BioStats/qcthat@d0958dc)

R6 2.6.1 2025-02-15 [1] RSPM

ragg 1.5.2 2026-03-23 [1] RSPM

rappdirs 0.3.4 2026-01-17 [1] RSPM

rcmdcheck 1.4.0 2021-09-27 [1] RSPM

Rcpp 1.1.1-1.1 2026-04-24 [1] RSPM

rex 1.2.2 2026-03-28 [1] RSPM

rlang 1.2.0 2026-04-06 [1] RSPM

rmarkdown 2.31 2026-03-26 [1] RSPM

roxygen2 8.0.0 2026-05-01 [1] RSPM

rpart 4.1.27 2026-03-27 [2] CRAN (R 4.6.0)

rprojroot 2.1.1 2025-08-26 [1] RSPM

rrapply 1.2.8 2025-11-25 [1] RSPM

rstudioapi 0.18.0 2026-01-16 [1] RSPM

rversions 3.0.0 2025-10-09 [1] RSPM

sass 0.4.10 2025-04-11 [1] RSPM

sessioninfo 1.2.3 2025-02-05 [1] RSPM

shiny 1.13.0 2026-02-20 [1] RSPM

sourcetools 0.1.7-2 2026-03-28 [1] RSPM

spatial 7.3-18 2025-01-01 [2] CRAN (R 4.6.0)

splines 4.6.0 2026-04-24 [2] local

stats * 4.6.0 2026-04-24 [2] local

stats4 4.6.0 2026-04-24 [2] local

stbl 0.3.0 2026-04-04 [1] RSPM

stringi 1.8.7 2025-03-27 [1] RSPM

stringr 1.6.0 2025-11-04 [1] RSPM

survival 3.8-6 2026-01-16 [2] CRAN (R 4.6.0)

sys 3.4.3 2024-10-04 [1] RSPM

systemfonts 1.3.2 2026-03-05 [1] RSPM

tcltk 4.6.0 2026-04-24 [2] local

testthat 3.3.2 2026-01-11 [1] RSPM

textshaping 1.0.5 2026-03-06 [1] RSPM

tibble 3.3.1 2026-01-11 [1] RSPM

tibblify 0.4.0.9000 2026-05-10 [1] Github (wranglezone/tibblify@8ebd2aa)

tidyr 1.3.2 2025-12-19 [1] RSPM

tidyselect 1.2.1 2024-03-11 [1] RSPM

tinytex 0.59 2026-03-28 [1] RSPM

tools 4.6.0 2026-04-24 [2] local

urlchecker 1.0.1 2021-11-30 [1] RSPM

usethis 3.2.1 2025-09-06 [1] RSPM

utf8 1.2.6 2025-06-08 [1] RSPM

utils * 4.6.0 2026-04-24 [2] local

vctrs 0.7.3 2026-04-11 [1] RSPM

waldo 0.6.2 2025-07-11 [1] RSPM

whisker 0.4.1 2022-12-05 [1] RSPM

withr 3.0.2 2024-10-28 [1] RSPM

xfun 0.57 2026-03-20 [1] RSPM

xml2 1.5.2 2026-01-17 [1] RSPM

xopen 1.0.1 2024-04-25 [1] RSPM

xtable 1.8-8 2026-02-22 [1] RSPM

yaml 2.3.12 2025-12-10 [1] RSPM

zip 2.3.3 2025-05-13 [1] RSPM

[1] /usr/local/lib/R/site-library

[2] /usr/local/lib/R/library

[3] /__w/_temp/Library

  • ── Packages attached to the search path.

──────────────────────────────────────────────────────────────────────────────

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🌐 PR pkgdown deployed

This report was generated by this GitHub Actions run.

Last updated: 2026-05-10 15:59:49 UTC

Session Info ─ Session info ───────────────────────────────────────────────────────────────

setting value

version R version 4.6.0 (2026-04-24)

os Ubuntu 24.04.4 LTS

system x86_64, linux-gnu

ui X11

language (EN)

collate en_US.UTF-8

ctype en_US.UTF-8

tz UTC

date 2026-05-10

pandoc 3.1.3 @ /usr/bin/pandoc

quarto NA

─ Packages ───────────────────────────────────────────────────────────────────

package * version date (UTC) lib source

askpass 1.2.1 2024-10-04 [1] RSPM

astgrepr 0.1.1 2025-06-07 [1] RSPM

backports 1.5.1 2026-04-03 [1] RSPM

base * 4.6.0 2026-04-24 [2] local

base64enc 0.1-6 2026-02-02 [1] RSPM

boot 1.3-32 2025-08-29 [2] CRAN (R 4.6.0)

brew 1.0-10 2023-12-16 [1] RSPM

brio 1.1.5 2024-04-24 [1] RSPM

bslib 0.10.0 2026-01-26 [1] RSPM

cachem 1.1.0 2024-05-16 [1] RSPM

callr 3.7.6 2024-03-25 [1] RSPM

checkmate 2.3.4 2026-02-03 [1] RSPM

class 7.3-23 2025-01-01 [2] CRAN (R 4.6.0)

cli 3.6.6 2026-04-09 [1] RSPM

clipr 0.8.0 2022-02-22 [1] RSPM

cluster 2.1.8.2 2026-02-05 [2] CRAN (R 4.6.0)

codetools 0.2-20 2024-03-31 [2] CRAN (R 4.6.0)

commonmark 2.0.0 2025-07-07 [1] RSPM

compiler 4.6.0 2026-04-24 [2] local

covr 3.6.5 2025-11-09 [1] RSPM

crayon 1.5.3 2024-06-20 [1] RSPM

credentials 2.0.3 2025-09-12 [1] RSPM

curl 7.1.0 2026-04-22 [1] RSPM

datasets * 4.6.0 2026-04-24 [2] local

desc 1.4.3 2023-12-10 [1] RSPM

devtools 2.5.2 2026-04-30 [1] RSPM

diffobj 0.3.6 2025-04-21 [1] RSPM

digest 0.6.39 2025-11-19 [1] RSPM

docopt 0.7.2 2025-03-25 [1] RSPM (R 4.6.0)

downlit 0.4.5 2025-11-14 [1] RSPM

dplyr 1.2.1 2026-04-03 [1] RSPM

ellipsis 0.3.3 2026-04-04 [1] RSPM

emoji 16.0.0 2024-10-28 [1] RSPM

evaluate 1.0.5 2025-08-27 [1] RSPM

fansi 1.0.7 2025-11-19 [1] RSPM

fastmap 1.2.0 2024-05-15 [1] RSPM

fontawesome 0.5.3 2024-11-16 [1] RSPM

foreign 0.8-91 2026-01-29 [2] CRAN (R 4.6.0)

fs 2.1.0 2026-04-18 [1] RSPM

generics 0.1.4 2025-05-09 [1] RSPM

gert 2.3.1 2026-01-11 [1] RSPM

gh 1.5.0 2025-05-26 [1] RSPM

git2r 0.36.2 2025-03-29 [1] RSPM

gitcreds 0.1.2 2022-09-08 [1] RSPM

glue 1.8.1 2026-04-17 [1] RSPM

graphics * 4.6.0 2026-04-24 [2] local

grDevices * 4.6.0 2026-04-24 [2] local

grid 4.6.0 2026-04-24 [2] local

here 1.0.2 2025-09-15 [1] RSPM

highr 0.12 2026-03-06 [1] RSPM

htmltools 0.5.9 2025-12-04 [1] RSPM

htmlwidgets 1.6.4 2023-12-06 [1] RSPM

httpuv 1.6.17 2026-03-18 [1] RSPM

httr 1.4.8 2026-02-13 [1] RSPM

httr2 1.2.2 2025-12-08 [1] RSPM

ini 0.3.1 2018-05-20 [1] RSPM

jquerylib 0.1.4 2021-04-26 [1] RSPM

jsonlite 2.0.0 2025-03-27 [1] RSPM

KernSmooth 2.23-26 2025-01-01 [2] CRAN (R 4.6.0)

knitr 1.51 2025-12-20 [1] RSPM

later 1.4.8 2026-03-05 [1] RSPM

lattice 0.22-9 2026-02-09 [2] CRAN (R 4.6.0)

lifecycle 1.0.5 2026-01-08 [1] RSPM

littler 0.3.23 2026-04-12 [1] RSPM (R 4.6.0)

magick 2.9.1 2026-02-28 [1] RSPM

magrittr 2.0.5 2026-04-04 [1] RSPM

MASS 7.3-65 2025-02-28 [2] CRAN (R 4.6.0)

Matrix 1.7-5 2026-03-21 [2] CRAN (R 4.6.0)

memoise 2.0.1 2021-11-26 [1] RSPM

methods * 4.6.0 2026-04-24 [2] local

mgcv 1.9-4 2025-11-07 [2] CRAN (R 4.6.0)

mime 0.13 2025-03-17 [1] RSPM

miniUI 0.1.2 2025-04-17 [1] RSPM

nectar 0.0.0.9007 2026-05-10 [1] local

nlme 3.1-169 2026-03-27 [2] CRAN (R 4.6.0)

nnet 7.3-20 2025-01-01 [2] CRAN (R 4.6.0)

openssl 2.4.0 2026-04-15 [1] RSPM

otel 0.2.0 2025-08-29 [1] RSPM

pak 0.9.5 2026-04-27 [1] RSPM (R 4.6.0)

parallel 4.6.0 2026-04-24 [2] local

pillar 1.11.1 2025-09-17 [1] RSPM

pkgbuild 1.4.8 2025-05-26 [1] RSPM

pkgconfig 2.0.3 2019-09-22 [1] RSPM

pkgdown 2.2.0 2025-11-06 [1] RSPM

pkgload 1.5.2 2026-04-22 [1] RSPM

praise 1.0.0 2015-08-11 [1] RSPM

prettyunits 1.2.0 2023-09-24 [1] RSPM

processx 3.9.0 2026-04-22 [1] RSPM

profvis 0.4.0 2024-09-20 [1] RSPM

promises 1.5.0 2025-11-01 [1] RSPM

ps 1.9.3 2026-04-20 [1] RSPM

purrr 1.2.2 2026-04-10 [1] RSPM

qcthat 1.1.2.9000 2026-05-10 [1] Github (Gilead-BioStats/qcthat@f508b0f)

quarto 1.5.1 2025-09-04 [1] RSPM

R6 2.6.1 2025-02-15 [1] RSPM

ragg 1.5.2 2026-03-23 [1] RSPM

rappdirs 0.3.4 2026-01-17 [1] RSPM

rcmdcheck 1.4.0 2021-09-27 [1] RSPM

Rcpp 1.1.1-1.1 2026-04-24 [1] RSPM

rex 1.2.2 2026-03-28 [1] RSPM

rlang 1.2.0 2026-04-06 [1] RSPM

rmarkdown 2.31 2026-03-26 [1] RSPM

roxygen2 8.0.0 2026-05-01 [1] RSPM

rpart 4.1.27 2026-03-27 [2] CRAN (R 4.6.0)

rprojroot 2.1.1 2025-08-26 [1] RSPM

rrapply 1.2.8 2025-11-25 [1] RSPM

rstudioapi 0.18.0 2026-01-16 [1] RSPM

rversions 3.0.0 2025-10-09 [1] RSPM

sass 0.4.10 2025-04-11 [1] RSPM

sessioninfo 1.2.3 2025-02-05 [1] RSPM

shiny 1.13.0 2026-02-20 [1] RSPM

sourcetools 0.1.7-2 2026-03-28 [1] RSPM

spatial 7.3-18 2025-01-01 [2] CRAN (R 4.6.0)

splines 4.6.0 2026-04-24 [2] local

stats * 4.6.0 2026-04-24 [2] local

stats4 4.6.0 2026-04-24 [2] local

stbl 0.3.0 2026-04-04 [1] RSPM

stringi 1.8.7 2025-03-27 [1] RSPM

stringr 1.6.0 2025-11-04 [1] RSPM

survival 3.8-6 2026-01-16 [2] CRAN (R 4.6.0)

sys 3.4.3 2024-10-04 [1] RSPM

systemfonts 1.3.2 2026-03-05 [1] RSPM

tcltk 4.6.0 2026-04-24 [2] local

testthat 3.3.2 2026-01-11 [1] RSPM

textshaping 1.0.5 2026-03-06 [1] RSPM

tibble 3.3.1 2026-01-11 [1] RSPM

tibblify 0.4.0.9000 2026-05-10 [1] Github (wranglezone/tibblify@8ebd2aa)

tidyr 1.3.2 2025-12-19 [1] RSPM

tidyselect 1.2.1 2024-03-11 [1] RSPM

tinytex 0.59 2026-03-28 [1] RSPM

tools 4.6.0 2026-04-24 [2] local

urlchecker 1.0.1 2021-11-30 [1] RSPM

usethis 3.2.1 2025-09-06 [1] RSPM

utf8 1.2.6 2025-06-08 [1] RSPM

utils * 4.6.0 2026-04-24 [2] local

vctrs 0.7.3 2026-04-11 [1] RSPM

waldo 0.6.2 2025-07-11 [1] RSPM

whisker 0.4.1 2022-12-05 [1] RSPM

withr 3.0.2 2024-10-28 [1] RSPM

xfun 0.57 2026-03-20 [1] RSPM

xml2 1.5.2 2026-01-17 [1] RSPM

xopen 1.0.1 2024-04-25 [1] RSPM

xtable 1.8-8 2026-02-22 [1] RSPM

yaml 2.3.12 2025-12-10 [1] RSPM

zip 2.3.3 2025-05-13 [1] RSPM

[1] /usr/local/lib/R/site-library

[2] /usr/local/lib/R/library

[3] /__w/_temp/Library

  • ── Packages attached to the search path.

──────────────────────────────────────────────────────────────────────────────

Comment thread R/auth_prepare.R
Comment thread R/req_auth_api_key.R Outdated
Comment thread R/auth_prepare.R Outdated
Comment thread R/req_auth_api_key.R Outdated
Comment thread tests/testthat/test-req_auth_api_key.R Outdated
Comment thread tests/testthat/test-req_auth_api_key.R Outdated
Comment thread tests/testthat/test-req_prepare.R Outdated
Comment thread tests/testthat/test-req_prepare.R Outdated
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@jonthegeek I've opened a new pull request, #84, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI added a commit that referenced this pull request May 9, 2026
- Refactor .as_nectar_auth() to S3 generic with methods for nectar_auth,
  NULL, list, and default; auth_prepare() delegates to .as_nectar_auth()
- Change @family to 'opinionated auth functions' in auth_prepare(),
  auth_api_key(), and req_auth_api_key()
- Move parameter_name, api_key, location param docs to aaa-shared_params.R
  and use @inheritParams .shared-params in both req_auth_api_key() and
  auth_api_key()
- Move auth_prepare() test to new test-auth_prepare.R with (#81) tag
- Add (#81) to auth_api_key() test name in test-req_auth_api_key.R
- Add (#81) to both req_prepare() auth tests in test-req_prepare.R
- Update unsupported-auth error test to use a genuinely unsupported type

Agent-Logs-Url: https://github.com/api2r/nectar/sessions/c74d2ebb-3b2a-49b0-95fc-30fac727276d

Co-authored-by: jonthegeek <33983824+jonthegeek@users.noreply.github.com>
* Initial plan

* fix: address all PR #83 review comments

- Refactor .as_nectar_auth() to S3 generic with methods for nectar_auth,
  NULL, list, and default; auth_prepare() delegates to .as_nectar_auth()
- Change @family to 'opinionated auth functions' in auth_prepare(),
  auth_api_key(), and req_auth_api_key()
- Move parameter_name, api_key, location param docs to aaa-shared_params.R
  and use @inheritParams .shared-params in both req_auth_api_key() and
  auth_api_key()
- Move auth_prepare() test to new test-auth_prepare.R with (#81) tag
- Add (#81) to auth_api_key() test name in test-req_auth_api_key.R
- Add (#81) to both req_prepare() auth tests in test-req_prepare.R
- Update unsupported-auth error test to use a genuinely unsupported type

Agent-Logs-Url: https://github.com/api2r/nectar/sessions/c74d2ebb-3b2a-49b0-95fc-30fac727276d

Co-authored-by: jonthegeek <33983824+jonthegeek@users.noreply.github.com>

* fix: req_auth_api_key in both opinionated auth and request function families

Agent-Logs-Url: https://github.com/api2r/nectar/sessions/77aaa079-c761-4263-ab39-3001b526e1b3

Co-authored-by: jonthegeek <33983824+jonthegeek@users.noreply.github.com>

* Update R/auth_prepare.R

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Jon Harmon <jonthegeek@gmail.com>

---------

Signed-off-by: Jon Harmon <jonthegeek@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jonthegeek <33983824+jonthegeek@users.noreply.github.com>
Co-authored-by: Jon Harmon <jonthegeek@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jonthegeek jonthegeek marked this pull request as ready for review May 9, 2026 14:49
@api2r api2r deleted a comment from github-actions Bot May 9, 2026
@jonthegeek jonthegeek requested a review from Copilot May 9, 2026 14:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a reusable authentication abstraction (nectar_auth) so authentication can be prepared once and applied to multiple requests, and migrates req_prepare() from the auth_fn/auth_args pair to a single auth argument.

Changes:

  • Added auth_prepare() (constructor) and auth_api_key() (API-key auth preparer) to create reusable nectar_auth objects.
  • Updated req_prepare() to accept auth (a nectar_auth or NULL) and apply it during request preparation.
  • Updated documentation, vignette examples, NAMESPACE exports/S3 registrations, and added/updated tests for the new auth workflow.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vignettes/nectar.Rmd Updates vignette examples to use auth_api_key() + auth=.
tests/testthat/test-req_prepare.R Adds tests for applying prepared auth and rejecting unsupported auth objects.
tests/testthat/test-req_auth_api_key.R Adds tests asserting auth_api_key() constructs a nectar_auth.
tests/testthat/test-auth_prepare.R Adds tests asserting auth_prepare() constructs a nectar_auth.
R/req_prepare.R Replaces auth_fn/auth_args with auth and applies prepared auth.
R/req_auth_api_key.R Adds auth_api_key() and updates roxygen metadata.
R/auth_prepare.R Adds auth_prepare() and .as_nectar_auth() S3 coercion/validation helpers.
R/aaa-shared_params.R Updates shared param docs to document auth (and related params).
NAMESPACE Exports new functions and registers .as_nectar_auth.* S3 methods.
man/req_prepare.Rd Documents new auth parameter for req_prepare().
man/req_auth_api_key.Rd Updates API key docs and concept/family metadata.
man/dot-shared-params.Rd Updates shared param documentation (auth, api_key, etc.).
man/auth_prepare.Rd New generated docs for auth_prepare().
man/auth_api_key.Rd New generated docs for auth_api_key().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/auth_prepare.R Outdated
Comment thread R/auth_prepare.R Outdated
Comment thread R/req_auth_api_key.R Outdated
Comment thread tests/testthat/test-req_prepare.R Outdated
@jonthegeek
Copy link
Copy Markdown
Collaborator

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot apply changes based on the comments in this thread

Applied the requested review-thread updates in de383e5, including auth list merging/validation, roxygen fixes, and test corrections.

Copilot AI requested a review from jonthegeek May 9, 2026 15:10
@jonthegeek jonthegeek enabled auto-merge (squash) May 10, 2026 15:58
@jonthegeek jonthegeek disabled auto-merge May 10, 2026 15:58
@jonthegeek jonthegeek enabled auto-merge (squash) May 10, 2026 15:58
@jonthegeek jonthegeek merged commit 22d11ee into main May 10, 2026
10 checks passed
@jonthegeek jonthegeek deleted the copilot/add-auth-prepare-function branch May 10, 2026 16:00
github-actions Bot pushed a commit that referenced this pull request May 11, 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.

auth_prepare() function

3 participants