From e3c0fd947d2c282f87daa90e21f17e5f209911c1 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Fri, 30 Jan 2026 10:58:11 +0100 Subject: [PATCH 1/8] Adding blank SSO preset --- .../recipe.json | 20 +++++- .../pi-system-retrieve-list/recipe.json | 20 +++++- custom-recipes/pi-system-write/recipe.json | 20 +++++- parameter-sets/oauth-sso/parameter-set.json | 70 +++++++++++++++++++ .../pi-system_attribute-search/connector.json | 20 +++++- .../connector.json | 20 +++++- .../pi-system_pi-explorer/connector.json | 20 +++++- .../pi-system_piwebapi-toolbox/connector.json | 20 +++++- python-lib/osisoft_client.py | 11 +-- python-lib/osisoft_plugin_auth.py | 22 ++++++ python-lib/osisoft_plugin_common.py | 60 +++++++++++++--- resource/browse_attributes.py | 14 ---- 12 files changed, 277 insertions(+), 40 deletions(-) create mode 100644 parameter-sets/oauth-sso/parameter-set.json create mode 100644 python-lib/osisoft_plugin_auth.py diff --git a/custom-recipes/pi-system-retrieve-event-frames/recipe.json b/custom-recipes/pi-system-retrieve-event-frames/recipe.json index 79c7b370..b4fe8ef7 100644 --- a/custom-recipes/pi-system-retrieve-event-frames/recipe.json +++ b/custom-recipes/pi-system-retrieve-event-frames/recipe.json @@ -32,11 +32,29 @@ "type": "SEPARATOR", "label": "Authentication" }, + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/custom-recipes/pi-system-retrieve-list/recipe.json b/custom-recipes/pi-system-retrieve-list/recipe.json index a7425143..4e8a545b 100644 --- a/custom-recipes/pi-system-retrieve-list/recipe.json +++ b/custom-recipes/pi-system-retrieve-list/recipe.json @@ -32,11 +32,29 @@ "type": "SEPARATOR", "label": "Authentication" }, + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/custom-recipes/pi-system-write/recipe.json b/custom-recipes/pi-system-write/recipe.json index e4fa2651..fd8c9a27 100644 --- a/custom-recipes/pi-system-write/recipe.json +++ b/custom-recipes/pi-system-write/recipe.json @@ -32,11 +32,29 @@ "type": "SEPARATOR", "label": "Authentication" }, + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/parameter-sets/oauth-sso/parameter-set.json b/parameter-sets/oauth-sso/parameter-set.json new file mode 100644 index 00000000..47f36ec8 --- /dev/null +++ b/parameter-sets/oauth-sso/parameter-set.json @@ -0,0 +1,70 @@ +{ + "meta" : { + "label": "OAuth SSO", + "description": "", + "icon": "icon-pi-system icon-cogs" + }, + "defaultDefinableInline": false, + "defaultDefinableAtProjectLevel": false, + "params": [ + { + "name": "default_server", + "label": "Server URL", + "type": "STRING", + "description": "my.pi-system.server.com" + }, + { + "name": "can_override_server_url", + "label": "Users can override server URL", + "type": "BOOLEAN", + "description": "Unsafe !", + "defaultValue": false + }, + { + "name": "can_disable_ssl_check", + "label": "Users can disable SSL checks", + "type": "BOOLEAN", + "description": "Unsafe !", + "defaultValue": false + }, + { + "name": "ssl_cert_path", + "label": "Path to SSL certificate", + "type": "STRING", + "description": "(optional)", + "defaultValue": "" + }, + { + "name": "secure_token", + "type": "CREDENTIAL_REQUEST", + "label": "Single Sign On", + "credentialRequestSettings": { + "type": "OAUTH2", + "authorizationEndpoint": " ", + "tokenEndpoint": " ", + "scope": " " + } + }, + { + "name": "authorizationEndpoint", + "label": "Authorization endpoint", + "type": "STRING", + "description": "", + "mandatory": false + }, + { + "name": "tokenEndpoint", + "label": "Token endpoint", + "type": "STRING", + "description": "", + "mandatory": false + }, + { + "name": "scope", + "label": "Scope", + "type": "STRING", + "description": "", + "mandatory": false + } + ] +} diff --git a/python-connectors/pi-system_attribute-search/connector.json b/python-connectors/pi-system_attribute-search/connector.json index 13fa9f2d..4bc1da0b 100644 --- a/python-connectors/pi-system_attribute-search/connector.json +++ b/python-connectors/pi-system_attribute-search/connector.json @@ -9,11 +9,29 @@ "kind": "PYTHON", "paramsPythonSetup": "browse_attributes.py", "params": [ + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/python-connectors/pi-system_event-frames-search/connector.json b/python-connectors/pi-system_event-frames-search/connector.json index 11decc07..6ebd5f88 100644 --- a/python-connectors/pi-system_event-frames-search/connector.json +++ b/python-connectors/pi-system_event-frames-search/connector.json @@ -9,11 +9,29 @@ "kind": "PYTHON", "paramsPythonSetup": "browse_event_frames.py", "params": [ + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/python-connectors/pi-system_pi-explorer/connector.json b/python-connectors/pi-system_pi-explorer/connector.json index 6194bb1c..41aba4b7 100644 --- a/python-connectors/pi-system_pi-explorer/connector.json +++ b/python-connectors/pi-system_pi-explorer/connector.json @@ -9,11 +9,29 @@ "kind": "PYTHON", "paramsPythonSetup": "browse_tags.py", "params": [ + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/python-connectors/pi-system_piwebapi-toolbox/connector.json b/python-connectors/pi-system_piwebapi-toolbox/connector.json index 4ffcab0a..e53c5f43 100644 --- a/python-connectors/pi-system_piwebapi-toolbox/connector.json +++ b/python-connectors/pi-system_piwebapi-toolbox/connector.json @@ -7,11 +7,29 @@ "readable": true, "writable": true, "params": [ + { + "name": "credentials_type", + "label": "Credentials type", + "type": "SELECT", + "selectChoices":[ + {"value": "basic_auth", "label": "User / Password"}, + {"value": "oauth_sso", "label": "Single Sign On"} + ], + "defaultValue": "basic_auth" + }, { "name": "credentials", "label": "User preset", "type": "PRESET", - "parameterSetId": "basic-auth" + "parameterSetId": "basic-auth", + "visibilityCondition": "model.credentials_type=='basic_auth'" + }, + { + "name": "oauth_credentials", + "label": "User preset", + "type": "PRESET", + "parameterSetId": "oauth-sso", + "visibilityCondition": "model.credentials_type=='oauth_sso'" }, { "name": "show_advanced_parameters", diff --git a/python-lib/osisoft_client.py b/python-lib/osisoft_client.py index d6d4d106..83ba3850 100644 --- a/python-lib/osisoft_client.py +++ b/python-lib/osisoft_client.py @@ -12,6 +12,7 @@ is_filtered_out, is_server_throttling, escape, epoch_to_iso, iso_to_epoch, RecordsLimit, is_iso8601, get_next_page_url, change_key_in_dict ) +from osisoft_plugin_auth import get_auth from osisoft_pagination import OffsetPagination from safe_logger import SafeLogger @@ -29,7 +30,7 @@ def __init__(self, server_url, auth_type, username, password, is_ssl_check_disab if can_raise: assert_server_url_ok(server_url) self.session = requests.Session() - self.session.auth = self.get_auth(auth_type, username, password) + self.session.auth = get_auth(auth_type, username, password) self.session.verify = (not is_ssl_check_disabled) logger.info("Initialization server_url={}, is_ssl_check_disabled={}".format(server_url, is_ssl_check_disabled)) self.endpoint = OSIsoftEndpoints(server_url) @@ -39,14 +40,6 @@ def __init__(self, server_url, auth_type, username, password, is_ssl_check_disab self.debug_level = None self.network_timer = network_timer - def get_auth(self, auth_type, username, password): - if auth_type == "basic": - return (username, password) - elif auth_type == "ntlm": - return HttpNtlmAuth(username, password) - else: - return None - def recursive_get_rows_from_webid(self, webid, data_type, **kwargs): # Split the time range until no more HTTP 400 kwargs["endpoint_type"] = kwargs.get("endpoint_type", "event_frames") diff --git a/python-lib/osisoft_plugin_auth.py b/python-lib/osisoft_plugin_auth.py new file mode 100644 index 00000000..97264483 --- /dev/null +++ b/python-lib/osisoft_plugin_auth.py @@ -0,0 +1,22 @@ +import requests +from requests_ntlm import HttpNtlmAuth + + +class BearerAuth(requests.auth.AuthBase): + def __init__(self, token): + self.token = token + + def __call__(self, request): + request.headers["Authorization"] = "Bearer {}".format(self.token) + return request + + +def get_auth(auth_type, username, password): + if auth_type == "basic": + return (username, password) + elif auth_type == "ntlm": + return HttpNtlmAuth(username, password) + elif auth_type == "bearer_token": + return BearerAuth(password) + else: + return None diff --git a/python-lib/osisoft_plugin_common.py b/python-lib/osisoft_plugin_common.py index 2a160dda..79d4d8a7 100644 --- a/python-lib/osisoft_plugin_common.py +++ b/python-lib/osisoft_plugin_common.py @@ -18,16 +18,47 @@ class PISystemConnectorError(ValueError): pass +class ErrorMessage(): + def __init__(self): + self.first_error_message = None + + def add(self, error_message): + if not self.first_error_message: + self.first_error_message = error_message + + def get(self): + return self.first_error_message + + def exists(self): + return self.first_error_message is not None + + def get_credentials(config, can_raise=True): - error_message = None - credentials = config.get('credentials', {}) - auth_type = credentials.get("auth_type", "basic") - osisoft_basic = credentials.get("osisoft_basic", {}) + error_message = ErrorMessage() + credentials_type = config.get("credentials_type", "basic_auth") + if credentials_type == "oauth_sso": + auth_type = "bearer_token" + credentials = config.get("oauth_credentials", {}) + if not credentials: + error_message.add("Pick a credential") + password = credentials.get("secure_token") + if not password: + error_message.add("Incorrect credential. Go to you profile page > Credentials > Your preset, click the connect button and processed to Single Sign On.") + username = None + else: + credentials = config.get('credentials', {}) + if not credentials: + error_message.add("Pick a credential") + auth_type = credentials.get("auth_type", "basic") + osisoft_basic = credentials.get("osisoft_basic", {}) + username = osisoft_basic.get("user") + password = osisoft_basic.get("password") + if not username or not password: + error_message.add("Incorrect credential. Go to you profile page > Credentials > Your preset, click the edit button and fill in you username and password details.") + ssl_cert_path = credentials.get("ssl_cert_path") if ssl_cert_path: setup_ssl_certificate(ssl_cert_path) - username = osisoft_basic.get("user") - password = osisoft_basic.get("password") show_advanced_parameters = config.get('show_advanced_parameters', False) server_url = credentials.get("default_server") is_ssl_check_disabled = False @@ -46,14 +77,16 @@ def get_credentials(config, can_raise=True): else: server_url = overwrite_server_url if (not can_disable_ssl_check) and is_ssl_check_disabled: - error_message = "You cannot disable SSL check on this preset. Please refer to your Dataiku admin" + error_message.add("You cannot disable SSL check on this preset. Please refer to your Dataiku admin") is_ssl_check_disabled = can_disable_ssl_check and is_ssl_check_disabled - if can_raise and error_message: - raise PISystemConnectorError(error_message) + if not server_url: + error_message.add("Fill in the server address") + if can_raise and error_message.exists(): + raise PISystemConnectorError(error_message.get()) if can_raise: return auth_type, username, password, server_url, is_ssl_check_disabled else: - return auth_type, username, password, server_url, is_ssl_check_disabled, error_message + return auth_type, username, password, server_url, is_ssl_check_disabled, error_message.get() def get_advanced_parameters(config): @@ -510,6 +543,13 @@ def get_element_name_from_path(path): return element_name +def assert_correct_config(config): + if "server_name" not in config: + raise PISystemConnectorError("There is no server selected") + if "database_name" not in config: + raise PISystemConnectorError("There is no database selected") + + class RecordsLimit(): def __init__(self, records_limit=-1): self.has_no_limit = (records_limit == -1) diff --git a/resource/browse_attributes.py b/resource/browse_attributes.py index cd39fd1e..3d431887 100644 --- a/resource/browse_attributes.py +++ b/resource/browse_attributes.py @@ -9,26 +9,12 @@ def do(payload, config, plugin_config, inputs): config = config.get("config") if "credentials" not in config: return {"choices": [{"label": "Requires DSS v10.0.4 or above. Please use the OSIsoft Search custom dataset instead"}]} - elif config.get("credentials") == {}: - return {"choices": [{"label": "Pick a credential"}]} auth_type, username, password, server_url, is_ssl_check_disabled, credential_error = get_credentials(config, can_raise=False) if credential_error: return build_select_choices(credential_error) - if not (auth_type and username and password): - return build_select_choices("Pick a credential") - - if not username or not password: - return build_select_choices( - "Incorrect credential. " - + "Go to you profile page > Credentials > Your preset, click the edit button and fill in you username and password details." - ) - - if not server_url: - return build_select_choices("Fill in the server address") - is_debug_mode = check_debug_mode(config) client = OSIsoftClient(server_url, auth_type, username, password, is_ssl_check_disabled=is_ssl_check_disabled, is_debug_mode=is_debug_mode) From 03224145f3ffcc31f325f5664d03382fb12e7694 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Mon, 2 Feb 2026 11:54:03 +0100 Subject: [PATCH 2/8] v1.5.0 --- plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.json b/plugin.json index 8daebaf9..30972ec1 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "id": "pi-system", - "version": "1.4.0", + "version": "1.5.0", "meta": { "label": "PI System", "description": "Retrieve data from your OSIsoft PI System servers", From 8b84f83967069244ba19d1b016ef25a56879f9f2 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Mon, 2 Feb 2026 11:54:13 +0100 Subject: [PATCH 3/8] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bee789b8..4bbdf3e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Version 1.5.0](https://github.com/dataiku/dss-plugin-pi-server/releases/tag/v1.5.0) - Bugfix release - 2026-02-02 + +- Add blank OAuth SSO preset + ## [Version 1.4.0](https://github.com/dataiku/dss-plugin-pi-server/releases/tag/v1.3.1) - Bugfix release - 2025-05-24 - Add write recipe From 46ec8558085e163c5074ae77b4d39dc5395d9fe5 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Mon, 2 Feb 2026 11:54:21 +0100 Subject: [PATCH 4/8] beta.1 --- python-lib/osisoft_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-lib/osisoft_constants.py b/python-lib/osisoft_constants.py index 3afbbd0d..ec140a89 100644 --- a/python-lib/osisoft_constants.py +++ b/python-lib/osisoft_constants.py @@ -405,7 +405,7 @@ class OSIsoftConstants(object): "Security": "{base_url}/eventframes/{webid}/security", "SecurityEntries": "{base_url}/eventframes/{webid}/securityentries" } - PLUGIN_VERSION = "1.4.0" + PLUGIN_VERSION = "1.5.0-beta.1" VALUE_COLUMN_SUFFIX = "_val" WEB_API_PATH = "piwebapi" WRITE_HEADERS = {'X-Requested-With': 'XmlHttpRequest'} From 9c6bb75b3967b0923c555e521ded599109237119 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Tue, 10 Feb 2026 09:08:35 +0100 Subject: [PATCH 5/8] beta.2 --- python-lib/osisoft_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-lib/osisoft_constants.py b/python-lib/osisoft_constants.py index ec140a89..2ec3a18d 100644 --- a/python-lib/osisoft_constants.py +++ b/python-lib/osisoft_constants.py @@ -405,7 +405,7 @@ class OSIsoftConstants(object): "Security": "{base_url}/eventframes/{webid}/security", "SecurityEntries": "{base_url}/eventframes/{webid}/securityentries" } - PLUGIN_VERSION = "1.5.0-beta.1" + PLUGIN_VERSION = "1.5.0-beta.2" VALUE_COLUMN_SUFFIX = "_val" WEB_API_PATH = "piwebapi" WRITE_HEADERS = {'X-Requested-With': 'XmlHttpRequest'} From 75d85a982ecd0f28a7306b1827082b4e8271f114 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Tue, 19 May 2026 18:21:27 +0200 Subject: [PATCH 6/8] adding oauth preset with secret --- .../pi-system_attribute-search/connector.json | 12 ++++++-- python-lib/osisoft_plugin_common.py | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/python-connectors/pi-system_attribute-search/connector.json b/python-connectors/pi-system_attribute-search/connector.json index 4bc1da0b..850c7ddf 100644 --- a/python-connectors/pi-system_attribute-search/connector.json +++ b/python-connectors/pi-system_attribute-search/connector.json @@ -15,7 +15,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -28,11 +29,18 @@ }, { "name": "oauth_credentials", - "label": "User preset", + "label": "SSO preset", "type": "PRESET", "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": " ", diff --git a/python-lib/osisoft_plugin_common.py b/python-lib/osisoft_plugin_common.py index 79d4d8a7..5321e7d5 100644 --- a/python-lib/osisoft_plugin_common.py +++ b/python-lib/osisoft_plugin_common.py @@ -6,6 +6,7 @@ from datetime import datetime, timezone import dateutil.parser as date_parser import re +import requests regex_iso8601 = r'^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$' @@ -45,6 +46,33 @@ def get_credentials(config, can_raise=True): if not password: error_message.add("Incorrect credential. Go to you profile page > Credentials > Your preset, click the connect button and processed to Single Sign On.") username = None + elif credentials_type == "oauth_secret": + auth_type = "bearer_token" + credentials = config.get("oauth_secret", {}) + client_id = credentials.get("client_id") + if not client_id: + error_message.add("The client ID is not set") + client_secret = credentials.get("client_secret") + if not client_secret: + error_message.add("The client secret is not set") + token_endpoint = credentials.get("tokenEndpoint") + if not token_endpoint: + error_message.add("The token endpoint url is not set") + scope = credentials.get("scope", "") + request = { + "grant_type": "client_credentials", + "client_id": client_id, + "client_secret": client_secret, + "scope": scope + } + json_response = {} + try: + response = requests.post(token_endpoint, data=request) + json_response = response.json() + except Exception as error: + error_message.add("Error while retrieving token: {}".format(error)) + password = json_response.get("access_token") + username = None else: credentials = config.get('credentials', {}) if not credentials: From e1c12dd63d5eb461497bc5fc455e7b557526d027 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Tue, 19 May 2026 18:23:13 +0200 Subject: [PATCH 7/8] beta.3 --- python-lib/osisoft_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-lib/osisoft_constants.py b/python-lib/osisoft_constants.py index 2ec3a18d..8d018033 100644 --- a/python-lib/osisoft_constants.py +++ b/python-lib/osisoft_constants.py @@ -405,7 +405,7 @@ class OSIsoftConstants(object): "Security": "{base_url}/eventframes/{webid}/security", "SecurityEntries": "{base_url}/eventframes/{webid}/securityentries" } - PLUGIN_VERSION = "1.5.0-beta.2" + PLUGIN_VERSION = "1.5.0-beta.3" VALUE_COLUMN_SUFFIX = "_val" WEB_API_PATH = "piwebapi" WRITE_HEADERS = {'X-Requested-With': 'XmlHttpRequest'} From 909cf113df413d4801e77ccd9514cecc0a2c2b88 Mon Sep 17 00:00:00 2001 From: Alex Bourret Date: Mon, 25 May 2026 11:44:12 +0200 Subject: [PATCH 8/8] extend secret oauth to all connectors and recipe --- .../recipe.json | 10 ++- .../pi-system-retrieve-list/recipe.json | 10 ++- custom-recipes/pi-system-write/recipe.json | 10 ++- .../oauth-secret/parameter-set.json | 66 +++++++++++++++++++ .../connector.json | 10 ++- .../pi-system_pi-explorer/connector.json | 10 ++- .../pi-system_piwebapi-toolbox/connector.json | 10 ++- 7 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 parameter-sets/oauth-secret/parameter-set.json diff --git a/custom-recipes/pi-system-retrieve-event-frames/recipe.json b/custom-recipes/pi-system-retrieve-event-frames/recipe.json index b4fe8ef7..8002a793 100644 --- a/custom-recipes/pi-system-retrieve-event-frames/recipe.json +++ b/custom-recipes/pi-system-retrieve-event-frames/recipe.json @@ -38,7 +38,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -56,6 +57,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": "Show advanced parameters", diff --git a/custom-recipes/pi-system-retrieve-list/recipe.json b/custom-recipes/pi-system-retrieve-list/recipe.json index 4e8a545b..dd9d007b 100644 --- a/custom-recipes/pi-system-retrieve-list/recipe.json +++ b/custom-recipes/pi-system-retrieve-list/recipe.json @@ -38,7 +38,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -56,6 +57,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": "Show advanced parameters", diff --git a/custom-recipes/pi-system-write/recipe.json b/custom-recipes/pi-system-write/recipe.json index fd8c9a27..06e34ef5 100644 --- a/custom-recipes/pi-system-write/recipe.json +++ b/custom-recipes/pi-system-write/recipe.json @@ -38,7 +38,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -56,6 +57,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": "Show advanced parameters", diff --git a/parameter-sets/oauth-secret/parameter-set.json b/parameter-sets/oauth-secret/parameter-set.json new file mode 100644 index 00000000..3f8b92be --- /dev/null +++ b/parameter-sets/oauth-secret/parameter-set.json @@ -0,0 +1,66 @@ +{ + "meta" : { + "label": "OAuth Secret", + "description": "", + "icon": "icon-pi-system icon-cogs" + }, + "defaultDefinableInline": true, + "defaultDefinableAtProjectLevel": true, + "params": [ + { + "name": "default_server", + "label": "Server URL", + "type": "STRING", + "description": "my.pi-system.server.com" + }, + { + "name": "can_override_server_url", + "label": "Users can override server URL", + "type": "BOOLEAN", + "description": "Unsafe !", + "defaultValue": false + }, + { + "name": "can_disable_ssl_check", + "label": "Users can disable SSL checks", + "type": "BOOLEAN", + "description": "Unsafe !", + "defaultValue": false + }, + { + "name": "ssl_cert_path", + "label": "Path to SSL certificate", + "type": "STRING", + "description": "(optional)", + "defaultValue": "" + }, + { + "name": "tokenEndpoint", + "label": "Token endpoint", + "type": "STRING", + "description": "", + "mandatory": false + }, + { + "name": "client_id", + "label": "Client ID", + "type": "STRING", + "description": "", + "mandatory": false + }, + { + "name": "client_secret", + "label": "Client secret", + "type": "PASSWORD", + "description": "", + "mandatory": false + }, + { + "name": "scope", + "label": "Scope", + "type": "STRING", + "description": "", + "mandatory": false + } + ] +} diff --git a/python-connectors/pi-system_event-frames-search/connector.json b/python-connectors/pi-system_event-frames-search/connector.json index 6ebd5f88..007ffdc3 100644 --- a/python-connectors/pi-system_event-frames-search/connector.json +++ b/python-connectors/pi-system_event-frames-search/connector.json @@ -15,7 +15,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -33,6 +34,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": " ", diff --git a/python-connectors/pi-system_pi-explorer/connector.json b/python-connectors/pi-system_pi-explorer/connector.json index 41aba4b7..e98fc613 100644 --- a/python-connectors/pi-system_pi-explorer/connector.json +++ b/python-connectors/pi-system_pi-explorer/connector.json @@ -15,7 +15,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -33,6 +34,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": " ", diff --git a/python-connectors/pi-system_piwebapi-toolbox/connector.json b/python-connectors/pi-system_piwebapi-toolbox/connector.json index e53c5f43..0def8530 100644 --- a/python-connectors/pi-system_piwebapi-toolbox/connector.json +++ b/python-connectors/pi-system_piwebapi-toolbox/connector.json @@ -13,7 +13,8 @@ "type": "SELECT", "selectChoices":[ {"value": "basic_auth", "label": "User / Password"}, - {"value": "oauth_sso", "label": "Single Sign On"} + {"value": "oauth_sso", "label": "Single Sign On"}, + {"value": "oauth_secret", "label": "OAuth with secret"} ], "defaultValue": "basic_auth" }, @@ -31,6 +32,13 @@ "parameterSetId": "oauth-sso", "visibilityCondition": "model.credentials_type=='oauth_sso'" }, + { + "name": "oauth_secret", + "label": "Oauth with secret preset", + "type": "PRESET", + "parameterSetId": "oauth-secret", + "visibilityCondition": "model.credentials_type=='oauth_secret'" + }, { "name": "show_advanced_parameters", "label": "Show advanced parameters",