1
0

Updated secrets handle to load_or_fail
Some checks failed
Test Python / Test (push) Failing after 26s

This commit is contained in:
Jon Michael Aanes 2024-07-22 23:38:05 +02:00
parent 7541129786
commit 0c1d454c42
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 17 additions and 11 deletions

View File

@ -12,7 +12,6 @@ import fin_depo
from . import (
AutoSellConfig,
config,
log_results,
order_csv,
run_auto_sell,
@ -65,10 +64,12 @@ Sells financial assets from an online account.
def load_config(config_path: Path) -> AutoSellConfig:
logger.info('Loading configuration')
from . import secrets_config
seller_backend = fin_depo.defi_kucoin.KucoinDepoFetcher(
kucoin_secret=config.KUCOIN_SECRET,
kucoin_key=config.KUCOIN_KEY,
kucoin_pass=config.KUCOIN_PASS,
kucoin_secret=secrets_config.KUCOIN_SECRET,
kucoin_key=secrets_config.KUCOIN_KEY,
kucoin_pass=secrets_config.KUCOIN_PASS,
allow_trades=True,
)

View File

@ -1,7 +0,0 @@
import secret_loader
load_secret = secret_loader.SecretLoader().load
KUCOIN_KEY = load_secret('KUCOIN_KEY')
KUCOIN_SECRET = load_secret('KUCOIN_SECRET')
KUCOIN_PASS = load_secret('KUCOIN_PASS')

View File

@ -0,0 +1,12 @@
"""Handles secrets for the `crypto_seller` system."""
from secret_loader import SecretLoader
__all__ = ['KUCOIN_KEY', 'KUCOIN_SECRET', 'KUCOIN_PASS']
secret_loader = SecretLoader()
KUCOIN_KEY = secret_loader.load_or_fail('KUCOIN_KEY')
KUCOIN_SECRET = secret_loader.load_or_fail('KUCOIN_SECRET')
KUCOIN_PASS = secret_loader.load_or_fail('KUCOIN_PASS')
del secret_loader