Merge pull request 'mo_fix' (#18) from mo_fix into develop
Reviewed-on: https://hattori.ztsh.eu/iac/karl/pulls/18
This commit is contained in:
commit
35014e0684
7 changed files with 14 additions and 11 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from config import get_settings
|
||||
from .config import get_settings
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import docker
|
|||
from docker.models.containers import Container
|
||||
from injectable import injectable
|
||||
|
||||
from model.containers import Tree, Compose, SimpleContainer
|
||||
from karl.model.containers import Tree, Compose, SimpleContainer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from typing import Annotated
|
|||
|
||||
from injectable import injectable, autowired, Autowired
|
||||
|
||||
from services import Passwords
|
||||
from karl.services import Passwords
|
||||
|
||||
|
||||
class ValueTemplate(Template):
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class KeyRequest:
|
|||
self._parse_prompt(prompt)
|
||||
|
||||
def _parse_prompt(self, prompt: str):
|
||||
prompt_parts = prompt.split("/")
|
||||
prompt_parts = prompt.split(".")
|
||||
key = None
|
||||
match len(prompt_parts):
|
||||
case 1:
|
||||
|
|
@ -27,14 +27,14 @@ class KeyRequest:
|
|||
key = None
|
||||
if key is None:
|
||||
return
|
||||
key_parts = key.split(".")
|
||||
key_parts = key.split("/")
|
||||
self.path = key_parts[:] if len(key_parts) > 1 else None
|
||||
self.entry_name = key_parts[-1]
|
||||
|
||||
@injectable(singleton=True)
|
||||
class Passwords:
|
||||
def __init__(self):
|
||||
from config import get_settings
|
||||
from karl.config import get_settings
|
||||
settings = get_settings()
|
||||
import keyring_backend
|
||||
keyring.set_keyring(keyring=keyring_backend.Backend())
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from git import Repo, Remote
|
||||
from injectable import injectable
|
||||
|
||||
from config import GitConfig, get_settings
|
||||
from karl.config import GitConfig, get_settings
|
||||
|
||||
|
||||
@injectable(singleton=True)
|
||||
|
|
|
|||
3
tests/config/config.yaml
Normal file
3
tests/config/config.yaml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
kp:
|
||||
file: "../config/kp.kdbx"
|
||||
secret: "../config/secret.txt"
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
value: ${sample}
|
||||
nested: ${some.nested.value}
|
||||
custom: ${custom/field}
|
||||
uname: ${sample/username}
|
||||
invalid: ${double/slash/example}
|
||||
nested: ${some/nested/value}
|
||||
custom: ${custom.field}
|
||||
uname: ${sample.username}
|
||||
invalid: ${double.dot.example}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue