Skip to content

Commit

Permalink
Remove stale properties from signing_server cfg model
Browse files Browse the repository at this point in the history
  • Loading branch information
8R0WNI3 committed Oct 22, 2024
1 parent 739fe9e commit 57094af
Showing 1 changed file with 3 additions and 61 deletions.
64 changes: 3 additions & 61 deletions model/signing_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import enum
import typing

from model.base import (
ModelBase,
NamedModelElement,
)
from model.proxy import DockerImageConfig
import model.base


class SigningAlgorithm(enum.StrEnum):
Expand All @@ -29,75 +25,21 @@ def as_rfc_standard(algorithm: typing.Union['SigningAlgorithm', str]) -> str:
raise NotImplementedError(algorithm)


class SigningServerEndpoint(NamedModelElement):
class SigningServerEndpoint(model.base.NamedModelElement):
def url(self) -> str:
return self.raw.get('url')


class SigningServerIngressConfig(ModelBase):

def enabled(self) -> bool:
return self.raw['enabled']

def auth(self):
return self.raw.get('auth')

def _required_attributes(self):
return {
'enabled'
}


class SigningServerConfig(NamedModelElement):

def image_config(self) -> DockerImageConfig:
return DockerImageConfig(self.raw['image'])

def namespace(self) -> str:
return self.raw['namespace']

def log_config(self) -> dict:
return self.raw['log']

def replica_count(self) -> int:
return self.raw['replica_count']

def image_pull_secret_name(self) -> str:
return self.raw['image_pull_secret_name']

def private_key_secret_name(self) -> str:
return self.raw['private_key_secret_name']

class SigningServerConfig(model.base.NamedModelElement):
def private_key(self) -> str:
return self.raw['private_key']

def certificate_configmap_name(self) -> str:
return self.raw['certificate_configmap_name']

def certificate(self):
return self.raw['certificate']

def ca_certificates_configmap_name(self) -> str:
return self.raw['ca_certificates_configmap_name']

def ca_certificates(self):
return self.raw['ca_certificates']

def max_body_size(self) -> int:
return self.raw['max_body_size']

def disable_auth(self) -> bool:
return self.raw['disable_auth']

def host(self) -> str:
return self.raw['host']

def cosign_repository(self) -> str:
return self.raw['cosign_repository']

def ingress_config(self) -> SigningServerIngressConfig:
return SigningServerIngressConfig(self.raw['ingress'])

def algorithm(self) -> SigningAlgorithm:
return SigningAlgorithm(self.raw.get('algorithm', SigningAlgorithm.RSASSA_PSS))

Expand Down

0 comments on commit 57094af

Please sign in to comment.