Skip to content
Snippets Groups Projects
Unverified Commit 4ea38585 authored by Mikael Arguedas's avatar Mikael Arguedas Committed by GitHub
Browse files

remove distribute_key completely (#197)


Signed-off-by: default avatarMikael Arguedas <mikael.arguedas@gmail.com>
parent 4a212b39
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@ setup(
],
description='SROS2 provides tools to help manage security keys.',
long_description="""\
SROS2 provides command-line tools to help generate and distribute keys and \
SROS2 provides command-line tools to help generate keys and \
certificates which are then used by supported middleware implementations to \
enhance the security of ROS 2 deployments.""",
license='Apache License, Version 2.0',
......@@ -64,7 +64,6 @@ enhance the security of ROS 2 deployments.""",
'create_keystore = sros2.verb.create_keystore:CreateKeystoreVerb',
'create_permission = sros2.verb.create_permission'
':CreatePermissionVerb',
'distribute_key = sros2.verb.distribute_key:DistributeKeyVerb',
'generate_artifacts = sros2.verb.generate_artifacts:GenerateArtifactsVerb',
# TODO(ivanpauno): Reactivate this after having a way to introspect
# security context names in rclpy.
......
# Copyright 2016-2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
def distribute_key(source_keystore_path, taget_keystore_path):
raise NotImplementedError()
# Copyright 2016-2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try:
from argcomplete.completers import DirectoriesCompleter
except ImportError:
def DirectoriesCompleter():
return None
from sros2.api import distribute_key
from sros2.verb import VerbExtension
class DistributeKeyVerb(VerbExtension):
"""Distribute key."""
def add_arguments(self, parser, cli_name):
arg = parser.add_argument('ROOT', help='root path of keystore')
arg.completer = DirectoriesCompleter()
parser.add_argument('TARGET', help='target keystore path')
arg.completer = DirectoriesCompleter()
def main(self, *, args):
success = distribute_key(args.ROOT, args.TARGET)
return 0 if success else 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment