没有项目描述

secretcli的Python项目详细描述


secretcli项目提供了一个简单易用的命令行界面 这是AWS Secrets Manager。 它能够上传或下载整个秘密以及 处理单个字段。

安装

此项目在上可用 pypi并且可以与 皮普。

pip3 install secretcli

用法

初始化新机密

新的秘密很容易开始。这将在 aws secret manager并存储一个空的javascript对象作为第一个 版本。

$ secretcli init TestSecret

使用单个钥匙

可以使用一个 命令。在幕后,下载现有的数据库,更新 它使用新的键/值对,并将其作为当前版本上载。

$ secretcli set TestSecret postgreshost 10.10.10.16
$ secretcli set TestSecret postgresuser postgres
$ secretcli set TestSecret postgrespassword super_secret_string
$ secretcli set TestSecret longstring "This is a string with spaces."

检索值也同样简单。这在尝试 在bash脚本中使用值。

$ secretcli get TestSecret postgreshost
10.10.10.16
$ secretcli get TestSecret postgresuser
postgres
$ secretcli get TestSecret postgrespassword
super_secret_string

值也可以从机密中完全删除。

$ secretcli get TestSecret postgreshost
10.10.10.16
$ secretcli remove TestSecret postgreshost
$ secretcli get TestSecret postgreshost

避免将值直接传递到控制台(可能 将其记录在bash history等位置)可以传递-s标志 并且可以交互地传递值而不显示它。

$ secretcli set TestSecret postgrespassword -s
Value:
Repeat for confirmation:
$ secretcli get TestSecret postgrespassword
super_secret_string

处理整个文件

整个秘密可以作为文件下载。这个命令有效 不管文件的格式如何-不由管理的机密 secretcli可以使用此工具下载。

$ secretcli download TestSecret ./secret_configuration.json

文件也可以上传-但要小心,它会被上传 完全一样,没有任何json格式的验证。

$ secretcli upload TestSecret ./secret_configuration.json

数据存储格式

secretcli将数据存储为json对象,试图 尽可能互操作。传递给secretcli的每个key都是 由json对象中的key表示。

在aws secret manager中存储时,secretcli使用 SecretString字段在aws机密管理器中。这使得 在aws控制台中作为原始字符串和使用 键/值表。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
与ReentrantLock相比,java ReentrantReadWriteLock的性能非常差   java如何使用Maven Android Studio正确导入?   安卓将ADB添加到我的Java PC应用程序   反射Java getDeclaredConstructor失败,来自JUnit的NoSuchMethodException   JSP上siteedit标记库的java替代   JavaSpring环境概要文件和JPA   java中是否有一个类似于StringBuilder的类,唯一的区别是它具有固定的长度?   JavaMathContext。小数点32 vs MathContext。小数点64,使用哪一个,为什么?   java使用spring在Ibm Websphere MQ中实现重试逻辑   java调用SpriteBatch。开始()和结束()   java有一种从文本中读取文本的方法。文件,并将其设置为pom中的maven属性。xml专家?   java让sitemesh使用struts2   Java Swing:在现有窗口上定位对话框   使用带有MemSql的JPA本机查询的java Select json列