Skip to content

Commit

Permalink
update webui/crypto.py to use camodel
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Jan 17, 2025
1 parent 2f48334 commit 58bf3b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/middlewared/middlewared/plugins/webui/crypto.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from middlewared.api import api_method
from middlewared.api.current import (
CAModel,
CAModelArgs,
CAModelResult,
CERTPROFILES,
CertProfilesArgs,
CertProfilesResult,
Expand All @@ -26,9 +29,13 @@ class Config:
async def certificate_profiles(self):
return CERTPROFILES

@accepts(roles=['READONLY_ADMIN'])
@api_method(
CAModelArgs,
CAModelResult,
roles=['READONLY_ADMIN']
)
async def certificateauthority_profiles(self):
return await self.middleware.call('certificateauthority.profiles')
return CAModel().model_dump(by_alias=True)

@accepts(Int('cert_id'), roles=['READONLY_ADMIN'])
async def get_certificate_domain_names(self, cert_id):
Expand Down

0 comments on commit 58bf3b2

Please sign in to comment.