Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Hashicorp Vault:无法从标记中查找命名空间_Python_Amazon Web Services_Aws Lambda_Hashicorp Vault - Fatal编程技术网

Python Hashicorp Vault:无法从标记中查找命名空间

Python Hashicorp Vault:无法从标记中查找命名空间,python,amazon-web-services,aws-lambda,hashicorp-vault,Python,Amazon Web Services,Aws Lambda,Hashicorp Vault,我已在AWS EC2服务器中安装了Hashicorp Vault,并尝试使用AWS Lambda函数和“AWS身份验证”访问存储在Vault中的密钥。但是我得到了以下错误 {u'errors': [u'error performing token check: failed to look up namespace from the token: no namespace']} 我基本上做了以下几点 已在EC2服务器中安装Hashicorp Vault,已启用AWS身份验证 使用AWS角色在

我已在AWS EC2服务器中安装了Hashicorp Vault,并尝试使用AWS Lambda函数和“AWS身份验证”访问存储在Vault中的密钥。但是我得到了以下错误

{u'errors': [u'error performing token check: failed to look up namespace from the token: no namespace']}
我基本上做了以下几点

  • 已在EC2服务器中安装Hashicorp Vault,已启用AWS身份验证

  • 使用AWS角色在Vault中设置策略和角色

  • 创建了一个基于Python的AWS Lambda函数,该函数生成已签名的AWS STS请求

  • 使用已签名的请求,成功登录到vault服务器。答复如下

    {
    u'lease_id':  u'',
     u'warnings':  [
        u'TTL of "768h" exceeded the effective max_ttl of "500h"; TTL value is capped accordingly'
    ],
     u'wrap_info':  None,
     u'auth':  {
        u'token_policies':  [
            u'default',
             u'examplepolicy'
        ],
         u'orphan':  True,
         u'entity_id':  u'xxxxxxxxxxxxxx',
         u'token_type':  u'service',
         u'lease_duration':  1800000,
         u'policies':  [
            u'default',
             u'examplepolicy'
        ],
         u'client_token':  u'xxxxxxxxxxxxxx',
         u'accessor':  u'xxxxxxxxxxxxxx',
         u'renewable':  True,
         u'metadata':  {
            u'auth_type':  u'iam',
             u'account_id':  u'xxxxxxxxxxxxxx',
             u'role_id':  u'xxxxxxxxxxxxxx'
        }
    },
     u'lease_duration':  0,
     u'request_id':  u'xxxxxxxxxxxxxx',
     u'data':  None,
     u'renewable':  False
    
    }

  • 现在使用上面的客户机令牌,尝试获取一个密钥,如下所示

    secretKey=requests.get(url1,headers={“X-Vault-Token”:clienttoken})

  • 执行上述行后,我立即出现以下错误

    {u'errors':[u'执行令牌检查时出错:无法从令牌中查找命名空间:无命名空间']}