-
Notifications
You must be signed in to change notification settings - Fork 543
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
add convenience method for authenticating with astra via db_id and token #1228
base: master
Are you sure you want to change the base?
Conversation
cassandra/cluster.py
Outdated
if 'db_id' in cloud and 'token' in cloud: | ||
# download SCB if necessary | ||
if 'secure_connect_bundle' not in cloud: | ||
bundle_path = f'astra-secure-connect-{cloud["db_id"]}.zip' |
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.
Since each region within a given Astra DB cluster has its own SCB, how do we handle a multi-region scenario here?
If you have a good solution, I can give it a try. Otherwise I'm happy for this to be a single region option.
|
Hi @jbellis please review the patch that I've submitted here to your fork, jbellis#1 The signature when specifying the region identifier will now be:
and if the region identifier is not provided, the signature will be as follows and we will just return the SCB URL for the primary region (will work for single-region scenario too),
and this work both for single- as well as multi-region Astra DB clusters. Let me know WDYT? Thank you in advance! |
Improvized Astra DB connection based on the given region
… error handling when region not found
We've had discussions about adding automatic download of the SCB into the drivers as an option in the past and in the end the decision has always been not to do so. That API has changed underneath us in the past IIRC but far more importantly it makes the DevOps API outages production-level issues for lots of clients... and DBPE has expressed some reservation about elevating that API to that status. @joao-r-reis I know you and I have had these discussions in the past. Did I misrepresent/get anything wrong in the description above? |
We need some kind of solution here, the number of manual clicks required to download the scb is way beyond "I have better things to do with my time" for most devs. Especially now that the Astra UI prioritizes data API so hard.
|
It's a public, documented API. I think this is a non issue now. https://docs.datastax.com/en/astra-api-docs/_attachments/devops-api/index.html#tag/Database-Operations/operation/listDatacenters |
would caching it on disk alleviate your concern @absurdfarce |
It doesn't @phact. The API stability concerns are definitely a second-tier issue. The much larger issue for me is that we have spoken with ProdEng about this specific change and been told that we don't know that the relevant APIs/downloads were something that should be exposed for broad public use at the rates we'd expect from wide deployment of the drivers. Even if that were no longer the case I wouldn't want to address this as a one-off for a single driver. I'd prefer to see a proposal to fix this handled as part of our product planning process so that we can deploy it uniformly to all drivers in a way that keeps the interface reasonably consistent. I'll raise this with our product folks so that they're aware of it. |
|
example usage: