Skip to content

Commit

Permalink
check if a username is set
Browse files Browse the repository at this point in the history
  • Loading branch information
PietrH committed Apr 2, 2024
1 parent d1ecd1d commit 81c8510
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/get_access_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ get_access_token <-
# check if a keyring exists
iasset_keyring_exists <-
"iasset_password" %in% dplyr::pull(keyring::key_list(), "service")

Check warning on line 30 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L29-L30

Added lines #L29 - L30 were not covered by tests
## check if a username is set
iasset_username_missing <-
dplyr::filter(
keyring::key_list(),
service == "iasset_password"

Check warning on line 35 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L32-L35

Added lines #L32 - L35 were not covered by tests
) %>%
dplyr::pull("username") %>%
is.na()

Check warning on line 38 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L37-L38

Added lines #L37 - L38 were not covered by tests

# check that only one keyring is set
number_of_keyrings <- nrow(keyring::key_list(service = "iasset_password"))
assertthat::assert_that(number_of_keyrings <= 1,
Expand Down

0 comments on commit 81c8510

Please sign in to comment.