forked from TrueCloudLab/frostfs-testlib
Rename neofs to frostfs
Signed-off-by: Yulia Kovshova <y.kovshova@yadro.com>
This commit is contained in:
parent
5a2c7ac98d
commit
6d3b6f0f2f
83 changed files with 330 additions and 338 deletions
56
src/frostfs_testlib/cli/frostfs_cli/util.py
Normal file
56
src/frostfs_testlib/cli/frostfs_cli/util.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
from typing import Optional
|
||||
|
||||
from frostfs_testlib.cli.cli_command import CliCommand
|
||||
from frostfs_testlib.shell import CommandResult
|
||||
|
||||
|
||||
class FrostfsCliUtil(CliCommand):
|
||||
def sign_bearer_token(
|
||||
self,
|
||||
wallet: str,
|
||||
from_file: str,
|
||||
to_file: str,
|
||||
address: Optional[str] = None,
|
||||
json: Optional[bool] = False,
|
||||
) -> CommandResult:
|
||||
"""
|
||||
Sign bearer token to use it in requests.
|
||||
|
||||
Args:
|
||||
address: Address of wallet account.
|
||||
from_file: File with JSON or binary encoded bearer token to sign.
|
||||
to_file: File to dump signed bearer token (default: binary encoded).
|
||||
json: Dump bearer token in JSON encoding.
|
||||
wallet: WIF (NEP-2) string or path to the wallet or binary key.
|
||||
|
||||
Returns:
|
||||
Command's result.
|
||||
"""
|
||||
return self._execute(
|
||||
"util sign bearer-token",
|
||||
**{param: value for param, value in locals().items() if param not in ["self"]},
|
||||
)
|
||||
|
||||
def sign_session_token(
|
||||
self,
|
||||
wallet: str,
|
||||
from_file: str,
|
||||
to_file: str,
|
||||
address: Optional[str] = None,
|
||||
) -> CommandResult:
|
||||
"""
|
||||
Sign session token to use it in requests.
|
||||
|
||||
Args:
|
||||
address: Address of wallet account.
|
||||
from_file: File with JSON encoded session token to sign.
|
||||
to_file: File to dump signed bearer token (default: binary encoded).
|
||||
wallet: WIF (NEP-2) string or path to the wallet or binary key.
|
||||
|
||||
Returns:
|
||||
Command's result.
|
||||
"""
|
||||
return self._execute(
|
||||
"util sign session-token",
|
||||
**{param: value for param, value in locals().items() if param not in ["self"]},
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue