File tree 2 files changed +170
-5
lines changed
2 files changed +170
-5
lines changed Original file line number Diff line number Diff line change 13
13
from . import forms
14
14
from . import signature
15
15
16
+ from django .utils .decorators import method_decorator
17
+ from drf_yasg .utils import swagger_auto_schema
18
+ from drf_yasg import openapi
19
+
16
20
def register_user (request ):
17
21
if request .method == 'POST' :
18
22
form = forms .NewUserForm (request .POST )
@@ -27,7 +31,25 @@ def register_user(request):
27
31
form = forms .NewUserForm ()
28
32
return render (request , 'register.html' , {'form' : form })
29
33
34
+ @method_decorator (name = 'post' , decorator = swagger_auto_schema (
35
+ request_body = openapi .Schema (
36
+ type = openapi .TYPE_OBJECT ,
37
+ required = [
38
+ 'url'
39
+ ],
40
+ properties = {
41
+ 'url' : openapi .Schema (type = openapi .TYPE_STRING )
42
+ }
43
+ ),
44
+ responses = {'200' : openapi .Response (description = 'text URL' )}
45
+ ))
30
46
class SigningView (views .APIView ):
47
+ """
48
+ This method signs URL for access to the server.
49
+
50
+ Signed URL contains a token which authenticates a user on the server.
51
+ Signed URL is valid during 30 seconds since signing.
52
+ """
31
53
def post (self , request ):
32
54
url = request .data .get ('url' )
33
55
if not url :
You can’t perform that action at this time.
0 commit comments