Setting up rfigshare with API keys - r

I have recently installed the rfigshare package. In order to use it, I need to get figshare API keys to to use it properly. The documentation I found so far is obsolete (see here). Does anyone knows the procedure to follow?

From the package README:
The first time you use an rfigshare function, it will ask you to authenticate online. Just log in and click okay to authenticate rfigshare. R will allow you to cache your login credentials so that you won't be asked to authenticate again (even between R sessions), as long as you are using the same working directory in future.
So, just load the package using library("rfigshare") and call any function. You will be automatically prompted to login and store an OAuth credential locally, which will then be automatically used in subsequent function calls.

Related

Install package from github private repo without personal access token

I am trying to install an R package from a GitHub account I currently own and operate. I want to be able to share this R package with other users (i.e. allow them to download) but I want to constrain it to people I approve of.
I could do this by creating a Personal Access Token (PAT) and sharing (remotes::install_github(..., auth_token = "PAT")), but then they would get access to all of my repos on my account which is not an option.
Other options I have seen suggested include;
Creating a new GitHub account just for this R package and creating the PAT on this account to enable sharing of just the one repo
Making public instead of private
Neither of these feels optimal, is there another way?
You could add others as collaborators on your private repo, then they could use their own PAT to access the repo. It's not great idea to share PAT so this way each party is responsible for their own. That will also allow you to easily remove individuals without affecting access for everyone.
I know this is an old question, but I wanted to answer for anyone that finds this thread like I did. The other alternative is to set up a private SSH key (like you would use for git push) and then use remotes::install_git("git#github.com:Organiztation/repository.git",branch = ...). install_git uses the git credentials and supports SSH. install_github uses the GitHub API and does not support SSH.

Create Travis v3 API token for GitHub app

So, the issue is the following: I need to access Travis CI API to get the build status for our organization repositories. The issue here is that using personal GitHub token to generate Travis API token is an overall bad practice, cause the user can leave the organization, or his access rights could be revoked for particular repositories.
The idea was to create a GitHub App, install it to the organization and let the app generate Travis CI tokens using its privileges, and grab the build status programmatically.
I created an app and tried to perform such a trick with the authentication, but it did not work for me.
Any ideas/suggestions are welcome.
As per the answer from the Travis support, it is currently not possible to create API tokens with anything except the personal GitHub token.
The best solution is to create the less-permissive GitHub token, ideally from the GitHub user-account that is used for automation.

Automatic Google Sheets authorization in RShiny

I have an RShiny app that I had published online without any issues until this week. The app uses data stored in a Google Drive account, thus making use of the googlesheets package. When the app was working fine, I used gs_auth() to initially authorize and cache my Google credentials. Because my credentials were cached in a .httr_oauth in my working directory, it meant that when I ran the app's code, it wouldn't take me to a page in my browser that would ask me to authorize the account. When publishing the app to shiny.io, this cached .httr_oauth meant that the app would work online.
This week I made some changes to the app's code and when I ran the app it took me to the Google account authorisation page. There, I would click on the account and it would then say: "Sign in with Google temporarily disabled for this app".
After some looking I found that the googlesheets package is now outdated and I should instead be using the googlesheets4 package. However, after trying to authorize with that package (and the googledrive package) I'm able to get the app to run locally without it taking me to the Google account authorization page, but when I try to publish it still doesn't work. It always times out. Does anyone know what is going on? Anyone else having a similar issue?
I ran into this problem as well.
This outline worked really well for me.
https://gargle.r-lib.org/articles/non-interactive-auth.html
I would focus on Project Level OAthu part of the vignette.
The biggest issues I had for switching from "googlesheet" to "googlesheets4" was I forgot to install the "googledrive" package. The googledrive will allow you to use (drive_auth) and then build out from there as you can cache the authentication token.

Deploy via firebase-tools API without previous login

I'm currently building an open-source microservice that makes use of Firebase Database, Hosting & Functions. The plan is to pack everything in a single binary and distribute this. So users will have a hazzle-free, "bring your own Firebase project"-solution. They'll just have to download the binary and their Firebase secret key and can then create a user and deploy the service via CLI.
The problem is, that firebase-tools require a $FIREBASE_TOKEN when deploying via its API. So users would have to install firebase-tools in order to be able to generate that token and they would also have to store it (or re-generate it frequently).
Since I would like to provide a hazzle-free experience, I'd rather generate that token myself with the help of the secret key.
The question is: is this even possible? And if yes: how??
My workaround for this is to reflect the login- and logout-commands of the Firebase-CLI on my own binary's CLI. So the user won't have to install another tool.
To get the refresh_token I then read the data from the firebase-tools-configstore, that is located in the user folder. This feels a little dirty, like accessing a private API. But I couldn't come up with a better solution. And it works.

Meteor OAuth Add/Pass Query Params to /oauth/authenticate (Twitter "force_login")

I'm creating a package where I allow to connect multiple same service accounts and I need to force the user to login to the account at the popup window every time (do not authenticate automatically) twitter has the option for "force_login" parameter when using Meteor.loginWithTwittertwitter docs
I can't find any way of using it with meteor, I also looked into creating my own twitter/accounts-twitter package but it seems like it's even deeper some where inside oauth packages and it gets really messy to figure out where or how I can do that. Anyone have any ideas?
It was not possible yesterday, but it's possible today. I opened this pull request in the Meteor repository adding this functionality: https://github.com/meteor/meteor/pull/5693
Meteor.loginWithTwitter({ force_login: true }, ...);
Note it's not merged yet, but hopefully it will be soon.

Resources