Skip to main content
https://travis-ci.org/Automatic/oktadboto.svg?branch=master https://img.shields.io/pypi/v/oktadboto.svg?style=flat-square https://img.shields.io/pypi/pyversions/oktadboto.svg?style=flat-square https://img.shields.io/pypi/implementation/oktadboto.svg?style=flat-square https://img.shields.io/badge/code%20style-black-000000.svg

Installation

The oktadboto project is public and can be installed from pypi with pip for python3 on mac and linux.

pip install oktadboto

Requires

This library makes system call to oktad to get new session credentials oktad

Usage

After activating your credentials for an oktad profile using you username, password and mfa token you should be able to get new AWS session credentials without authenticating for upto 24 hours. AWS Sessions last only one hour though. Use otkadboto to create an AWS Session using RefreshableCredentials that can make a system call to get a fresh session token every hour.

1) Confirm that you can run oktad {PROFILE_NAME} -- env in your shell to get environment variables for AWS_SESSION_TOKEN, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY.

  1. Example code to create a boto3 s3 client resource

from oktadboto import oktadboto_session
refreshing_boto_session = oktadboto_session('{PROFILE_NAME}')
s3_client = refreshing_boto_session.client('s3')
s3_client.download_fileobj(...)
  1. The RefreshableCredentials will work until you need to reauthenticate with Oktad, usually 24 hours.

Development

Git clone the respository:

git clone git@github.com:upserve/otkadboto.git

Pip install the development dependencies in a virtual environment:

pip install -e .[dev]

Run unit tests:

python -m unittest -v

Run flake8:

flake8 .

Run black:

black .

Metadata

Release files for oktadboto 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oktadboto 0.0.3
File Size Uploaded
oktadboto-0.0.3.tar.gz 3.6 kB Details

Release files / oktadboto-0.0.3.tar.gz

Download URL oktadboto-0.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
390a1ca55b547d4810bf1dd401b9538afd3003b5a4d06e3aa523719cf7e55f10
BLAKE2b-256 checksum
How to use checksums
0dae1a41d5064b56fb15f07fc18612f3fdba5e06149f700068b937235687cd0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page