Skip to content
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

[Q] Use B-Pipe or terminal only? #14

Open
raszkiewicz opened this issue Apr 30, 2022 · 3 comments
Open

[Q] Use B-Pipe or terminal only? #14

raszkiewicz opened this issue Apr 30, 2022 · 3 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@raszkiewicz
Copy link

Is this a wrapper on BLPAPI terminal only of can I use with B-Pipe as well? If so how can I authenticate using that library?

@matthewgilbert
Copy link
Owner

This should be possible by passing an app name to the constructor and then calling authenticate. That being said I have limited experience with the various bpipe authentication procedures so I would recommend testing you can authenticate via blpapi first if you are having issues

@raszkiewicz
Copy link
Author

raszkiewicz commented May 3, 2022

I have created simple Python code which can authenticate for the session but there I have a problem to append any new subscriptions to that session (async events) . I was able to get events for predefined list of ticker so I have ended up closing and then re-opening session with new subscirptions but it creates lag with getting live events between those sessions. That is how I have end up looking for something that maybe already exists and your solution sounds close to what I'm looking for.

B-Pipe uses mutual TLS authentication with a password to the app. For that, what I can see, you (or I) may need to extend your code to cover part from my code:

    tlsOptions = getTlsOptions(priv_cert, root_cert, password, True)
    session_options.setTlsOptions(tlsOptions)

If I will get anything interesting (and working) back I will do PR but first I will need to figure out how to make it more generic with same approach you have passing them via args (I did that via conf file)

@matthewgilbert matthewgilbert added the question Further information is requested label May 7, 2022
@matthewgilbert
Copy link
Owner

To elaborate on what I wrote above, currently a BlpSession supports authentication via passing in an app and then calling the authenticate method. However, this is only supporting the blpapi.AuthOptions.createWithApp(app) option of authenticating and I believe there are several other ways to authenticate, although I am unfamiliar with these.

One quick and dirty way to handle custom authentication would be to write your own session creation and authentication and then use this. I.e. something like the following

def custom_authenticated_session(session):
    # some logic to authenticate a session
    return session, identity

from blp import blp

bquery = blp.BlpQuery().start()

session, identity = custom_authenticated_session(bquery.session)

bquery.session = session
bquery.identify = identity

@matthewgilbert matthewgilbert added the enhancement New feature or request label May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants