From 170d9bc6d07364124def31831c6a7f44d0bae619 Mon Sep 17 00:00:00 2001 From: patdyn Date: Thu, 27 Jun 2024 11:42:09 +0200 Subject: [PATCH] Implement missing methods --- .../domain/provider_tf_backend_git.py | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/main/python/ddadevops/domain/provider_tf_backend_git.py b/src/main/python/ddadevops/domain/provider_tf_backend_git.py index 4f450f8..0289a79 100644 --- a/src/main/python/ddadevops/domain/provider_tf_backend_git.py +++ b/src/main/python/ddadevops/domain/provider_tf_backend_git.py @@ -47,17 +47,23 @@ class TerraformBackendGit(Validateable, CredentialMappingDefault): def is_local_state(self): return False - # ToDo: - def __bucket_key__(self): - pass + def __make_http_backend_address__(self) -> str: + # TODO Should we make this configurable? + base_string = "http://localhost:6061/?type=git" + return f"{base_string}&repository={self.git_backend_repo}&ref={self.git_backend_ref}&state={self.stage}/{self.module}/{self.git_backend_state}.json" - # ToDo: - def __make_http_backend_address__(self): - pass - - # ToDo: + # TODO: Implement ssh auth too @classmethod - def get_mapping_default(): - pass - - + def get_mapping_default(cls) -> List[Dict[str, str]]: + return [ + { + "gopass_path": "server/meissa/repo/terraform-backend-git-test", + "gopass_field": "user", + "name": "git_backend_username", + }, + { + "gopass_path": "server/meissa/repo/terraform-backend-git-test", + "gopass_field": "token", + "name": "git_backend_token", + }, + ]