Skip to content

Commit

Permalink
version 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mobreza authored and cran-robot committed Feb 24, 2024
1 parent ad5018c commit 5edf637
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 21 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
@@ -1,5 +1,5 @@
Package: genesysr
Version: 2.1.0
Version: 2.1.1
Title: Genesys PGR Client
Description: Access data on plant genetic resources from genebanks around the world published on Genesys (<https://www.genesys-pgr.org>).
Your use of data is subject to terms and conditions available at <https://www.genesys-pgr.org/content/legal/terms>.
Expand All @@ -13,14 +13,15 @@ Authors@R: c(person(family = "Global Crop Diversity Trust", role = c("cph")),
person("Nora", "Castaneda", email = "nora.castaneda@croptrust.org", role = c("ctb")))
Maintainer: Matija Obreza <matija.obreza@croptrust.org>
Depends: R (>= 3.1.0)
Imports: httr2, jsonlite, dplyr, readr, magrittr, tidyselect,
Imports: httr2 (>= 1.0.0), jsonlite, dplyr, readr, magrittr,
tidyselect,
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Suggests: knitr, rmarkdown
NeedsCompilation: no
Packaged: 2023-10-13 04:44:27 UTC; mobreza
Packaged: 2024-02-23 08:43:52 UTC; mobreza
Author: Global Crop Diversity Trust [cph],
Matija Obreza [aut, cre],
Nora Castaneda [ctb]
Repository: CRAN
Date/Publication: 2023-10-13 05:00:05 UTC
Date/Publication: 2024-02-23 09:10:06 UTC
12 changes: 6 additions & 6 deletions MD5
@@ -1,17 +1,17 @@
14186f1b197d163861e1e2444d26710f *DESCRIPTION
6fdfef408cf272caef0e77c0ad02c588 *DESCRIPTION
6599f795a1f0d9d7c8d1106e29dadc35 *NAMESPACE
9409b1366af0b476b9bcf8b9dca5d811 *NEWS.md
ea3e7bfe86907cee6040b03673dc7e4e *R/api-client.R
173d69114663d1d22c3e11c87c46da70 *NEWS.md
1c5b6fd038e0e32cafa76fee4025d69b *R/api-client.R
68099fb23d740bc9ae93f93b60db87ec *R/filters.R
58ef1cd2dfca8d94fba9c9402390cb16 *R/genesys.R
6d109853069f9769ae3debc8c0896a2b *R/validator.R
d9236f0cc9ed8e1c0bc96b0d2a85de43 *README.md
1607a8bfbf546732fe9457c00066d9b9 *build/vignette.rds
3c83efd109badcbed7394e68a36f4e22 *inst/WORDLIST
daa110a27abd788b5ae5dd830ad53053 *inst/doc/tutorial.Rmd
a810201240e428229d49f5e03d0d36f6 *inst/doc/tutorial.html
bc583fe03d9a79ec79472a30b3a44ade *inst/doc/tutorial.html
4b6d81d765bf7834969edd26fc14fb1f *inst/doc/validation.Rmd
372b79d5cc69052727e762d526e8f8d3 *inst/doc/validation.html
987b4d10aabd7446e960b14a2b02e44a *inst/doc/validation.html
7230226f3511f648925691676f870fc6 *man/api1_url.Rd
8c83c8ed059076d2e496fb6f873d5298 *man/api2_url.Rd
3c89e0e5581c109333bd2c32c8affd80 *man/authorization.Rd
Expand Down Expand Up @@ -46,6 +46,6 @@ c849cb6c29c9d2a0665be9c81ddb0fe9 *man/me.Rd
f562d7cc9ec22b8e692370d584361330 *man/setup.Rd
a5d181cf2b629e0fd4d28356bd185422 *man/setup_production.Rd
5c09b4337f8f2c69dad1d9c47427ef08 *man/setup_sandbox.Rd
31246defcd334403dfb142c5a046072f *man/user_login.Rd
9e7eae4bc43a926cbb5c21ff3ac98181 *man/user_login.Rd
daa110a27abd788b5ae5dd830ad53053 *vignettes/tutorial.Rmd
4b6d81d765bf7834969edd26fc14fb1f *vignettes/validation.Rmd
4 changes: 4 additions & 0 deletions NEWS.md
@@ -1,3 +1,7 @@
## version 2.1.1

- Fixed issue with user_login() with httr2.

## version 2.1.0

- Improved support for logging into Genesys with OAuth 2.1
Expand Down
18 changes: 12 additions & 6 deletions R/api-client.R
Expand Up @@ -95,18 +95,24 @@ authorization <- function(authorization) {
#' Login to Genesys as a user
#'
#' The authorization URL will open in a browser, ask the user to grant
#' permissions to R. After successful authentication the browser will
#' display a message:
#' permissions to R.
#'
#' ```
#' Authentication complete. Please close this page and return to R.
#' ```
#'
#' After successful authentication the browser will display the message:
#' "Authentication complete. Please close this page and return to R."
#'
#' Close the browser and return to R.
#'
#' @param redirect_uri a custom redirect_uri to submit as part of the authentication request.
#' This is most useful if the default port is blocked and you wish to specify
#' another port: `redirect_uri = "http://127.0.0.1:44211"`.
#' Note that using `http://localhost` will not work.
#' @seealso \code{\link{setup}}
#'
#' @importFrom httr2 oauth_client oauth_flow_auth_code
#' @export
user_login <- function() {
user_login <- function(redirect_uri = "http://127.0.0.1:48913") {

# browser()
client <- oauth_client(
Expand All @@ -118,7 +124,7 @@ user_login <- function() {
)
if (interactive()) {
message("Please login to Genesys in the browser window");
token <- oauth_flow_auth_code(client, pkce = T, host_name = "127.0.0.1", scope = "openid", auth_url = paste0(.genesysEnv$server, "/oauth/authorize"))
token <- oauth_flow_auth_code(client, pkce = T, scope = "openid", redirect_uri = redirect_uri, auth_url = paste0(.genesysEnv$server, "/oauth/authorize"))
# browser()
authorization(paste("Bearer", token$access_token))
invisible(token)
Expand Down
4 changes: 2 additions & 2 deletions inst/doc/tutorial.html
Expand Up @@ -12,7 +12,7 @@

<meta name="author" content="Matija Obreza &amp; Nora Castaneda" />

<meta name="date" content="2023-10-13" />
<meta name="date" content="2024-02-23" />

<title>genesysr Tutorial</title>

Expand Down Expand Up @@ -340,7 +340,7 @@

<h1 class="title toc-ignore">genesysr Tutorial</h1>
<h4 class="author">Matija Obreza &amp; Nora Castaneda</h4>
<h4 class="date">2023-10-13</h4>
<h4 class="date">2024-02-23</h4>



Expand Down
4 changes: 2 additions & 2 deletions inst/doc/validation.html
Expand Up @@ -12,7 +12,7 @@

<meta name="author" content="Matija Obreza" />

<meta name="date" content="2023-10-13" />
<meta name="date" content="2024-02-23" />

<title>Validating passport data</title>

Expand Down Expand Up @@ -239,7 +239,7 @@

<h1 class="title toc-ignore">Validating passport data</h1>
<h4 class="author">Matija Obreza</h4>
<h4 class="date">2023-10-13</h4>
<h4 class="date">2024-02-23</h4>



Expand Down
10 changes: 9 additions & 1 deletion man/user_login.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5edf637

Please sign in to comment.