remove trezor module
This commit is contained in:
4
setup.py
4
setup.py
@@ -8,7 +8,7 @@ setup(
|
||||
author='Roman Zeyde',
|
||||
author_email='roman.zeyde@gmail.com',
|
||||
url='http://github.com/romanz/trezor-agent',
|
||||
packages=['trezor_agent', 'trezor_agent.trezor'],
|
||||
packages=['trezor_agent'],
|
||||
install_requires=['ecdsa>=0.13', 'ed25519>=1.4', 'Cython>=0.23.4', 'trezor>=0.6.6', 'keepkey>=0.7.0', 'semver>=2.2'],
|
||||
platforms=['POSIX'],
|
||||
classifiers=[
|
||||
@@ -24,6 +24,6 @@ setup(
|
||||
'Topic :: Communications',
|
||||
],
|
||||
entry_points={'console_scripts': [
|
||||
'trezor-agent = trezor_agent.__main__:trezor_agent'
|
||||
'trezor-agent = trezor_agent.__main__:main'
|
||||
]},
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from . import formats, protocol, server, trezor
|
||||
from . import formats, protocol, server, client
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -40,7 +40,7 @@ def identity_from_gitconfig():
|
||||
|
||||
|
||||
def ssh_args(label):
|
||||
identity = trezor.client.string_to_identity(label, identity_type=dict)
|
||||
identity = client.string_to_identity(label, identity_type=dict)
|
||||
|
||||
args = []
|
||||
if 'port' in identity:
|
||||
@@ -86,15 +86,15 @@ def setup_logging(verbosity):
|
||||
logging.basicConfig(format=fmt, level=level)
|
||||
|
||||
|
||||
def ssh_sign(client, label, blob):
|
||||
return client.sign_ssh_challenge(label=label, blob=blob)
|
||||
def ssh_sign(conn, label, blob):
|
||||
return conn.sign_ssh_challenge(label=label, blob=blob)
|
||||
|
||||
|
||||
def run_agent(client_factory):
|
||||
args = create_agent_parser().parse_args()
|
||||
setup_logging(verbosity=args.verbose)
|
||||
|
||||
with client_factory(curve=args.ecdsa_curve_name) as client:
|
||||
with client_factory(curve=args.ecdsa_curve_name) as conn:
|
||||
label = args.identity
|
||||
command = args.command
|
||||
|
||||
@@ -104,7 +104,7 @@ def run_agent(client_factory):
|
||||
if command:
|
||||
command = ['git'] + command
|
||||
|
||||
public_key = client.get_public_key(label=label)
|
||||
public_key = conn.get_public_key(label=label)
|
||||
|
||||
use_shell = False
|
||||
if args.connect:
|
||||
@@ -120,7 +120,7 @@ def run_agent(client_factory):
|
||||
return
|
||||
|
||||
try:
|
||||
signer = functools.partial(ssh_sign, client=client)
|
||||
signer = functools.partial(ssh_sign, conn=conn)
|
||||
public_keys = [formats.import_public_key(public_key)]
|
||||
handler = protocol.Handler(keys=public_keys, signer=signer,
|
||||
debug=args.debug)
|
||||
@@ -132,5 +132,5 @@ def run_agent(client_factory):
|
||||
log.info('server stopped')
|
||||
|
||||
|
||||
def trezor_agent():
|
||||
run_agent(trezor.Client)
|
||||
def main():
|
||||
run_agent(client.Client)
|
||||
|
||||
@@ -5,7 +5,7 @@ import re
|
||||
import struct
|
||||
|
||||
from . import factory
|
||||
from .. import formats, util
|
||||
from . import formats, util
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import mock
|
||||
import pytest
|
||||
|
||||
from ..trezor import factory
|
||||
from .. import factory
|
||||
|
||||
|
||||
def test_load():
|
||||
|
||||
@@ -3,7 +3,7 @@ import io
|
||||
import mock
|
||||
|
||||
from .. import formats, util
|
||||
from ..trezor import client, factory
|
||||
from .. import client, factory
|
||||
|
||||
ADDR = [2147483661, 2810943954, 3938368396, 3454558782, 3848009040]
|
||||
CURVE = 'nist256p1'
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
from .client import Client
|
||||
Reference in New Issue
Block a user