Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ auth_params = BaoAuthParams(
try:
bao_client = Bao(auth_params=auth_params)
except Exception as ex:
print(f'Could not connect to openbao: { bao_ip_address } - { ex }')
print(f'Could not connect to openbao: { auth_params.bao_address } - { ex }')
sys.exit(1)
```

Expand All @@ -43,7 +43,7 @@ auth_params = BaoAuthParams(
try:
bao_client = Bao(auth_params=auth_params)
except Exception as ex:
print(f'Could not connect to openbao: { bao_ip_address } - { ex }')
print(f'Could not connect to openbao: { ex }')
sys.exit(1)
```

Expand All @@ -58,6 +58,7 @@ try:
response = bao_client.generate_certificate(
common_name=server_fqdn,
pki="mycool-ca",
ttl="72h",
pki_role="mycool-ca-role"
)

Expand Down
4 changes: 3 additions & 1 deletion openbaopy/bao.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ def __init__(self, auth_params: BaoAuthParams):
if not self.__bao_client.is_authenticated():
raise hvac.exceptions.Unauthorized('Cloud not authenticate to bao server!')

def generate_certificate(self, common_name: str, pki: str, pki_role: str) -> dict:
def generate_certificate(self, common_name: str, ttl: str, pki: str, pki_role: str) -> dict:
"""
Generate new signed x509 certificate.

Args:
common_name (str): The Certificates desired Common Name.
ttl (str): The certificates desired expiration e.g: 72h.
pki (str): The CA/PKI mount to issue new certificates.
pki_role (str): The desired openbao pki role.

Expand All @@ -115,6 +116,7 @@ def generate_certificate(self, common_name: str, pki: str, pki_role: str) -> dic
response = self.__bao_client.secrets.pki.generate_certificate(
name=pki_role,
common_name=common_name,
ttl=ttl,
mount_point=pki
)
return response['data']
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "openbaopy"
version = "1.0.0"
version = "1.0.1"
description = "OpenBao client library"
readme = "README.md"
requires-python = ">=3.12"
Expand Down