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 f9a2a0e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/middlewared/middlewared/plugins/crypto_/ca_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ async def profiles(self):
Returns a dictionary of predefined options for
creating certificate authority requests.
"""
return CAModel().model_dump()
return CAModel().model_dump(by_alias=True)
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 f9a2a0e

Please sign in to comment.