From 48a581dfd6aa0790489e132100eee8a9c4bcac1f Mon Sep 17 00:00:00 2001 From: Jared Crawford Date: Tue, 9 Jan 2024 16:14:53 -0500 Subject: [PATCH] Allow updating options via authority update api --- CHANGELOG.rst | 1 + lemur/authorities/service.py | 5 ++++- lemur/authorities/views.py | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eead1f83e9..da859059cf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,7 @@ Added DIGICERT_CIS_USE_CSR_FIELDS to control the `use_csr_fields` create certifi Added Digicert source plugin. Enable it with DIGICERT_SOURCE_ENABLED Added AWS ACM source plugin. This plugin retreives all certificates for an account and a region. Added AWS ACM destination plugin. This plugin uploads a certificate to AWS ACM. +Allow updating options field via authority update API. 1.6.0 - `2023-10-23` diff --git a/lemur/authorities/service.py b/lemur/authorities/service.py index fd6017d752..d3565fe76a 100644 --- a/lemur/authorities/service.py +++ b/lemur/authorities/service.py @@ -10,6 +10,7 @@ """ import json +from typing import Optional from flask import current_app @@ -24,7 +25,7 @@ from lemur.certificates.service import upload -def update(authority_id, description, owner, active, roles): +def update(authority_id, description, owner, active, roles, options: Optional[str] = None): """ Update an authority with new values. @@ -38,6 +39,8 @@ def update(authority_id, description, owner, active, roles): authority.active = active authority.description = description authority.owner = owner + if options: + authority.options = options log_service.audit_log("update_authority", authority.name, "Updating authority") # check ui what can be updated return database.update(authority) diff --git a/lemur/authorities/views.py b/lemur/authorities/views.py index 651a33cdb8..1cce77e852 100644 --- a/lemur/authorities/views.py +++ b/lemur/authorities/views.py @@ -420,6 +420,7 @@ def put(self, authority_id, data=None): description=data["description"], active=data["active"], roles=data["roles"], + options=data.get("options") )