Revert "Merge pull request 'clan-cli: secrets: Add support for PGP keys with sops-nix' (#2186) from lopter/clan-core:lo-sops-nix-pgp-support into main"

This reverts commit 5668fd05a0, reversing
changes made to dd17fbdc6d.

Reverting for now as Dave's recent change conflicts with this change.
This commit is contained in:
Jörg Thalheim
2024-10-04 17:54:17 +02:00
parent 9bb1aef245
commit 084ebf9edc
11 changed files with 131 additions and 361 deletions

View File

@@ -2,7 +2,6 @@ import copy
import dataclasses
import pathlib
from dataclasses import MISSING
from enum import EnumType
from types import NoneType, UnionType
from typing import (
Annotated,
@@ -78,16 +77,13 @@ def type_to_dict(
if dataclasses.is_dataclass(t):
fields = dataclasses.fields(t)
properties = {}
for f in fields:
if f.name.startswith("_"):
continue
assert not isinstance(
f.type, str
), f"Expected field type to be a type, got {f.type}, Have you imported `from __future__ import annotations`?"
properties[f.metadata.get("alias", f.name)] = type_to_dict(
properties = {
f.metadata.get("alias", f.name): type_to_dict(
f.type, f"{scope} {t.__name__}.{f.name}", type_map
)
for f in fields
if not f.name.startswith("_")
}
required = set()
for pn, pv in properties.items():
@@ -196,11 +192,6 @@ def type_to_dict(
return {"type": "boolean"}
if t is object:
return {"type": "object"}
if type(t) is EnumType:
return {
"type": "string",
"enum": list(t.__members__),
}
if t is Any:
msg = f"{scope} - Usage of the Any type is not supported for API functions. In: {scope}"
raise JSchemaTypeError(msg)
@@ -217,7 +208,7 @@ def type_to_dict(
if t is NoneType:
return {"type": "null"}
msg = f"{scope} - Basic type '{t!s}' is not supported"
msg = f"{scope} - Error primitive type not supported {t!s}"
raise JSchemaTypeError(msg)
msg = f"{scope} - Type '{t!s}' is not supported"
msg = f"{scope} - Error type not supported {t!s}"
raise JSchemaTypeError(msg)