Browse Source

Update readme, auth ideas

patch-1
Nico Schottelius 4 years ago
parent
commit
cdb45bd1f0
  1. 15
      README.md
  2. 15
      ungleichotp/otpauth/models.py
  3. 3
      ungleichotp/ungleichotp/urls.py

15
README.md

@ -283,10 +283,23 @@ class ExampleAuthentication(authentication.BaseAuthentication):
```
Custom user
Don’t forget to point AUTH_USER_MODEL to it. Do this before creating any migrations or running manage.py migrate for the first time.
## TODOs
- [x] serialize / input request
- [ ] Remove hard coded JSON
- [ ] Implement registering of new entries
- [ ] Use Custom authentication (?) - set User
- [ ] Use Custom authentication (?) - needs to have a user
- [ ] Maybe we map name+realm == User (?)
- name == name@realm
- no password
- seed
- custom auth method
- [ ] Implement creating new "User"
- by POST / Model based
- [ ] Implement deleting "User"

15
ungleichotp/otpauth/models.py

@ -1,4 +1,5 @@
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class OTPSeed(models.Model):
@ -12,3 +13,17 @@ class OTPSeed(models.Model):
def __str__(self):
return "'{}'@{}".format(self.name, self.realm)
# class OTPUser(AbstractUser, OTPSeed):
# @classmethod
# def get_username(cls):
# pass
# @classmethod
# def check_password(cls, raw_password):
# """ receives a time based token"""
# pass
# @classmethod
# def has_usable_password(cls):
# pass

3
ungleichotp/ungleichotp/urls.py

@ -21,11 +21,12 @@ from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
from otpauth.models import OTPSeed
from otpauth.views import VerifyViewSet
from otpauth.views import ModelVerifyViewSet, VerifyViewSet
router = routers.DefaultRouter()
router.register(r'ungleichotp', VerifyViewSet, basename='ungleichotp')
router.register(r'ungleichotpv2', ModelVerifyViewSet, basename='ungleichotpv2')
print(router.urls)

Loading…
Cancel
Save