Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2

- name: Show testthat output
if: always()
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dataone
Version: 2.2.2
Date: 2022-06-08
Version: 2.3.0
Date: 2025-10-08
Title: R Interface to the DataONE REST API
Authors@R: c( person("Matthew B.", "Jones", role = c("aut","cre"), email = "jones@nceas.ucsb.edu", comment=c(ORCID = "0000-0003-0077-4738")),
person("Peter", "Slaughter", role = "aut", email = "slaughter@nceas.ucsb.edu", comment=c(ORCID = "0000-0002-2192-403X")),
Expand Down Expand Up @@ -62,4 +62,5 @@ Collate:
'dataone-package.R'
Encoding: UTF-8
VignetteBuilder: knitr
RoxygenNote: 7.1.2
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE)
6 changes: 3 additions & 3 deletions R/AbstractTableDescriber.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
#' For example, the EMLParser registers itself as a handler for eml v2.0.0 - v2.1.1
#' with the following.
#'
#' \code{
#' `
#' if (!exists("tableDescriber.registry")) tableDescriber.registry <- list()
#' tableDescriber.registry[[ "eml://ecoinformatics.org/eml-2.0.0" ]] <- "EMLParser"
#' tableDescriber.registry[[ "eml://ecoinformatics.org/eml-2.0.1" ]] <- "EMLParser"
#' tableDescriber.registry[[ "eml://ecoinformatics.org/eml-2.1.0" ]] <- "EMLParser"
#' tableDescriber.registry[[ "eml://ecoinformatics.org/eml-2.1.1" ]] <- "EMLParser"
#' }
#' `
#'
#' Note that the key in the list is the DataONE formatIdentifier that can be
#' found at "https://cn.dataone.org/cn/v2/formats".
Expand Down Expand Up @@ -195,7 +195,7 @@ setGeneric("data.tableAttributeOrientation", function(x, index, ...) {
#' @param index - the index of the table within the document
#' @param ... Additional parameters
#' @return the number of lines to skip
#' @seealso \code{help(read.table)}
#' @seealso `help(read.table)`
#' @author rnahf
#' @export
setGeneric("data.tableSkipLinesHeader", function(x, index, ...) {
Expand Down
74 changes: 35 additions & 39 deletions R/AuthenticationManager.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,37 @@
#' updating objects on DataONE nodes and reserving identifiers might fail if your
#' authorization credentials are missing or expired.
#'
#' DataONE version 1.0 identifies you using CILogon-provided x509 certificates. DataONE has
#' partnered with CILogon to provide a widely-accessible certificate issuing mechanism
#' that allows DataONE users to use existing trusted institutional and public accounts.
#'
#' DataONE version 2.0 provides an addition authentication mechanism known as
#' authentication tokens. For information about tokens and instructions for generating
#' DataONE version 2.0 provides an authentication mechanism known using JWT
#' Bearer tokens. For information about tokens and instructions for generating
#' a token for use with the dataone R package, view the overview document by
#' entering the command: \code{'vignette("dataone-overview")'}. DataONE authentication
#' tokens can be obtained by signing in to your DataONE account at https://search.dataone.org.
#' entering the command: `'vignette("v01-dataone-overview")'`. DataONE authentication
#' tokens can be obtained by signing in to your DataONE account at https://search.dataone.org
#' and copying the token from your profile settings.
#'
#' Additionally, DataONE API version 1.0 identifies you using CILogon-provided x509 certificates.
#' DataONE partnered with CILogon to provide a widely-accessible certificate issuing mechanism
#' that allows DataONE users to use existing trusted institutional and public accounts, but this method
#' is deprecated and generally users should use JWT Bearer tokens as described above.
#'
#' CILogon recognizes many identity providers, including many universities as well as
#' Google, so most times users new to DataONE can get certificates using one
#' of their existing accounts. For more information about the CILogon service, see
#' \url{https://cilogon.org/?skin=DataONE} .
#' @slot obscured Value of type \code{"character"} Is authentication disabled (obscured)?
#' @slot obscured Value of type `"character"` Is authentication disabled (obscured)?
#' @rdname AuthenticationManager-class
#' @aliases AuthenticationManager-class
#' @section Methods:
#' \itemize{
#' \item{\code{\link{AuthenticationManager}}}{: Create an AuthenticationManager object.}
#' \item{\code{\link{isAuthValid}}}{: Verify authentication for a member node.}
#' \item{\code{\link{getToken}}}{: Get the value of the DataONE Authentication Token, if one exists.}
#' \item{\code{\link{getCert}}}{: Get the DataONE X.509 Certificate location.}
#' \item{\code{\link{getAuthMethod}}}{: Get the current valid authentication mechanism.}
#' \item{\code{\link{getAuthSubject}}}{: Get the authentication subject.}
#' \item{\code{\link{getAuthExpires}}}{: Get the expiration date of the current authentication method.}
#' \item{\code{\link{isAuthExpired}}}{: Check if the currently valid authentication method has reached the expiration time.}
#' \item{\code{\link{obscureAuth}}}{: Temporarily disable DataONE authentication.}
#' \item{\code{\link{restoreAuth}}}{: Restore authentication (after being disabled with \code{obscureAuth}).}
#' \item{\code{\link{showAuth}}}{: Display all authentication information.}
#' \item{\code{\link{getTokenInfo}}}{: Display all authentication token information.}
#' \item{\code{\link{getCertInfo}}}{: Display all X.509 certificate information.}
#' * [AuthenticationManager()]: Create an AuthenticationManager object
#' * [isAuthValid()]: Verify authentication for a member node
#' * [getToken()]: Get the value of the DataONE Authentication Token, if one exists
#' * [getCert()]: Get the DataONE X.509 Certificate location
#' * [getAuthMethod()]: Get the current valid authentication mechanism
#' * [getAuthSubject()]: Get the authentication subject
#' * [getAuthExpires()]: Get the expiration date of the current authentication method
#' * [isAuthExpired()]: Check if the currently valid authentication method has reached the expiration time
#' * [obscureAuth()]: Temporarily disable DataONE authentication
#' * [restoreAuth()]: Restore authentication (after being disabled with `obscureAuth`)
#' * [showAuth()]: Display all authentication information
#' * [getTokenInfo()]: Display all authentication token information
#' * [getCertInfo()]: Display all X.509 certificate information
#'
#' }
#' @seealso \code{\link{dataone}}{ package description.}
#' @seealso [dataone()] package description.
#' @import base64enc
#' @importFrom jsonlite fromJSON
#' @include D1Node.R
Expand Down Expand Up @@ -99,7 +95,7 @@ setMethod("AuthenticationManager", signature=character(), function() {
#' via the R options facility, it will be used i.e. available via getOption("dataone_token"). However,
#' authentication tokens can only be used for DataONE v2 or higher nodes. X.509 certificates can be used
#' with DataONE v1 or higher nodes.
#' See the \emph{"dataone"} vignette \emph{"dataone-overview"} for more information on authentication.
#' See the *"dataone"* vignette *"v01-dataone-overview"* for more information on authentication.
#' @param .Object An AuthenticationManager instance
#' @param node The node object (MNode or CNode) that authentication is being checked for.
#' @param ... additional parameters
Expand Down Expand Up @@ -181,8 +177,8 @@ setGeneric("getAuthMethod", function(.Object, ...) {
})

#' @rdname getAuthMethod
#' @details The current authentication method being used, either an authentication token or an X.509 certificate. The \code{'node'}
#' argument is used to determine the authentication mechanism that is appropriate for the specified \code{'node'}.
#' @details The current authentication method being used, either an authentication token or an X.509 certificate. The `'node'`
#' argument is used to determine the authentication mechanism that is appropriate for the specified `'node'`.
#' For example, authentication tokens are supported on DataONE nodes that use the DataONE V2.0 API or higher, so if the
#' node uses the V1 API, then only an X.509 certificate can be used.
#' @param node A D1Node instance to determine the authentication method for.
Expand All @@ -203,8 +199,8 @@ setGeneric("getAuthSubject", function(.Object, ...) {

#' @rdname getAuthSubject
#' @details The authenticated user, aka 'subject' is retrieved from the authentication mechanism
#' currently being used, either an authentication token or an X.509 certificate. The \code{'node'}
#' argument is used to determine the authentication mechanism that is appropriate for the specified \code{'node'}.
#' currently being used, either an authentication token or an X.509 certificate. The `'node'`
#' argument is used to determine the authentication mechanism that is appropriate for the specified `'node'`.
#' For example, authentication tokens are supported on DataONE nodes that use the DataONE V2.0 API or higher, so if the
#' node uses the V1 API, then only an X.509 certificate can be used.
#' @param node A D1Node instance
Expand Down Expand Up @@ -248,10 +244,10 @@ setMethod("isAuthExpired", signature("AuthenticationManager"), function(.Object,
})

#' Temporarily disable DataONE authentication.
#' @description Calling \code{obscureAuth} temporarily disables authentication so that
#' @description Calling `obscureAuth` temporarily disables authentication so that
#' @details This method is intended to be used for authentication testing.
#' \code{isAuthValid} will return FALSE. Authentication can be re-enabled by calling
#' \code{restoreAuth}.
#' `isAuthValid` will return FALSE. Authentication can be re-enabled by calling
#' `restoreAuth`.
#' @rdname obscureAuth
#' @aliases obscureAuth
#' @param .Object An AuthenticationManager instance
Expand All @@ -266,7 +262,7 @@ setMethod("obscureAuth", signature("AuthenticationManager"), function(.Object) {
return(.Object)
})

#' Restore authentication (after being disabled with \code{obscureAuth}).
#' Restore authentication (after being disabled with `obscureAuth`).
#' @rdname restoreAuth
#' @aliases restoreAuth
#' @param .Object An AuthenticationManager instance
Expand Down Expand Up @@ -315,7 +311,7 @@ parseAuthToken <- function(authToken) {
#' Evaluate DataONE authentication.
#' @description A valid DataONE authentication method is looked for and all
#' authentication information is retrieved from it.
#' @details If the node specified in the \code{'node'} parameter is a DataONE v2 node
#' @details If the node specified in the `'node'` parameter is a DataONE v2 node
#' or higher, then an authentication token is checked if one exists. If it is readable
#' and not expired, then information for the token is returned. If a valid token does
#' not exist, then the X.509 certificate is checked, if it exists. If it is valid
Expand Down
Loading
Loading