Skip to content

Commit

Permalink
fix: create certificate with appropriate params
Browse files Browse the repository at this point in the history
Signed-off-by: guillaume <[email protected]>
  • Loading branch information
gruyaume committed Sep 26, 2024
1 parent fda35d4 commit ca73152
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/notary.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ class DeleteCertificateRequestResponse:
class CreateCertificateParams:
"""Parameters to create a certificate in Notary."""

csr: str
cert_chain: list[str]
certificate: str


@dataclass
Expand Down Expand Up @@ -263,7 +262,7 @@ def create_certificate(
if len(csr_ids) != 1:
logger.error("given CSR not found in Notary")
return None
create_certificate_params = CreateCertificateParams(csr=csr, cert_chain=cert_chain)
create_certificate_params = CreateCertificateParams(certificate="\n".join(cert_chain))
response = self._make_request(
"POST",
f"/api/{self.API_VERSION}/certificate_requests/{csr_ids[0].id}/certificate",
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,11 @@ async def test_build_and_deploy(ops_test: OpsTest, request: pytest.FixtureReques
"self-signed-certificates",
application_name=TLS_PROVIDER_APPLICATION_NAME,
channel="edge",
trust=True,
)
await ops_test.model.deploy(
"tls-certificates-requirer",
application_name=TLS_REQUIRER_APPLICATION_NAME,
channel="edge",
trust=True,
)
await ops_test.model.deploy(
"prometheus-k8s",
Expand Down

0 comments on commit ca73152

Please sign in to comment.