diff --git a/pyproject.toml b/pyproject.toml index 5ed7209..acf99ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] [tool.poetry.dependencies] python = ">=3.10,<4.0" -volttron-core = ">=2.0.0rc13" +volttron-core = ">=2.0.0rc26" [tool.poetry.group.dev.dependencies] # formatting, quality, tests diff --git a/src/volttron/auth/auth_service.py b/src/volttron/auth/auth_service.py index 48c80da..a1eb527 100644 --- a/src/volttron/auth/auth_service.py +++ b/src/volttron/auth/auth_service.py @@ -176,13 +176,12 @@ def get_credentials(self, *, identity: Identity) -> Credentials: except IdentityNotFound as e: raise VIPError(f"Credentials not found for identity {identity}") from e - def add_federation_platform(self, platform_id: str, credentials: Any) -> bool: + def register_remote_platform(self, platform_id: str, credentials: Any): """ Register a remote platform for federation access :param platform_id: ID of the remote platform :param credentials: Authentication credentials for the remote platform (public key) - :return: True if registration was successful, False otherwise """ try: # Store the platform credentials @@ -193,15 +192,10 @@ def add_federation_platform(self, platform_id: str, credentials: Any) -> bool: platform_identity = f"{platform_id}" public_creds = PublicCredentials(identity=f"{platform_identity}", publickey=credentials) - - self._credentials_store.store_credentials(credentials=public_creds) - - - _log.info(f"Federation platform registered: {platform_id}") - return True + self._credentials_store.store_credentials(credentials=public_creds, overwrite=True) except Exception as e: _log.error(f"Error registering federation platform {platform_id}: {e}") - return False + raise def remove_federation_platform(self, platform_id: str) -> bool: """