[#341] Remove duplication of wallet passwords in configs
Signed-off-by: Vladimir Domnich <v.domnich@yadro.com>
This commit is contained in:
parent
e8cbd286cd
commit
6b04663dee
6 changed files with 40 additions and 123 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -20,3 +20,4 @@ TemporaryDir/*
|
||||||
artifacts/*
|
artifacts/*
|
||||||
docs/*
|
docs/*
|
||||||
venv.*/*
|
venv.*/*
|
||||||
|
/*wallet_config.yml
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
---
|
|
||||||
|
|
||||||
# Object sizes
|
|
||||||
|
|
||||||
simple_obj_size: 1000
|
|
||||||
complex_obj_size: 2000
|
|
||||||
|
|
||||||
# Timeouts
|
|
||||||
|
|
||||||
container_wait_interval: '1m'
|
|
||||||
mainnet_block_time: '1s'
|
|
||||||
mainnet_timeout: '1min'
|
|
||||||
morph_block_time: '1s'
|
|
||||||
neofs_contract_cache_timeout: '30s'
|
|
||||||
shard_remove_interval: '1m'
|
|
||||||
|
|
||||||
# Services endpoints
|
|
||||||
|
|
||||||
neofs_endpoint: 's01.neofs.devenv:8080'
|
|
||||||
neo_mainnet_endpoint: 'http://main-chain.neofs.devenv:30333'
|
|
||||||
morph_endpoint: 'http://morph-chain.neofs.devenv:30333'
|
|
||||||
http_gate: 'http://http.neofs.devenv'
|
|
||||||
s3_gate: 'https://s3.neofs.devenv:8080'
|
|
||||||
storage_node_1: 's01.neofs.devenv:8080'
|
|
||||||
storage_node_2: 's02.neofs.devenv:8080'
|
|
||||||
storage_node_3: 's03.neofs.devenv:8080'
|
|
||||||
storage_node_4: 's04.neofs.devenv:8080'
|
|
||||||
|
|
||||||
neofs_netmap:
|
|
||||||
s01:
|
|
||||||
rpc: 's01.neofs.devenv:8080'
|
|
||||||
control: 's01.neofs.devenv:8081'
|
|
||||||
wallet_path: '../neofs-dev-env/services/storage/wallet01.json'
|
|
||||||
un_locode: 'RU MOW'
|
|
||||||
s02:
|
|
||||||
rpc: 's02.neofs.devenv:8080'
|
|
||||||
control: 's02.neofs.devenv:8081'
|
|
||||||
wallet_path: '../neofs-dev-env/services/storage/wallet02.json'
|
|
||||||
un_locode: 'RU LED'
|
|
||||||
s03:
|
|
||||||
rpc: 's03.neofs.devenv:8080'
|
|
||||||
control: 's03.neofs.devenv:8081'
|
|
||||||
wallet_path: '../neofs-dev-env/services/storage/wallet03.json'
|
|
||||||
un_locode: 'SE STO'
|
|
||||||
s04:
|
|
||||||
rpc: 's04.neofs.devenv:8080'
|
|
||||||
control: 's04.neofs.devenv:8081'
|
|
||||||
wallet_path: '../neofs-dev-env/services/storage/wallet04.json'
|
|
||||||
un_locode: 'FI HEL'
|
|
||||||
|
|
||||||
# Paths to binaries
|
|
||||||
|
|
||||||
neogo_executable: 'neo-go'
|
|
||||||
neofs_cli_exec: 'neofs-cli'
|
|
||||||
|
|
||||||
# Neo Blockchain configuration
|
|
||||||
|
|
||||||
gas_hash: '0xd2a4cff31913016155e38e474a2c06d08be276cf'
|
|
||||||
neofs_contract: 'd07ec2a43d2f8638934d340bfb60b6c23afce106'
|
|
||||||
morph_magic: '15405'
|
|
||||||
|
|
||||||
# NeoFS common parameters
|
|
||||||
|
|
||||||
common_placement_rule: "REP 2 IN X CBF 1 SELECT 4 FROM * AS X"
|
|
||||||
# TODO: remove within the scope of
|
|
||||||
# https://github.com/nspcc-dev/neofs-testcases/issues/246
|
|
||||||
gate_pub_key: '0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf'
|
|
||||||
|
|
||||||
# Wallets
|
|
||||||
|
|
||||||
devenv_services_path: '../neofs-dev-env/services'
|
|
||||||
wallet_config: 'neofs_cli_configs/empty_passwd.yml'
|
|
||||||
mainnet_wallet_path: '../neofs-dev-env/services/chain/node-wallet.json'
|
|
||||||
mainnet_wallet_config: 'neofs_cli_configs/one_wallet_password.yml'
|
|
||||||
mainnet_single_addr: 'NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP'
|
|
||||||
mainnet_wallet_pass: 'one'
|
|
||||||
ir_wallet_path: '../neofs-dev-env/services/ir/az.json'
|
|
||||||
ir_wallet_config: 'neofs_cli_configs/one_wallet_password.yml'
|
|
||||||
ir_wallet_pass: 'one'
|
|
||||||
storage_wallet_path: '../neofs-dev-env/services/storage/wallet01.json'
|
|
|
@ -1 +0,0 @@
|
||||||
password: ""
|
|
|
@ -1 +0,0 @@
|
||||||
password: "one"
|
|
|
@ -1,9 +1,3 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
"""
|
|
||||||
This module contains keywords for work with session token.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
@ -13,14 +7,11 @@ import uuid
|
||||||
import allure
|
import allure
|
||||||
import json_transformers
|
import json_transformers
|
||||||
from cli_helpers import _cmd_run, _run_with_passwd
|
from cli_helpers import _cmd_run, _run_with_passwd
|
||||||
from common import ASSETS_DIR, NEOFS_ENDPOINT, WALLET_CONFIG
|
from common import ASSETS_DIR, NEOFS_CLI_EXEC, NEOFS_ENDPOINT, WALLET_CONFIG
|
||||||
from neo3 import wallet
|
from neo3 import wallet
|
||||||
|
|
||||||
logger = logging.getLogger("NeoLogger")
|
logger = logging.getLogger("NeoLogger")
|
||||||
|
|
||||||
# path to neofs-cli executable
|
|
||||||
NEOFS_CLI_EXEC = os.getenv("NEOFS_CLI_EXEC", "neofs-cli")
|
|
||||||
|
|
||||||
|
|
||||||
@allure.step("Generate Session Token")
|
@allure.step("Generate Session Token")
|
||||||
def generate_session_token(owner: str, session_wallet: str, cid: str = "") -> str:
|
def generate_session_token(owner: str, session_wallet: str, cid: str = "") -> str:
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Common NeoFS variables can be declared from neofs-dev-env env variables.
|
import yaml
|
||||||
# High priority is accepted for those envs.
|
|
||||||
|
|
||||||
CONTAINER_WAIT_INTERVAL = "1m"
|
CONTAINER_WAIT_INTERVAL = "1m"
|
||||||
|
|
||||||
|
@ -24,16 +23,19 @@ NEO_MAINNET_ENDPOINT = os.getenv("NEO_MAINNET_ENDPOINT", "http://main-chain.neof
|
||||||
MORPH_ENDPOINT = os.getenv("MORPH_ENDPOINT", "http://morph-chain.neofs.devenv:30333")
|
MORPH_ENDPOINT = os.getenv("MORPH_ENDPOINT", "http://morph-chain.neofs.devenv:30333")
|
||||||
HTTP_GATE = os.getenv("HTTP_GATE", "http://http.neofs.devenv")
|
HTTP_GATE = os.getenv("HTTP_GATE", "http://http.neofs.devenv")
|
||||||
S3_GATE = os.getenv("S3_GATE", "https://s3.neofs.devenv:8080")
|
S3_GATE = os.getenv("S3_GATE", "https://s3.neofs.devenv:8080")
|
||||||
GAS_HASH = "0xd2a4cff31913016155e38e474a2c06d08be276cf"
|
GAS_HASH = os.getenv("GAS_HASH", "0xd2a4cff31913016155e38e474a2c06d08be276cf")
|
||||||
|
|
||||||
NEOFS_CONTRACT = os.getenv("NEOFS_IR_CONTRACTS_NEOFS")
|
NEOFS_CONTRACT = os.getenv("NEOFS_IR_CONTRACTS_NEOFS")
|
||||||
|
|
||||||
ASSETS_DIR = os.getenv("ASSETS_DIR", "TemporaryDir")
|
ASSETS_DIR = os.getenv("ASSETS_DIR", "TemporaryDir")
|
||||||
DEVENV_PATH = os.getenv("DEVENV_PATH", "../neofs-dev-env")
|
DEVENV_PATH = os.getenv("DEVENV_PATH", os.path.join("..", "neofs-dev-env"))
|
||||||
CLI_CONFIGS_PATH = os.getenv("CLI_CONFIGS_PATH", f"{os.getcwd()}/neofs_cli_configs")
|
|
||||||
|
|
||||||
MORPH_MAGIC = os.getenv("MORPH_MAGIC")
|
MORPH_MAGIC = os.getenv("MORPH_MAGIC")
|
||||||
|
|
||||||
|
# Password of wallet owned by user on behalf of whom we are running tests
|
||||||
|
WALLET_PASS = os.getenv("WALLET_PASS", "")
|
||||||
|
|
||||||
|
# Configuration of storage nodes
|
||||||
STORAGE_RPC_ENDPOINT_1 = os.getenv("STORAGE_RPC_ENDPOINT_1", "s01.neofs.devenv:8080")
|
STORAGE_RPC_ENDPOINT_1 = os.getenv("STORAGE_RPC_ENDPOINT_1", "s01.neofs.devenv:8080")
|
||||||
STORAGE_RPC_ENDPOINT_2 = os.getenv("STORAGE_RPC_ENDPOINT_2", "s02.neofs.devenv:8080")
|
STORAGE_RPC_ENDPOINT_2 = os.getenv("STORAGE_RPC_ENDPOINT_2", "s02.neofs.devenv:8080")
|
||||||
STORAGE_RPC_ENDPOINT_3 = os.getenv("STORAGE_RPC_ENDPOINT_3", "s03.neofs.devenv:8080")
|
STORAGE_RPC_ENDPOINT_3 = os.getenv("STORAGE_RPC_ENDPOINT_3", "s03.neofs.devenv:8080")
|
||||||
|
@ -43,25 +45,21 @@ STORAGE_CONTROL_ENDPOINT_1 = os.getenv("STORAGE_CONTROL_ENDPOINT_1", "s01.neofs.
|
||||||
STORAGE_CONTROL_ENDPOINT_2 = os.getenv("STORAGE_CONTROL_ENDPOINT_2", "s02.neofs.devenv:8081")
|
STORAGE_CONTROL_ENDPOINT_2 = os.getenv("STORAGE_CONTROL_ENDPOINT_2", "s02.neofs.devenv:8081")
|
||||||
STORAGE_CONTROL_ENDPOINT_3 = os.getenv("STORAGE_CONTROL_ENDPOINT_3", "s03.neofs.devenv:8081")
|
STORAGE_CONTROL_ENDPOINT_3 = os.getenv("STORAGE_CONTROL_ENDPOINT_3", "s03.neofs.devenv:8081")
|
||||||
STORAGE_CONTROL_ENDPOINT_4 = os.getenv("STORAGE_CONTROL_ENDPOINT_4", "s04.neofs.devenv:8081")
|
STORAGE_CONTROL_ENDPOINT_4 = os.getenv("STORAGE_CONTROL_ENDPOINT_4", "s04.neofs.devenv:8081")
|
||||||
STORAGE_CONTROL_ENDPOINT_PRIVATE = (
|
|
||||||
os.getenv("STORAGE_CONTROL_ENDPOINT_PRIVATE", "false").lower() == "true"
|
|
||||||
)
|
|
||||||
|
|
||||||
STORAGE_WALLET_PATH_1 = os.getenv(
|
STORAGE_WALLET_PATH_1 = os.getenv(
|
||||||
"STORAGE_WALLET_PATH_1", f"{DEVENV_PATH}/services/storage/wallet01.json"
|
"STORAGE_WALLET_PATH_1", os.path.join(DEVENV_PATH, "services", "storage", "wallet01.json")
|
||||||
)
|
)
|
||||||
STORAGE_WALLET_PATH_2 = os.getenv(
|
STORAGE_WALLET_PATH_2 = os.getenv(
|
||||||
"STORAGE_WALLET_PATH_2", f"{DEVENV_PATH}/services/storage/wallet02.json"
|
"STORAGE_WALLET_PATH_2", os.path.join(DEVENV_PATH, "services", "storage", "wallet02.json")
|
||||||
)
|
)
|
||||||
STORAGE_WALLET_PATH_3 = os.getenv(
|
STORAGE_WALLET_PATH_3 = os.getenv(
|
||||||
"STORAGE_WALLET_PATH_3", f"{DEVENV_PATH}/services/storage/wallet03.json"
|
"STORAGE_WALLET_PATH_3", os.path.join(DEVENV_PATH, "services", "storage", "wallet03.json")
|
||||||
)
|
)
|
||||||
STORAGE_WALLET_PATH_4 = os.getenv(
|
STORAGE_WALLET_PATH_4 = os.getenv(
|
||||||
"STORAGE_WALLET_PATH_4", f"{DEVENV_PATH}/services/storage/wallet04.json"
|
"STORAGE_WALLET_PATH_4", os.path.join(DEVENV_PATH, "services", "storage", "wallet04.json")
|
||||||
)
|
)
|
||||||
STORAGE_WALLET_PATH = STORAGE_WALLET_PATH_1
|
STORAGE_WALLET_PATH = STORAGE_WALLET_PATH_1
|
||||||
STORAGE_WALLET_PASS = os.getenv("STORAGE_WALLET_PASS", "")
|
STORAGE_WALLET_PASS = os.getenv("STORAGE_WALLET_PASS", "")
|
||||||
STORAGE_WALLET_CONFIG = f"{CLI_CONFIGS_PATH}/empty_passwd.yml"
|
|
||||||
|
|
||||||
NEOFS_NETMAP_DICT = {
|
NEOFS_NETMAP_DICT = {
|
||||||
"s01": {
|
"s01": {
|
||||||
|
@ -89,30 +87,25 @@ NEOFS_NETMAP_DICT = {
|
||||||
"UN-LOCODE": "FI HEL",
|
"UN-LOCODE": "FI HEL",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
NEOFS_NETMAP = [i["rpc"] for i in NEOFS_NETMAP_DICT.values()]
|
NEOFS_NETMAP = [node["rpc"] for node in NEOFS_NETMAP_DICT.values()]
|
||||||
|
|
||||||
|
# Paths to CLI executables
|
||||||
NEOGO_EXECUTABLE = os.getenv("NEOGO_EXECUTABLE", "neo-go")
|
NEOGO_EXECUTABLE = os.getenv("NEOGO_EXECUTABLE", "neo-go")
|
||||||
NEOFS_CLI_EXEC = os.getenv("NEOFS_CLI_EXEC", "neofs-cli")
|
NEOFS_CLI_EXEC = os.getenv("NEOFS_CLI_EXEC", "neofs-cli")
|
||||||
|
NEOFS_AUTHMATE_EXEC = os.getenv("NEOFS_AUTHMATE_EXEC", "neofs-authmate")
|
||||||
# Config of wallet with empty password. We use it for:
|
NEOFS_ADM_EXEC = os.getenv("NEOFS_ADM_EXEC", "neofs-adm")
|
||||||
# - for wallet of user on behalf of whom we are running tests
|
|
||||||
# - for wallets of storage nodes
|
|
||||||
WALLET_CONFIG = f"{CLI_CONFIGS_PATH}/empty_passwd.yml"
|
|
||||||
|
|
||||||
MAINNET_WALLET_PATH = os.getenv(
|
MAINNET_WALLET_PATH = os.getenv(
|
||||||
"MAINNET_WALLET_PATH", f"{DEVENV_PATH}/services/chain/node-wallet.json"
|
"MAINNET_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "chain", "node-wallet.json")
|
||||||
)
|
|
||||||
MAINNET_WALLET_CONFIG = os.getenv(
|
|
||||||
"MAINNET_WALLET_CONFIG", f"{CLI_CONFIGS_PATH}/one_wallet_password.yml"
|
|
||||||
)
|
)
|
||||||
MAINNET_SINGLE_ADDR = os.getenv("MAINNET_SINGLE_ADDR", "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP")
|
MAINNET_SINGLE_ADDR = os.getenv("MAINNET_SINGLE_ADDR", "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP")
|
||||||
MAINNET_WALLET_PASS = os.getenv("MAINNET_WALLET_PASS", "one")
|
MAINNET_WALLET_PASS = os.getenv("MAINNET_WALLET_PASS", "one")
|
||||||
|
|
||||||
IR_WALLET_PATH = os.getenv("IR_WALLET_PATH", f"{DEVENV_PATH}/services/ir/az.json")
|
IR_WALLET_PATH = os.getenv("IR_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "ir", "az.json"))
|
||||||
IR_WALLET_CONFIG = os.getenv("IR_WALLET_CONFIG", f"{CLI_CONFIGS_PATH}/one_wallet_password.yml")
|
|
||||||
IR_WALLET_PASS = os.getenv("IR_WALLET_PASS", "one")
|
IR_WALLET_PASS = os.getenv("IR_WALLET_PASS", "one")
|
||||||
|
|
||||||
S3_GATE_WALLET_PATH = os.getenv(
|
S3_GATE_WALLET_PATH = os.getenv(
|
||||||
"S3_GATE_WALLET_PATH", f"{DEVENV_PATH}/services/s3_gate/wallet.json"
|
"S3_GATE_WALLET_PATH", os.path.join(DEVENV_PATH, "services", "s3_gate", "wallet.json")
|
||||||
)
|
)
|
||||||
S3_GATE_WALLET_PASS = os.getenv("S3_GATE_WALLET_PASS", "s3")
|
S3_GATE_WALLET_PASS = os.getenv("S3_GATE_WALLET_PASS", "s3")
|
||||||
|
|
||||||
|
@ -124,13 +117,27 @@ STORAGE_NODE_SSH_PRIVATE_KEY_PATH = os.getenv("STORAGE_NODE_SSH_PRIVATE_KEY_PATH
|
||||||
# Path to directory with CLI binaries on storage node (currently we need only neofs-cli)
|
# Path to directory with CLI binaries on storage node (currently we need only neofs-cli)
|
||||||
STORAGE_NODE_BIN_PATH = os.getenv("STORAGE_NODE_BIN_PATH", f"{DEVENV_PATH}/vendor")
|
STORAGE_NODE_BIN_PATH = os.getenv("STORAGE_NODE_BIN_PATH", f"{DEVENV_PATH}/vendor")
|
||||||
|
|
||||||
# Path to neofs-s3-authmate utility
|
# Config for neofs-adm utility. Optional if tests are running against devenv
|
||||||
NEOFS_AUTHMATE_EXEC = os.getenv("NEOFS_AUTHMATE_EXEC", "neofs-authmate")
|
|
||||||
|
|
||||||
# Path and config for neofs-adm utility. Optional if tests are running against devenv
|
|
||||||
NEOFS_ADM_EXEC = os.getenv("NEOFS_ADM_EXEC", "neofs-adm")
|
|
||||||
NEOFS_ADM_CONFIG_PATH = os.getenv("NEOFS_ADM_CONFIG_PATH")
|
NEOFS_ADM_CONFIG_PATH = os.getenv("NEOFS_ADM_CONFIG_PATH")
|
||||||
|
|
||||||
INFRASTRUCTURE_TYPE = os.getenv("INFRASTRUCTURE_TYPE", "LOCAL_DEVENV")
|
INFRASTRUCTURE_TYPE = os.getenv("INFRASTRUCTURE_TYPE", "LOCAL_DEVENV")
|
||||||
FREE_STORAGE = os.getenv("FREE_STORAGE", "false").lower() == "true"
|
FREE_STORAGE = os.getenv("FREE_STORAGE", "false").lower() == "true"
|
||||||
BIN_VERSIONS_FILE = os.getenv("BIN_VERSIONS_FILE")
|
BIN_VERSIONS_FILE = os.getenv("BIN_VERSIONS_FILE")
|
||||||
|
|
||||||
|
# Generate wallet configs
|
||||||
|
# TODO: we should move all info about wallet configs to fixtures
|
||||||
|
WALLET_CONFIG = os.path.join(os.getcwd(), "wallet_config.yml")
|
||||||
|
with open(WALLET_CONFIG, "w") as file:
|
||||||
|
yaml.dump({"password": WALLET_PASS}, file)
|
||||||
|
|
||||||
|
STORAGE_WALLET_CONFIG = os.path.join(os.getcwd(), "storage_wallet_config.yml")
|
||||||
|
with open(STORAGE_WALLET_CONFIG, "w") as file:
|
||||||
|
yaml.dump({"password": STORAGE_WALLET_PASS}, file)
|
||||||
|
|
||||||
|
MAINNET_WALLET_CONFIG = os.path.join(os.getcwd(), "mainnet_wallet_config.yml")
|
||||||
|
with open(MAINNET_WALLET_CONFIG, "w") as file:
|
||||||
|
yaml.dump({"password": MAINNET_WALLET_PASS}, file)
|
||||||
|
|
||||||
|
IR_WALLET_CONFIG = os.path.join(os.getcwd(), "ir_wallet_config.yml")
|
||||||
|
with open(IR_WALLET_CONFIG, "w") as file:
|
||||||
|
yaml.dump({"password": IR_WALLET_PASS}, file)
|
||||||
|
|
Loading…
Reference in a new issue