1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

34 lines
1.1 KiB
Python
Raw Normal View History

2020-01-05 00:32:54 -07:00
"""Validate SSL configuration variables."""
2020-02-03 02:35:11 -07:00
# Standard Library
2020-02-01 16:11:01 -10:00
from typing import Optional
2020-02-03 02:35:11 -07:00
# Third Party
from pydantic import Field, FilePath, StrictBool
2020-01-05 00:32:54 -07:00
2020-02-03 02:35:11 -07:00
# Project
2020-01-05 00:32:54 -07:00
from hyperglass.configuration.models._utils import HyperglassModel
class Ssl(HyperglassModel):
"""Validate SSL config parameters."""
2020-02-01 16:11:01 -10:00
enable: StrictBool = Field(
True,
title="Enable SSL",
description="If enabled, hyperglass will use HTTPS to connect to the configured device running [hyperglass-agent](/fixme). If enabled, a certificate file must be specified (hyperglass does not support connecting to a device over an unverified SSL session.)",
)
cert: Optional[FilePath]
class Config:
"""Pydantic model configuration."""
title = "SSL"
description = "SSL configuration for devices running hyperglass-agent."
fields = {
"cert": {
"title": "Certificate",
"description": "Valid path to an SSL certificate. This certificate must be the public key used to serve the hyperglass-agent API on the device running hyperglass-agent.",
}
}