Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
django-sshkey
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1bc2e8d1
authored
Mar 25, 2014
by
Scott Duckworth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove sshkey_authorized_keys_command management command
parent
b5cd037a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
80 deletions
+0
-80
django_sshkey/management/__init__.py
+0
-16
django_sshkey/management/commands/__init__.py
+0
-16
django_sshkey/management/commands/sshkey_authorized_keys_command.py
+0
-48
No files found.
django_sshkey/management/__init__.py
deleted
100644 → 0
View file @
b5cd037a
# Copyright 2013 Scott Duckworth
#
# This file is part of django-sshkey.
#
# django-sshkey is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# django-sshkey is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with django-sshkey. If not, see <http://www.gnu.org/licenses/>.
django_sshkey/management/commands/__init__.py
deleted
100644 → 0
View file @
b5cd037a
# Copyright 2013 Scott Duckworth
#
# This file is part of django-sshkey.
#
# django-sshkey is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# django-sshkey is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with django-sshkey. If not, see <http://www.gnu.org/licenses/>.
django_sshkey/management/commands/sshkey_authorized_keys_command.py
deleted
100644 → 0
View file @
b5cd037a
# Copyright 2013 Scott Duckworth
#
# This file is part of django-sshkey.
#
# django-sshkey is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# django-sshkey is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with django-sshkey. If not, see <http://www.gnu.org/licenses/>.
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.conf
import
settings
from
django_sshkey.models
import
UserKey
from
django_sshkey.util
import
sshkey_fingerprint
import
sys
class
Command
(
BaseCommand
):
args
=
'[<username>]'
def
handle
(
self
,
*
args
,
**
options
):
if
len
(
args
)
==
0
:
line
=
sys
.
stdin
.
readline
()
if
not
line
:
raise
CommandError
(
'no input given'
)
fingerprint
=
sshkey_fingerprint
(
line
)
keys
=
UserKey
.
objects
.
filter
(
fingerprint
=
fingerprint
)
elif
len
(
args
)
==
1
:
keys
=
UserKey
.
objects
.
filter
(
user__username
=
args
[
0
])
else
:
raise
CommandError
(
'invalid number of arguments'
)
status
=
1
for
key
in
keys
:
status
=
0
try
:
options
=
'command="
%
s" '
%
(
settings
.
SSHKEY_AUTHORIZED_KEYS_COMMAND
.
format
(
username
=
key
.
user
.
username
)
.
replace
(
'"'
,
r'\"'
)
)
except
AttributeError
:
options
=
''
print
(
options
+
key
.
key
)
return
status
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment