Commit 9d4ed075 by Scott Duckworth

move sshkey_re to util.py

parent 57301416
......@@ -18,10 +18,7 @@
from django.db import models
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django_sshkey.util import sshkey_fingerprint
import re
sshkey_re = re.compile(r'(?P<type>[\w-]+)\s+(?P<b64key>\S+)(?:\s+(?P<comment>\S+))?$')
from django_sshkey.util import sshkey_re, sshkey_fingerprint
class UserKey(models.Model):
user = models.ForeignKey(User, db_index=True)
......
......@@ -15,6 +15,10 @@
# 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/>.
import re
sshkey_re = re.compile(r'(?P<type>[\w-]+)\s+(?P<b64key>\S+)(?:\s+(?P<comment>\S.+))?$')
def sshkey_fingerprint(b64key):
import base64
import hashlib
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment