Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simone Rossi
main
Commits
9ebfcd34
Commit
9ebfcd34
authored
Apr 24, 2018
by
Daniele Venzano
Browse files
Labels can now be added to the ZApp manifest in the ZApp shop
These labels will be copied to all services when the ZApp is started
parent
59018bb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
zoe_api/auth/base.py
View file @
9ebfcd34
...
...
@@ -34,7 +34,7 @@ class BaseAuthenticator:
def
__init__
(
self
):
self
.
state
=
SQLManager
(
get_conf
())
def
full_auth
(
self
,
username
,
password
)
->
Union
[
None
,
User
]:
# pylint: disable=too-many-return-statements
def
full_auth
(
self
,
username
:
str
,
password
:
str
)
->
Union
[
None
,
User
]:
# pylint: disable=too-many-return-statements
"""This method verifies the username and the password against one of the external auth sources."""
user
=
self
.
state
.
user
.
select
(
only_one
=
True
,
**
{
"username"
:
username
})
if
user
is
None
or
not
user
.
enabled
:
...
...
zoe_api/web/zapp_shop.py
View file @
9ebfcd34
...
...
@@ -96,6 +96,8 @@ class ZAppStartWeb(ZoeWebRequestHandler):
exec_name
=
self
.
get_argument
(
'exec_name'
)
app_descr
=
self
.
_set_parameters
(
zapp
.
zoe_description
,
zapp
.
parameters
,
self
.
current_user
.
role
)
for
service
in
app_descr
[
'services'
]:
service
.
labels
.
append
(
zapp
.
labels
)
try
:
self
.
get_argument
(
'download_json'
)
...
...
zoe_api/zapp_shop.py
View file @
9ebfcd34
...
...
@@ -59,6 +59,10 @@ class ZApp:
self
.
readable_description
=
self
.
read_description
()
self
.
json_file
=
zapp
[
'description'
]
self
.
zoe_description
=
self
.
parse_json_description
()
if
'labels'
in
zapp
:
self
.
labels
=
zapp
[
'labels'
]
else
:
self
.
labels
=
[]
self
.
parameters
=
[]
self
.
parse_parameters
(
zapp
)
if
'guest_access'
in
zapp
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment