Skip to main content

Alibaba Cloud Secrets Manager Client implementation for Python

Project description

The Aliyun Secrets Manager Client for Python enables Python developers to easily work with Aliyun KMS Secrets.

Read this in other languages: 简体中文 <https://github.com/aliyun/aliyun-secretsmanager-client-python/blob/master/README.zh-cn.rst>

License

Apache License 2.0

Features

  • Provide quick integration capability to gain secret information

  • Provide Alibaba secrets cache ( memory cache or encryption file cache )

  • Provide tolerated disaster by the secrets with the same secret name and secret data in different regions

  • Provide default backoff strategy and user-defined backoff strategy

Requirements

Python 2.7,3.5,3.6,3.7

Install

Install the official release version through PIP (taking Linux as an example):

$ pip install aliyun-secret-manager-client

You can also install the unzipped installer package directly:

$ sudo python setup.py install

Sample Code

Ordinary User Sample Code

secret_cache_client = SecretManagerCacheClientBuilder.new_client()
secret_info = secret_cache_client.get_secret_info("#secretName#")
  • Build Secrets Manager Client by the given parameters(accessKey, accessSecret, regionId, etc)

secret_cache_client = SecretManagerCacheClientBuilder.new_cache_client_builder(
        DefaultSecretManagerClientBuilder.standard().with_access_key("#accessKeyId#", "#accessKeySecret#")
            .withRegion("#regionId#").build()).build();
secret_info = secret_cache_client.get_secret_info("#secretName#")

Particular User Sample Code

  • Use custom parameters or customized implementation

secret_cache_client = SecretManagerCacheClientBuilder.new_cache_client_builder(
         DefaultSecretManagerClientBuilder.standard().with_access_key("#accessKeyId#", "#accessKeySecret#")
             .with_back_off_strategy(FullJitterBackoffStrategy(3, 2000, 10000))
             .with_region("#regionId#")
             .with_refresh_secret_strategy(FileCacheSecretStoreStrategy("#cacheSecretPath#", True,"#salt#"))
             .with_refresh_secret_strategy(DefaultRefreshSecretStrategy("#ttlName#"))
             .with_cache_stage("#stage#")
             .with_secret_ttl("#secretName#", 1 * 60 * 1000l)
             .build()) \
         .build()
secret_info = secret_cache_client.get_secret_info("#secretName#")

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

aliyun-secret-manager-client-0.0.2.tar.gz (16.9 kB view details)

Uploaded Source

File details

Details for the file aliyun-secret-manager-client-0.0.2.tar.gz.

File metadata

  • Download URL: aliyun-secret-manager-client-0.0.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.2

File hashes

Hashes for aliyun-secret-manager-client-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c925d38fcca693d64f172c3146c7bf2a2d4c1526f937fd607c11f4dce446b7ca
MD5 af1d5d55e7a161b2a86afe6236b1ac0a
BLAKE2b-256 3ac2a548ccacfce2d4ebe07771bc05f4ca0c7205c7f8e511cbae995b20d1aa78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page