Skip to content

[Feature request]: Handle AWS SigV4AuthProvider #55

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

Open
QuentinRichard-weezevent opened this issue Apr 1, 2025 · 3 comments
Open

[Feature request]: Handle AWS SigV4AuthProvider #55

QuentinRichard-weezevent opened this issue Apr 1, 2025 · 3 comments

Comments

@QuentinRichard-weezevent

Hello,

We are using scyllapy on our stack because of its asyncio complete integration.
However, we deploy our application on an AWS stack with AWS Keyspace.
Following the official AWS documentation it seems, we have two solutions for Cassandra authentication:

As it is, scyllapy does not seem to integrate auth_provider feature and this would be a great improvement in AWS integration.

Do you plan to integrate it in the future?

thanks!

@s3rius
Copy link
Member

s3rius commented Apr 1, 2025

Actually scyllapy supports connecting to AWS keyspaces already. Because we were using it with keyspaces.

The scylla class has parameters ssl_cert, ssl_key, ssl_ca_file and ssl_verify_mode.

To connect it to AWS keyspaces please initialize it as this:

import asyncio

from scyllapy import Scylla
from pathlib import Path


async def main():
    cert = Path("sf-class2-root.crt").read_text()
    scylla = Scylla(
        ["cassandra.eu-central-1.amazonaws.com:9142"],
        username="Your given username",
        password="Your secret key",
        ssl_cert=cert,
    )
    await scylla.startup()

    rows = await scylla.execute("SELECT * FROM system.local")
    for row in rows.all():
        print(row)


if __name__ == "__main__":
    asyncio.run(main())

To download the certificate please follow this guide.

https://docs.aws.amazon.com/keyspaces/latest/devguide/using_python_driver.html

@QuentinRichard-weezevent
Copy link
Author

Thanks for your answer!
It will be really helpful to implement in our current stack :)
However, the idea would be to avoid basic username / password authentication but using AWS IAM instead.

@s3rius
Copy link
Member

s3rius commented Apr 4, 2025

I see now. Yes, this thing is not yet possible. We might try implementing it after we update the whole library. Because currently it needs a lot of rewrite since underlying scylla driver has been updated to first stable version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants