https://github.com/awslabs/aws-iot-core-credential-provider-session-helper

This package provides an easy way to create a refreshable Boto3 Session using the AWS IoT Core credential provider.

https://github.com/awslabs/aws-iot-core-credential-provider-session-helper

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords

aws iam iot python
Last synced: 5 months ago · JSON representation

Repository

This package provides an easy way to create a refreshable Boto3 Session using the AWS IoT Core credential provider.

Basic Info
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • Open Issues: 16
  • Releases: 11
Topics
aws iam iot python
Created about 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

AWS IoT Core Credential Provider Session Helper

PyPI Status Python Version License

Tests codecov

pre-commit Black

This package provides an easy way to create a refreshable Boto3 Session using the AWS IoT Core credential provider.

Package documentation

Features

  • Automatic refresh of Boto3 credentials through requests to the AWS IoT Core credential provider. No need to manage or maintain refresh times.
  • Uses the underlying AWS CRT Python bindings for querying the credential provider instead of the Python standard library. This provides support for both certificate and private keys as files or as environment variables.
  • Extensible to using other TLS methods such as PKCS#11 hardware security modules (see Advanced section).
  • Only requires four function calls to create a session helper, Boto3 session, Boto3 client, and then client API calls.

Requirements

  • Python 3.8 - 3.11. Support not include for 3.7 as that version will be end of life in June, 2023. If 3.7 support is important, please open an issue to discuss.

Installation

You can install AWS IoT Core Credential Provider Session Helper via pip from PyPI:

console python3 -m pip install awsiot-credentialhelper

Usage

Prior to use, ensure all cloud-side resources for IAM and AWS IoT Core have been properly created and configured. Then, with the AWS IoT registered X.509 certificate and corresponding private key (e.g., iot_thing.pem and iot_thing.pem.key), you can create and use the helper as follows:

```python from awsiotcredentialhelper.boto3session import Boto3SessionProvider

Create boto3 session object

boto3session = Boto3SessionProvider( endpoint="yourendpoint.credentials.iot.us-west-2.amazonaws.com", rolealias="yourawsiotrolealiasname", certificate="iotthing.pem", privatekey="iotthing.pem.key", thingname="iotthing", ).getsession()

Use in regular Boto3 chained operations, such as returning caller identity

print(boto3session.client("sts").getcalleridentity()) {'UserId': 'AROA...F3D:4686c...0a0d', 'Account': '1234567890', 'Arn': 'arn:aws:sts::1234567890:assumed-role/iamrole_name/4686c...0a0d', 'ResponseMetadata': {'RequestId': 'cc04...10bc', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'cc04...10bc', 'content-type': 'text/xml', 'content-length': '554', 'date': 'Tue, 21 Feb 2023 21:18:23 GMT'}, 'RetryAttempts': 0}}

Or by creating a service client and making API calls

iot = boto3session.client("iot") result = iot.listthings() ```

Please see the package documentation for more details and advanced use.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the Apache 2.0 license. Details on third party packages used by this package can be found here.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project template was generated from a fork of @cjolowicz's Hypermodern Python Cookiecutter template.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
  • Delete event: 66
  • Issue comment event: 63
  • Pull request event: 134
  • Create event: 70
Last Year
  • Issues event: 1
  • Watch event: 1
  • Delete event: 66
  • Issue comment event: 63
  • Pull request event: 134
  • Create event: 70

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 58
  • Total Committers: 2
  • Avg Commits per committer: 29.0
  • Development Distribution Score (DDS): 0.017
Top Committers
Name Email Commits
Gavin Adams g****s@a****m 57
Amazon GitHub Automation 5****o@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 543
  • Average time to close issues: N/A
  • Average time to close pull requests: 15 days
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.94
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 527
Past Year
  • Issues: 1
  • Pull requests: 198
  • Average time to close issues: N/A
  • Average time to close pull requests: 11 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.88
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 192
Top Authors
Issue Authors
  • dependabot[bot] (2)
  • michaelthomasletts (1)
Pull Request Authors
  • dependabot[bot] (736)
  • gadams999 (23)
Top Labels
Issue Labels
dependencies (2) python (2)
Pull Request Labels
dependencies (736) python (660) github_actions (76) refactoring (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 4,798 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 13
  • Total maintainers: 1
pypi.org: awsiot-credentialhelper

AWS IoT Core Credential Provider Session Helper

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 4,798 Last month
Rankings
Dependent packages count: 6.6%
Downloads: 10.9%
Average: 19.4%
Forks count: 23.2%
Stargazers count: 25.5%
Dependent repos count: 30.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/labeler.yml actions
  • actions/checkout v3 composite
  • crazy-max/ghaction-github-labeler v4.1.0 composite
.github/workflows/publish-docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peaceiris/actions-gh-pages v3.9.2 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish v1.6.4 composite
  • release-drafter/release-drafter v5.22.0 composite
  • salsify/action-detect-and-tag-new-version v2.0.3 composite
.github/workflows/tests.yml actions
  • actions/cache v3 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3.1.1 composite
  • haya14busa/action-cond v1 composite
docs/requirements.txt pypi
  • furo ==2022.12.7
  • myst_parser ==0.18.1
  • sphinx ==6.1.3
  • sphinx-click ==4.4.0
poetry.lock pypi
  • 103 dependencies
pyproject.toml pypi
  • Pygments >=2.10.0 develop
  • black >=21.10b0 develop
  • coverage >=6.2 develop
  • darglint >=1.8.1 develop
  • flake8 >=4.0.1 develop
  • flake8-bandit >=2.1.2 develop
  • flake8-bugbear >=21.9.2 develop
  • flake8-docstrings >=1.6.0 develop
  • flake8-rst-docstrings >=0.2.5 develop
  • furo >=2021.11.12 develop
  • isort >=5.10.1 develop
  • mypy >=0.930 develop
  • myst-parser >=0.16.1 develop
  • pep8-naming >=0.12.1 develop
  • pre-commit >=2.16.0 develop
  • pre-commit-hooks >=4.1.0 develop
  • pytest >=6.2.5 develop
  • pyupgrade >=2.29.1 develop
  • safety >=1.10.3 develop
  • sphinx >=4.3.2 develop
  • sphinx-autobuild >=2021.3.14 develop
  • sphinx-click >=3.0.2 develop
  • typeguard >=2.13.3 develop
  • xdoctest >=0.15.10 develop
  • awscrt ^0.16.9
  • boto3 ^1.20.27
  • botocore ^1.23.27
  • python ^3.8
  • typing-extensions ^4.5.0