Closed cansavvy closed 10 months ago
It seems like auth_from_secret()
is a function that uses the "secrets" that we provided to the ottrpal R package to obtain a token. If so, should we just get rid of all the function arguments (access_token
and refresh_token
) so that when we run auth_from_secret()
, we run this chunk no matter what:
decrypted <- openssl::aes_cbc_decrypt(
readRDS(encrypt_creds_user_path()),
key = readRDS(key_encrypt_creds_path())
)
and we create decrypted
. When I supply a value to access_token
and refresh_token
, then the above code chunk doesn't run since its inside an if statement, and the following code chunk throws an error since it doesn't know what decrypted
is:
credentials <- list(
access_token = unserialize(decrypted)[[1]]$access_token,
expires_in = 3599L,
refresh_token = unserialize(decrypted)[[1]]$refresh_token,
scope = scopes_list,
token_type = "Bearer"
)
@cansavvy Looks good. Merged.
Purpose/implementation Section
What changes are being implemented in this Pull Request?
This was something we pair coded on. Basically if credentials aren't supplied we want to use a dummy credential to grab slides that are public anyway.
This code should do that with some encryption steps as well.
This is a PR based off the conversation here: https://github.com/jhudsl/ottrpal/pull/116#issuecomment-1661231230