Skip to content
Permalink
Browse files

Added token value to ensure

  • Loading branch information
joamag committed Apr 4, 2019
1 parent d87b7e7 commit adfee2682bb309844c73a2ce8cf562447199c949
@@ -9,7 +9,7 @@ class BaseController(appier.Controller):

@appier.route("/", "GET")
@appier.route("/index", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def index(self):
return self.template(
"index.html.tpl",
@@ -42,7 +42,7 @@ def logout(self):
)

@appier.route("/about", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def about(self):
return self.template(
"about.html.tpl",
@@ -63,7 +63,7 @@ def oauth(self):
)

@appier.route("/deploy", ("GET", "POST"))
@appier.ensure("base")
@appier.ensure(token = "base")
def deploy(self):
api = self.get_api()
droplet = dict(
@@ -10,15 +10,15 @@
class DropletController(appier.Controller):

@appier.route("/droplets", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def list(self):
return self.template(
"droplet/list.html.tpl",
link = "droplets"
)

@appier.route("/droplets.json", "GET", json = True)
@appier.ensure("base")
@appier.ensure(token = "base")
def list_json(self):
api = self.get_api()
start = self.field("start_record", 0, cast = int)
@@ -28,7 +28,7 @@ def list_json(self):
return droplets

@appier.route("/droplets/<int:id>", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def show(self, id):
instance = self._ensure(id)
is_url = type(instance) == str
@@ -42,7 +42,7 @@ def show(self, id):
)

@appier.route("/droplets/<int:id>/features", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def features(self, id):
instance = digitalriver.Instance.by_id(id)
return self.template(
@@ -54,7 +54,7 @@ def features(self, id):
)

@appier.route("/droplets/<int:id>/config", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def config(self, id):
instance = digitalriver.Instance.by_id(id)
return self.template(
@@ -67,7 +67,7 @@ def config(self, id):
)

@appier.route("/droplets/<int:id>/config", "POST")
@appier.ensure("base")
@appier.ensure(token = "base")
def do_config(self, id):
instance = digitalriver.Instance.by_id(id)
instance.apply()
@@ -86,7 +86,7 @@ def do_config(self, id):
)

@appier.route("/droplets/<int:id>/provision", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def new_provision(self, id):
instance = digitalriver.Instance.by_id(id)
return self.template(
@@ -99,7 +99,7 @@ def new_provision(self, id):
)

@appier.route("/droplets/<int:id>/provision", "POST")
@appier.ensure("base")
@appier.ensure(token = "base")
def create_provision(self, id):
provision = digitalriver.Provision.new()
try: provision.save()
@@ -118,7 +118,7 @@ def create_provision(self, id):
)

@appier.route("/droplets/<int:id>/feature/delete", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def remove_feature(self, id):
feature = self.field("feature", mandatory = True)
instance = digitalriver.Instance.by_id(id)
@@ -134,7 +134,7 @@ def remove_feature(self, id):
)

@appier.route("/droplets/<int:id>/feature/rebuild", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def rebuild_feature(self, id):
url = self.field("feature", mandatory = True)
instance = digitalriver.Instance.by_id(id)
@@ -153,7 +153,7 @@ def rebuild_feature(self, id):
)

@appier.route("/droplets/<int:id>/sync", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def sync(self, id):
self._ensure(id, force = True)
instance = digitalriver.Instance.by_id(id)
@@ -167,7 +167,7 @@ def sync(self, id):
)

@appier.route("/droplets/<int:id>/process", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def process(self, id):
url = self.field("url", mandatory = True)
info = appier.get(url)
@@ -8,15 +8,15 @@
class ProvisionController(appier.Controller):

@appier.route("/provisions", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def list(self):
return self.template(
"provision/list.html.tpl",
link = "provisions"
)

@appier.route("/provisions.json", "GET", json = True)
@appier.ensure("base")
@appier.ensure(token = "base")
def list_json(self):
object = appier.get_object(
alias = True,
@@ -27,7 +27,7 @@ def list_json(self):
return provisions

@appier.route("/provisions/<str:pid>", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def show(self, pid):
provision = digitalriver.Provision.get(pid = pid)
return self.template(
@@ -38,7 +38,7 @@ def show(self, pid):
)

@appier.route("/provisions/<str:pid>/log", "GET")
@appier.ensure("base")
@appier.ensure(token = "base")
def log(self, pid):
provision = digitalriver.Provision.get(pid = pid)
return self.template(

0 comments on commit adfee26

Please sign in to comment.
You can’t perform that action at this time.