{"id":15710268,"url":"https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin","last_synced_at":"2025-10-20T03:32:33.831Z","repository":{"id":47736794,"uuid":"304424589","full_name":"aws/aws-sigv4-auth-cassandra-python-driver-plugin","owner":"aws","description":"A SigV4 authentication plugin for the open-source Python Driver for Apache Cassandra. Allows use of IAM users and roles.","archived":false,"fork":false,"pushed_at":"2023-04-10T08:59:41.000Z","size":23,"stargazers_count":6,"open_issues_count":0,"forks_count":12,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-01-28T19:48:28.690Z","etag":null,"topics":["amazon-keyspaces","aws","aws-sigv4","cassandra","cql","datastax-python-driver","keyspaces","sigv4","sigv4client"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aws.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-15T19:10:37.000Z","updated_at":"2024-04-28T19:00:57.000Z","dependencies_parsed_at":"2024-06-19T17:10:43.248Z","dependency_job_id":"af4bf401-dd5d-4d29-bee2-62a09f532292","html_url":"https://github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin","commit_stats":{"total_commits":7,"total_committers":6,"mean_commits":"1.1666666666666667","dds":0.7142857142857143,"last_synced_commit":"6d8b77b4fd1be84f44e569227e0be5ef584b31b3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sigv4-auth-cassandra-python-driver-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sigv4-auth-cassandra-python-driver-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sigv4-auth-cassandra-python-driver-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aws%2Faws-sigv4-auth-cassandra-python-driver-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aws","download_url":"https://codeload.github.com/aws/aws-sigv4-auth-cassandra-python-driver-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237261324,"owners_count":19281201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-keyspaces","aws","aws-sigv4","cassandra","cql","datastax-python-driver","keyspaces","sigv4","sigv4client"],"created_at":"2024-10-03T21:05:27.142Z","updated_at":"2025-10-20T03:32:28.377Z","avatar_url":"https://github.com/aws.png","language":"Python","readme":"# IMPORTANT: Latest Version\n\nThe current version is 4.0.2. Please see the [changelog](./CHANGELOG.md) for details on version history.\n\n# What\n\nThis package implements an authentication plugin for the open-source Datastax Python Driver for Apache Cassandra.\nThe driver enables you to add authentication information to your API requests using the AWS Signature Version 4 Process (SigV4).\nUsing the plugin, you can provide users and applications short-term credentials to access Amazon Keyspaces (for Apache Cassandra)\nusing AWS Identity and Access Management (IAM) users and roles.\n\nThe plugin depends on the AWS SDK for Python (Boto3). It uses `boto3.Session` to obtain credentials.\n\n\n# Example Usage\n\n``` python\nssl_context = SSLContext(PROTOCOL_TLSv1_2)\nssl_context.load_verify_locations('./AmazonRootCA1.pem')\nssl_context.verify_mode = CERT_REQUIRED\nboto_session = boto3.Session(aws_access_key_id=\"AKIAIOSFODNN7EXAMPLE\",\n                             aws_secret_access_key=\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n                             aws_session_token=\"AQoDYXdzEJr...\u003cremainder of token\u003e\",\n                             region_name=\"us-east-2\")\nauth_provider = SigV4AuthProvider(boto_session)\ncluster = Cluster(['cassandra.us-east-2.amazonaws.com'], ssl_context=ssl_context, auth_provider=auth_provider,\n                  port=9142)\nsession = cluster.connect()\nr = session.execute('select * from system_schema.keyspaces')\nprint(r.current_rows)\n```\n\n# Using the Plugin\n\nThe following sections describe how to use the authentication plugin for the open-source DataStax Python Driver for Cassandra to access Amazon Keyspaces.\n\n## SSL Configuration\n\nThe first step is to get an Amazon digital certificate to encrypt your connections using Transport Layer Security (TLS).\nThe DataStax Python driver must use an SSL CA certificate so that the client SSL engine can validate the Amazon Keyspaces\ncertificate on connection.\n\n``` python\nssl_context = SSLContext(PROTOCOL_TLSv1_2)\nssl_context.load_verify_locations('./AmazonRootCA1.pem')\nssl_context.verify_mode = CERT_REQUIRED\n```\n\n## Region Configuration\n\nBefore you can start using the plugin, you must configure the AWS Region that the plugin will use when authenticating.\nThis is required because SigV4 signatures are Region-specific. For example, if you are connecting to the `cassandra.us-east-2.amazonaws.com` endpoint,\nthe Region must be `us-east-2`. For a list of available AWS Regions and endpoints, see [Service Endpoints for Amazon Keyspaces](https://docs.aws.amazon.com/keyspaces/latest/devguide/programmatic.endpoints.html).\n\nYou can specify the Region using one of the following four methods:\n\n* Environment Variable\n* Constructor\n* Boto3 Session Configuration\n\n## Environment Variable\n\nYou can use the `AWS_DEFAULT_REGION` environment variable to match the endpoint that you are\ncommunicating with by setting it as part of your application start-up, as follows.\n\n``` shell\n$ export AWS_DEFAULT_REGION=us-east-2\n```\n\n## Constructor\n\nYou can either provide the constructor for `SigV4AuthProvider` with a boto3 session, aws credentials and a region,\nor a parameterless constructor to follow the default boto3 credential discovery path.\n\n## Install the plugin in your environment\n\n``` shell\npip install cassandra-sigv4\n```\n\n## Programmatically Configure the Driver With a boto3 session\n\nNote that if a session is provided, all other arguments for the constructor are ignored.\n\n``` python\nboto_session = boto3.Session(aws_access_key_id=\"AKIAIOSFODNN7EXAMPLE\",\n                             aws_secret_access_key=\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n                             aws_session_token=\"AQoDYXdzEJr...\u003cremainder of token\u003e\",\n                             region_name=\"us-east-2\")\nauth_provider = SigV4AuthProvider(boto_session)\ncluster = Cluster(['cassandra.us-east-2.amazonaws.com'], ssl_context=ssl_context, auth_provider=auth_provider,\n                  port=9142)\n```\n\n## Programmatically Configure the Drive with raw AWS Credentials\n\n``` python\nauth_provider = SigV4AuthProvider(aws_access_key_id=\"AKIAIOSFODNN7EXAMPLE\",\n                                  aws_secret_access_key=\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n                                  aws_session_token=\"AQoDYXdzEJr...\u003cremainder of token\u003e\",\n                                  region_name=\"us-east-2\")\ncluster = Cluster(['cassandra.us-east-2.amazonaws.com'], ssl_context=ssl_context, auth_provider=auth_provider,\n                  port=9142)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Faws-sigv4-auth-cassandra-python-driver-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faws%2Faws-sigv4-auth-cassandra-python-driver-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faws%2Faws-sigv4-auth-cassandra-python-driver-plugin/lists"}