Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.10.9 #681

Merged
merged 11 commits into from
Apr 2, 2021
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.10.8
current_version = 0.10.9
commit = True
tag = True

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.10.9 (April 2nd, 2021)

### 🐛 Bug Fixes

- Send AppRole generate_secret_id Method Metadata Parameter as String GH-689

### 📚 Documentation

- Fix lambda authentication example in aws auth documentation. GH-675
- Docs(secret_engines/pki): Remove 'self' from examples. GH-676

Thanks to @JPoser, @fhemberger, @jeffwecan, @lperdereau and jposer for their lovely contributions.

## 0.10.8 (February 8th, 2021)

### 🚀 Features
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
author = u'Ian Unruh, Jeffrey Hogan'

# The short X.Y version
version = '0.10.8'
version = '0.10.9'
# The full version, including alpha/beta/rc tags
release = '0.10.8'
release = '0.10.9'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/auth_methods/aws.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ Lambda and/or EC2 Instance
def infer_credentials_from_iam_role(iam_role):
on_lambda = 'AWS_LAMBDA_FUNCTION_NAME' in os.environ
if on_lambda:
return os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_ACCESS_KEY']
return os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_ACCESS_KEY'], os.environ['AWS_SESSION_TOKEN']
else:
security_credentials = load_aws_ec2_role_iam_credentials(iam_role)
return security_credentials['AccessKeyId'], security_credentials['SecretAccessKey']


access_key_id, secret_access_key = infer_credentials_from_iam_role('some-role')
access_key_id, secret_access_key, session_token = infer_credentials_from_iam_role('some-role')

client = hvac.Client()
client.auth.aws.iam_login(access_key_id, secret_access_key, session_token)
Expand Down
50 changes: 25 additions & 25 deletions docs/usage/secrets_engines/pki.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Read CA Certificate Chain
import hvac
client = hvac.Client()

read_ca_certificate_chain_response = self.client.secrets.pki.read_ca_certificate_chain()
read_ca_certificate_chain_response = client.secrets.pki.read_ca_certificate_chain()
print('Current PKI CA Certificate Chain: {}'.format(read_ca_certificate_chain_response))


Expand All @@ -39,7 +39,7 @@ Read Certificate
import hvac
client = hvac.Client()

read_certificate_response = self.client.secrets.pki.read_certificate(serial='crl')
read_certificate_response = client.secrets.pki.read_certificate(serial='crl')
print('Current PKI CRL: {}'.format(read_certificate_response))


Expand All @@ -53,7 +53,7 @@ List Certificates
import hvac
client = hvac.Client()

list_certificate_response = self.client.secrets.pki.list_certificates()
list_certificate_response = client.secrets.pki.list_certificates()
print('Current certificates (serial numbers): {}'.format(list_certificate_response))


Expand All @@ -67,7 +67,7 @@ Submit CA Information
import hvac
client = hvac.Client()

