From b3e0ec24a75e640dd5d2de46b5e8d58ef387934d Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Tue, 21 Jan 2025 09:46:30 +0100 Subject: [PATCH 1/2] fixup! Ensure each public method in the HubManager enforce authorization --- java/code/src/com/suse/manager/hub/SyncController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/code/src/com/suse/manager/hub/SyncController.java b/java/code/src/com/suse/manager/hub/SyncController.java index 643d78824c97..5f2b38eeb17c 100644 --- a/java/code/src/com/suse/manager/hub/SyncController.java +++ b/java/code/src/com/suse/manager/hub/SyncController.java @@ -24,7 +24,6 @@ import com.redhat.rhn.domain.credentials.HubSCCCredentials; import com.suse.manager.model.hub.IssAccessToken; -import com.suse.manager.model.hub.IssRole; import com.suse.manager.model.hub.RegisterJson; import com.suse.manager.model.hub.SCCCredentialsJson; import com.suse.manager.webui.controllers.ECMAScriptDateAdapter; From e9afa6613f55b8bd6743079c93b3f1d9501754bc Mon Sep 17 00:00:00 2001 From: Michael Calmer Date: Tue, 21 Jan 2025 11:25:55 +0100 Subject: [PATCH 2/2] fixup! Added API to register hub/peripherals --- .../code/src/com/suse/manager/xmlrpc/iss/IssHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java/code/src/com/suse/manager/xmlrpc/iss/IssHandler.java b/java/code/src/com/suse/manager/xmlrpc/iss/IssHandler.java index c5754f2492e2..85df87713504 100644 --- a/java/code/src/com/suse/manager/xmlrpc/iss/IssHandler.java +++ b/java/code/src/com/suse/manager/xmlrpc/iss/IssHandler.java @@ -66,7 +66,6 @@ public IssHandler(HubManager hubManagerIn) { * Generate a new access token for ISS for accessing this system * @param loggedInUser the user logged in. It must have the sat admin role. * @param fqdn the FQDN of the peripheral/hub that will be using this access token - * * @return the serialized form of the token * * @apidoc.doc Generate a new access token for ISS for accessing this system @@ -141,6 +140,7 @@ public int storeAccessToken(User loggedInUser, String fqdn, String token) { * @param username the name of the user, needed to access the remote server. It must have the sat admin role. * @param password the password of the user, needed to access the remote server. * @return 1 on success, exception otherwise + * * @apidoc.doc Registers automatically a remote server with the specified ISS role. * @apidoc.param #session_key() * @apidoc.param #param_desc("string", "fqdn", "the FQDN of the remote server to register ") @@ -164,6 +164,7 @@ public int register(User loggedInUser, String fqdn, String role, String username * @param password the password of the user, needed to access the remote server. * @param rootCA the root CA certificate, in case it's needed to establish a secure connection * @return 1 on success, exception otherwise + * * @apidoc.doc Registers automatically a remote server with the specified ISS role. * @apidoc.param #session_key() * @apidoc.param #param_desc("string", "fqdn", "the FQDN of the remote server to register ") @@ -172,7 +173,7 @@ public int register(User loggedInUser, String fqdn, String role, String username * It must have the sat admin role") * @apidoc.param #param_desc("string", "password", "the password of the user, needed to access the remote * server") - * @apidoc.param #param_desc("string", "rootCA", the root CA certificate, in case it's needed to establish a secure + * @apidoc.param #param_desc("string", "rootCA", "the root CA certificate, in case it's needed to establish a secure * connection") * @apidoc.returntype #return_int_success() */ @@ -222,6 +223,7 @@ public int register(User loggedInUser, String fqdn, String role, String username * @param role the ISS role of the remote server. Can be either HUB or PERIPHERAL * @param token the token used to authenticate on the remote server. * @return 1 on success, exception otherwise + * * @apidoc.doc Registers a remote server with the specified ISS role using an existing specified access token. * @apidoc.param #session_key() * @apidoc.param #param_desc("string", "fqdn", "the FQDN of the remote server to register ") @@ -241,12 +243,13 @@ public int registerWithToken(User loggedInUser, String fqdn, String role, String * @param token the token used to authenticate on the remote server. * @param rootCA the root CA certificate, in case it's needed to establish a secure connection * @return 1 on success, exception otherwise + * * @apidoc.doc Registers a remote server with the specified ISS role using an existing specified access token. * @apidoc.param #session_key() * @apidoc.param #param_desc("string", "fqdn", "the FQDN of the remote server to register ") * @apidoc.param #param_desc("string", "role", "the ISS role of the remote server. Either HUB or PERIPHERAL") * @apidoc.param #param_desc("string", "token", "the token used to authenticate on the remote server.") - * @apidoc.param #param_desc("string", "rootCA", the root CA certificate, in case it's needed to establish a secure + * @apidoc.param #param_desc("string", "rootCA", "the root CA certificate, in case it's needed to establish a secure * connection") * @apidoc.returntype #return_int_success() */