Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
167 stars 75 forks source link

Extending B-PIPE Authentication Methods #342

Closed rharlow86 closed 1 year ago

rharlow86 commented 3 years ago

It seems like B-PIPE has a variety of authentication methods available. Does #288 , only work with just the application name? It seems I am able to "authenticate" with BPIPE just through passing a connection that has a host of the BPIPE server and the name of a BPIPE application. Doesn't that make it "easy" for someone in a firm to use BPIPE even if they aren't entitled or am I missing something? Has anyone attempted, or is anyone interested in, extending the project to include some of the other BPIPE authentication options described here: https://data.bloomberglp.com/professional/sites/10/2017/03/BLPAPI-Core-Developer-Guide.pdf (see section 3.1)

It seems there are a couple authentication "types":

Also, has anyone been able to authenticate with BPIPE as a user, rather than an application?

Thanks and sorry if my questions don't quite make sense I am pretty green when it comes to BPIPE. I'm happy to put in a little legwork here, just want to canvas the contributors first - it's quite possible that there is a lot of "user error" going on on my end.

johnlaing commented 3 years ago

I'm not a user of BPIPE myself so I'm not familiar with the different authentication mechanisms. I'll tag in @alfredkanzler who did the heavy lifting on #288, he might be able to quickly point out if there's an error in the way you're thinking about it.

rharlow86 commented 3 years ago

Thanks. I had a call with BBG support yesterday and it seems that there are basically two authentication types for BPIPE: one that requires just the application name (what is currently implemented in Rblpapi) and one that requires both the application name and the IP address of a computer where a user is signed into a terminal (similar to what Rblpapi does for SAPI, except there is no uuid). I plan to do a little more digging here to validate this, but if the later is actually a valid way to authenticate with BPIPE as a user, the patch is hopefully as "easy" as making this function handle the use case of a non-null IP address. Keep you posted.

rharlow86 commented 1 year ago

@johnlaing @eddelbuettel I finally had a chance to look into this today and I have a working example. I'll play around a bit more to try to make a minimal PR, but I think I can do this with a new method in authenticate.cpp (authenticateWithAppAndId?) and a couple minimal changes to blpAuthenticate.R

rharlow86 commented 1 year ago

okay, I have a patch ready - what is your preferred approach to pull requests?

eddelbuettel commented 1 year ago

Best practice, and our working mode, is to do it here from a branch or fork. I currently do not even have Bbg access and I do not if any one of us use B-PIPE so that is a small wart -- but we can certainly look at code, see if it builds and so on.

rharlow86 commented 1 year ago

I tried to push a branch to this repo, but I wasn't allowed to write - it could be my own stupidity as I am more familiar with gitlab, but I made a mock pull-request on a local fork: https://github.com/rharlow86/Rblpapi/pull/1 so you can see what you are getting into...

eddelbuettel commented 1 year ago

That is I believe fairly common. But if you start with a fork, the 'parentrepo' link is remembered and as soon as you make a commit you have an easy option to form a pull request.

What is you current checkout? A clone plus your edits? You can (in .git/config) edit the state if you're comfortable doing that; that would preserve your local commit history if you care. Else you could (temporarily) rename your clone, do a fresh fork and pull that and just copy your changes it. It's git so there a million ways, including quite a few which may shoot your left foot off.

rharlow86 commented 1 year ago

thanks, I just forked via gitlab and cherry-picked my one commit - thanks for bearing with me!

johnlaing commented 1 year ago

@rharlow86 Thanks for your work on this! I was (finally) able to get tests run and everything works. Merged/closed.

rharlow86 commented 1 year ago

@johnlaing thanks for merging in - was a pleasure to work with you and @eddelbuettel! I tested both the old BPIPE functionality (app only) and new functionality (app name + user) on master just to be sure and everything looks good to me as well. Happy to help with BPIPE testing in the future for other folks PRs, just ping me.