submit_ca_information_response = self.client.secrets.pki.submit_ca_information(
submit_ca_information_response = client.secrets.pki.submit_ca_information(
'-----BEGIN RSA PRIVATE KEY-----\n...\n-----END CERTIFICATE-----'
)

Expand All @@ -82,7 +82,7 @@ Read CRL Configuration
import hvac
client = hvac.Client()

read_crl_configuration_response = self.client.secrets.pki.read_crl_configuration()
read_crl_configuration_response = client.secrets.pki.read_crl_configuration()
print('CRL configuration: {}'.format(read_crl_configuration_response))


Expand All @@ -96,7 +96,7 @@ Set CRL Configuration
import hvac
client = hvac.Client()

set_crl_configuration_response = self.client.secrets.pki.set_crl_configuration(
set_crl_configuration_response = client.secrets.pki.set_crl_configuration(
expiry='72h',
disable=False
)
Expand All @@ -112,7 +112,7 @@ Read URLs
import hvac
client = hvac.Client()

read_urls_response = self.client.secrets.pki.read_urls()
read_urls_response = client.secrets.pki.read_urls()
print('Get PKI urls: {}'.format(read_urls_response))


Expand All @@ -126,7 +126,7 @@ Set URLs
import hvac
client = hvac.Client()

set_urls_response = self.client.secrets.pki.set_urls(
set_urls_response = client.secrets.pki.set_urls(
{
'issuing_certificates': ['http://127.0.0.1:8200/v1/pki/ca'],
'crl_distribution_points': ['http://127.0.0.1:8200/v1/pki/crl']
Expand All @@ -144,7 +144,7 @@ Read CRL
import hvac
client = hvac.Client()

read_crl_response = self.client.secrets.pki.read_crl()
read_crl_response = client.secrets.pki.read_crl()
print('Current CRL: {}'.format(read_crl_response))


Expand All @@ -158,7 +158,7 @@ Rotate CRLs
import hvac
client = hvac.Client()

rotate_crl_response = self.client.secrets.pki.rotate_crl()
rotate_crl_response = client.secrets.pki.rotate_crl()
print('Rotate CRL: {}'.format(rotate_crl_response))


Expand All @@ -172,7 +172,7 @@ Generate Intermediate
import hvac
client = hvac.Client()

generate_intermediate_response = self.client.secrets.pki.generate_intermediate(
generate_intermediate_response = client.secrets.pki.generate_intermediate(
type='exported',
common_name='Vault integration tests'
)
Expand All @@ -189,7 +189,7 @@ Set Signed Intermediate
import hvac
client = hvac.Client()

set_signed_intermediate_response = self.client.secrets.pki.set_signed_intermediate(
set_signed_intermediate_response = client.secrets.pki.set_signed_intermediate(
'-----BEGIN CERTIFICATE...'
)

Expand All @@ -204,7 +204,7 @@ Generate Certificate
import hvac
client = hvac.Client()

generate_certificate_response = self.client.secrets.pki.generate_certificate(
generate_certificate_response = client.secrets.pki.generate_certificate(
name='myrole',
common_name='test.example.com'
)
Expand All @@ -221,7 +221,7 @@ Revoke Certificate
import hvac
client = hvac.Client()

revoke_certificate_response = self.client.secrets.pki.revoke_certificate(
revoke_certificate_response = client.secrets.pki.revoke_certificate(
serial_number='39:dd:2e...'
)
print('Certificate: {}'.format(revoke_certificate_response))
Expand All @@ -237,7 +237,7 @@ Create/Update Role
import hvac
client = hvac.Client()

create_or_update_role_response = self.client.secrets.pki.create_or_update_role(
create_or_update_role_response = client.secrets.pki.create_or_update_role(
'mynewrole',
{
'ttl': '72h',
Expand All @@ -257,7 +257,7 @@ Read Role
import hvac
client = hvac.Client()

read_role_response = self.client.secrets.pki.read_role('myrole')
read_role_response = client.secrets.pki.read_role('myrole')
print('Role definition: {}'.format(read_role_response))


Expand All @@ -271,7 +271,7 @@ List Roles
import hvac
client = hvac.Client()

list_roles_response = self.client.secrets.pki.list_roles()
list_roles_response = client.secrets.pki.list_roles()
print('List of available roles: {}'.format(list_roles_response))


Expand All @@ -285,7 +285,7 @@ Delete Role
import hvac
client = hvac.Client()

delete_role_response = self.client.secrets.pki.delete_role('role2delete')
delete_role_response = client.secrets.pki.delete_role('role2delete')


Generate Root
Expand All @@ -298,7 +298,7 @@ Generate Root
import hvac
client = hvac.Client()

generate_root_response = self.client.secrets.pki.generate_root(
generate_root_response = client.secrets.pki.generate_root(
type='exported',
common_name='New root CA'
)
Expand All @@ -315,7 +315,7 @@ Delete Root
import hvac
client = hvac.Client()

delete_root_response = self.client.secrets.pki.delete_root()
delete_root_response = client.secrets.pki.delete_root()


Sign Intermediate
Expand All @@ -328,7 +328,7 @@ Sign Intermediate
import hvac
client = hvac.Client()

sign_intermediate_response = self.client.secrets.pki.sign_intermediate(
sign_intermediate_response = client.secrets.pki.sign_intermediate(
csr='....',
common_name='example.com',
)
Expand All @@ -345,7 +345,7 @@ Sign Self-Issued
import hvac
client = hvac.Client()

sign_self_issued_response = self.client.secrets.pki.sign_self_issued(
sign_self_issued_response = client.secrets.pki.sign_self_issued(
certificate='...'
)
print('Signed certificate: {}'.format(sign_self_issued_response))
Expand All @@ -361,7 +361,7 @@ Sign Certificate
import hvac
client = hvac.Client()

sign_certificate_response = self.client.secrets.pki.sign_certificate(
sign_certificate_response = client.secrets.pki.sign_certificate(
name='myrole',
csr='...',
common_name='example.com'
Expand All @@ -379,7 +379,7 @@ Sign Verbatim
import hvac
client = hvac.Client()

sign_verbatim_response = self.client.secrets.pki.sign_verbatim(
sign_verbatim_response = client.secrets.pki.sign_verbatim(
name='myrole',
csr='...'
)
Expand All @@ -396,6 +396,6 @@ Tidy
import hvac
client = hvac.Client()

tidy_response = self.client.secrets.pki.tidy()
tidy_response = client.secrets.pki.tidy()


3 changes: 2 additions & 1 deletion hvac/api/auth_methods/approle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""APPROLE methods module."""
import json
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
from hvac.constants.approle import DEFAULT_MOUNT_POINT, ALLOWED_TOKEN_TYPES
Expand Down Expand Up @@ -245,7 +246,7 @@ def generate_secret_id(self, role_name, metadata=None, cidr_list=None, token_bou
))

params = {
'metadata': metadata
'metadata': json.dumps(metadata) if metadata else metadata
}

list_of_strings_params = {
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def load_long_description():

setup(
name='hvac',
version='0.10.8',
version='0.10.9',
description='HashiCorp Vault API client',
long_description=load_long_description(),
long_description_content_type="text/markdown",
Expand Down