Implements means of authorization delegation on cloud-based resource providers.
Project description
CloudAuthz
Installation
Install the latest release from PyPi:
pip install cloudauthz
Example
CloudAuthz can authorize access to Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). An example for each provider is given in the following.
Amazon Web Services
from cloudauthz import *
cloudauthz = CloudAuthz()
config = {
"id_token": " ... ",
"role_arn": " ... "
}
credentials = cloudauthz.authorize("aws", config)
The credentials
object is a dictionary as the following:
{
"SecretAccessKey": " ... ",
"SessionToken": " ... ",
"Expiration": "2019-05-28T02:12:45Z",
"AccessKeyId": " ... "
}
Microsoft Azure
from cloudauthz import *
cloudauthz = CloudAuthz()
config = {
"tenant_id": " ... ",
"client_id": " ... ",
"client_secret": " ... "
}
credentials = cloudauthz.authorize("azure", config)
The credentials
object is a dictionary as the following:
{
"expiresIn": 3599,
"_authority": "https://login.microsoftonline.com/TENANT_ID",
"resource": "https://storage.azure.com/",
"tokenType": "Bearer",
"expiresOn": "2018-06-28 12:30:24.895661",
"isMRRT": true,
"_clientId": " ... ",
"accessToken": " ... ",
}
Google Cloud Platform
from cloudauthz import *
cloudauthz = CloudAuthz()
config = {
"client_service_account": " ... ",
"server_credentials": " ... "}
credentials = cloudauthz.authorize("gcp", config)
The credentials
object is an instance of cloudauthz.providers.gcp.Credentials
that inherits from google.oauth2.service_account.Credentials
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cloudauthz-0.5.0.tar.gz
(7.3 kB
view hashes)
Built Distribution
Close
Hashes for cloudauthz-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4885ec8c1c6971e960617655a6104f28ff7d2b6874e6e730fc8b066a544c84bd |
|
MD5 | 4dd8be9c06ea1a9c2cde2b6b0fb85d4a |
|
BLAKE2b-256 | 937bca74b28c8a0e66a6e519942d0595eed64c61886f3f9b99e97b8873cacf40 |