From ea839ecb9187ea8257276e3d832819ff7bf4e800 Mon Sep 17 00:00:00 2001 From: Robert Isele Date: Tue, 17 Feb 2026 09:44:42 +0100 Subject: [PATCH] Extended Python context classes --- CHANGELOG.md | 7 ++++++ cmem_plugin_base/dataintegration/context.py | 26 ++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d252337..689ad6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/) +## [Unreleased] + +### Added + +- Added `cmem_base_uri`, `dp_api_endpoint`, and `di_api_endpoint` to `SystemContext`. +- Added `refresh_token` to `UserContext`. + ## [4.15.0] 2025-10-15 ### Changed diff --git a/cmem_plugin_base/dataintegration/context.py b/cmem_plugin_base/dataintegration/context.py index 4b98cbf..93a2505 100644 --- a/cmem_plugin_base/dataintegration/context.py +++ b/cmem_plugin_base/dataintegration/context.py @@ -16,6 +16,24 @@ class SystemContext: def di_version(self) -> str: """Get the version of the running DataIntegration instance""" + def cmem_base_uri(self) -> str | None: + """Get the base URI of eccenca DataManager. + + Returns the base URI without trailing slash if configured, otherwise None. + """ + + def dp_api_endpoint(self) -> str | None: + """Get the base URI of eccenca DataPlatform. + + Returns the base URI without trailing slash if configured, otherwise None. + """ + + def di_api_endpoint(self) -> str: + """Get the base URI of eccenca DataIntegration. + + Returns the base URI without trailing slash. + """ + def encrypt(self, value: str) -> str: """Encrypt a value using the secret key @@ -39,7 +57,13 @@ def user_label(self) -> str: """Get the name of the user""" def token(self) -> str: - """Retrieve the oAuth token for the user""" + """Retrieve the oAuth token for the user. + + Will already be refreshed if expired. + """ + + def refresh_token(self) -> str: + """Retrieve the oAuth refresh token for the user""" class TaskContext: