mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #729 from ynput/enhancement/AY-5714_Provide-user-credential-fields-on-Deadline-Studio-Settings
Deadline: provide default user credential fields in studio settings
This commit is contained in:
commit
ea3c559143
4 changed files with 36 additions and 6 deletions
|
|
@ -19,6 +19,10 @@ from ayon_deadline.lib import FARM_FAMILIES
|
|||
|
||||
class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin):
|
||||
"""Collects user name and password for artist if DL requires authentication
|
||||
|
||||
If Deadline server is marked to require authentication, it looks first for
|
||||
default values in 'Studio Settings', which could be overriden by artist
|
||||
dependent values from 'Site settings`.
|
||||
"""
|
||||
order = pyblish.api.CollectorOrder + 0.250
|
||||
label = "Collect Deadline User Credentials"
|
||||
|
|
@ -72,6 +76,14 @@ class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin):
|
|||
|
||||
addons_manager = instance.context.data["ayonAddonsManager"]
|
||||
deadline_addon = addons_manager["deadline"]
|
||||
|
||||
default_username = deadline_info["default_username"]
|
||||
default_password = deadline_info["default_password"]
|
||||
if default_username and default_password:
|
||||
self.log.debug("Setting credentials from defaults")
|
||||
instance.data["deadline"]["auth"] = (default_username,
|
||||
default_password)
|
||||
|
||||
# TODO import 'get_addon_site_settings' when available
|
||||
# in public 'ayon_api'
|
||||
local_settings = get_server_api_connection().get_addon_site_settings(
|
||||
|
|
@ -79,5 +91,8 @@ class CollectDeadlineUserCredentials(pyblish.api.InstancePlugin):
|
|||
local_settings = local_settings["local_settings"]
|
||||
for server_info in local_settings:
|
||||
if deadline_server_name == server_info["server_name"]:
|
||||
instance.data["deadline"]["auth"] = (server_info["username"],
|
||||
server_info["password"])
|
||||
if server_info["username"] and server_info["password"]:
|
||||
self.log.debug("Setting credentials from Site Settings")
|
||||
instance.data["deadline"]["auth"] = \
|
||||
(server_info["username"], server_info["password"])
|
||||
break
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Package declaring AYON addon 'deadline' version."""
|
||||
__version__ = "0.2.2"
|
||||
__version__ = "0.2.3"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name = "deadline"
|
||||
title = "Deadline"
|
||||
version = "0.2.2"
|
||||
version = "0.2.3"
|
||||
|
||||
client_dir = "ayon_deadline"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,13 +34,25 @@ async def defined_deadline_ws_name_enum_resolver(
|
|||
|
||||
class ServerItemSubmodel(BaseSettingsModel):
|
||||
"""Connection info about configured DL servers."""
|
||||
_layout = "compact"
|
||||
_layout = "expanded"
|
||||
name: str = SettingsField(title="Name")
|
||||
value: str = SettingsField(title="Url")
|
||||
require_authentication: bool = SettingsField(
|
||||
False, title="Require authentication")
|
||||
not_verify_ssl: bool = SettingsField(
|
||||
False, title="Don't verify SSL")
|
||||
default_username: str = SettingsField(
|
||||
"",
|
||||
title="Default user name",
|
||||
description="Webservice username, 'Require authentication' must be "
|
||||
"enabled."
|
||||
)
|
||||
default_password: str = SettingsField(
|
||||
"",
|
||||
title="Default password",
|
||||
description="Webservice password, 'Require authentication' must be "
|
||||
"enabled."
|
||||
)
|
||||
|
||||
|
||||
class DeadlineSettings(BaseSettingsModel):
|
||||
|
|
@ -77,7 +89,10 @@ DEFAULT_VALUES = {
|
|||
"name": "default",
|
||||
"value": "http://127.0.0.1:8082",
|
||||
"require_authentication": False,
|
||||
"not_verify_ssl": False
|
||||
"not_verify_ssl": False,
|
||||
"default_username": "",
|
||||
"default_password": ""
|
||||
|
||||
}
|
||||
],
|
||||
"deadline_server": "default",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue