-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Supplying authorization to get slide notes for ottrpal #118
Conversation
R/auth.R
Outdated
} | ||
|
||
credentials <- list( | ||
access_token = unserialize(decrypted)[[1]]$access_token, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If user provides the access_token
and refresh_token
as arguments, then this line won't be able to find decrypted
object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right! We need to have this defined as access_token
and refresh_token
above in the if statement
R/auth.R
Outdated
credentials <- list( | ||
access_token = unserialize(decrypted)[[1]]$access_token, | ||
expires_in = 3599L, | ||
refresh_token = unserialize(decrypted)[[1]]$refresh_token, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above: If user provides the access_token
and refresh_token
as arguments, then this line won't be able to find decrypted object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this comment make sense? @howardbaek Do you know how to fix this? If not I can send suggestions.
R/auth.R
Outdated
} | ||
|
||
credentials <- list( | ||
access_token = unserialize(decrypted)[[1]]$access_token, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right! We need to have this defined as access_token
and refresh_token
above in the if statement
It seems like
and we create
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@howardbaek this is what I was trying to describe to fix this. Let me know if this makes sense.
decrypted <- openssl::aes_cbc_decrypt( | ||
readRDS(encrypt_creds_user_path()), | ||
key = readRDS(key_encrypt_creds_path()) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) | |
) | |
access_token <- unserialize(decrypted)[[1]]$access_token | |
refresh_token <- unserialize(decrypted)[[1]]$refresh_token |
I'm doing this on my phone but this is what I'm suggesting you do. Bring the phrases from below up here (not sure if I typed these right) and declare the variables. Then below just specify access_token = access_token
and same for refresh_token.
If this doesn't make sense, let me know and I'll send a commit later.
@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: #116 (comment)