mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Make the default endpoint require authentication
This commit is contained in:
parent
6e2c9c0001
commit
f620eb0279
@ -17,7 +17,7 @@ default_methods = frozenset(('HEAD', 'GET'))
|
|||||||
def route_key(route):
|
def route_key(route):
|
||||||
return route.partition('{')[0].rstrip('/')
|
return route.partition('{')[0].rstrip('/')
|
||||||
|
|
||||||
def endpoint(route, methods=default_methods, types=None, auth_required=False, android_workaround=False):
|
def endpoint(route, methods=default_methods, types=None, auth_required=True, android_workaround=False):
|
||||||
def annotate(f):
|
def annotate(f):
|
||||||
f.route = route.rstrip('/') or '/'
|
f.route = route.rstrip('/') or '/'
|
||||||
f.types = types or {}
|
f.types = types or {}
|
||||||
|
@ -14,7 +14,7 @@ from calibre.srv.routes import endpoint, Router
|
|||||||
|
|
||||||
REALM = 'calibre-test'
|
REALM = 'calibre-test'
|
||||||
|
|
||||||
@endpoint('/open')
|
@endpoint('/open', auth_required=False)
|
||||||
def noauth(ctx, data):
|
def noauth(ctx, data):
|
||||||
return 'open'
|
return 'open'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user