gnodet-bot commented on code in PR #29955:
URL: https://github.com/apache/camel/pull/29955#discussion_r4575256574


##########
components/camel-keycloak/src/main/java/org/apache/camel/component/keycloak/KeycloakConstants.java:
##########
@@ -96,38 +99,62 @@ public final class KeycloakConstants {
     @Metadata(description = "The identity provider alias", javaType = "String")
     public static final String IDP_ALIAS = "CamelKeycloakIdpAlias";
 
-    @Metadata(description = "The identity provider ID", javaType = "String")
+    @Metadata(description = "The identity provider ID", javaType = "String",
+              deprecationNote = "Never read by the component: the identity 
provider operations address a provider by its alias"
+                                + " (CamelKeycloakIdpAlias)")
+    @Deprecated
     public static final String IDP_ID = "CamelKeycloakIdpId";
 
     // Authorization Services constants
     @Metadata(description = "The resource ID", javaType = "String")
     public static final String RESOURCE_ID = "CamelKeycloakResourceId";
 
-    @Metadata(description = "The resource name", javaType = "String")
+    @Metadata(description = "The resource name", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_NAME = "CamelKeycloakResourceName";
 
-    @Metadata(description = "The resource type", javaType = "String")
+    @Metadata(description = "The resource type", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_TYPE = "CamelKeycloakResourceType";
 
-    @Metadata(description = "The resource URI", javaType = "String")
+    @Metadata(description = "The resource URI", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_URI = "CamelKeycloakResourceUri";
 
     @Metadata(description = "The policy ID", javaType = "String")
     public static final String POLICY_ID = "CamelKeycloakPolicyId";
 
-    @Metadata(description = "The policy name", javaType = "String")
+    @Metadata(description = "The policy name", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
policy operations take a PolicyRepresentation as the"
+                                + " POJO request body")
+    @Deprecated
     public static final String POLICY_NAME = "CamelKeycloakPolicyName";
 
-    @Metadata(description = "The policy type", javaType = "String")
+    @Metadata(description = "The policy type", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
policy operations take a PolicyRepresentation as the"
+                                + " POJO request body")
+    @Deprecated
     public static final String POLICY_TYPE = "CamelKeycloakPolicyType";
 
     @Metadata(description = "The permission ID", javaType = "String")
     public static final String PERMISSION_ID = "CamelKeycloakPermissionId";
 
-    @Metadata(description = "The permission name", javaType = "String")
+    @Metadata(description = "The permission name", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
permission operations take a PolicyRepresentation as"
+                                + " the POJO request body")
+    @Deprecated

Review Comment:
   ⚠️ **Inaccurate deprecation note** — `createResourcePermission` takes a 
`ResourcePermissionRepresentation`, not a `PolicyRepresentation`.
   
   From `KeycloakProducer.java`:
   ```java
   ResourcePermissionRepresentation permissionRepresentation
           = getPojoRequest(exchange, ResourcePermissionRepresentation.class);
   ```
   
   The `PolicyRepresentation` is used for `updatePermission` / 
`getPermissionById`, but the note specifically says "resource permission 
operations take a PolicyRepresentation as the POJO request body" which is 
misleading. Consider: `"Never read by the component: createResourcePermission 
takes a ResourcePermissionRepresentation and other permission operations use 
PERMISSION_ID"` (or simply remove the incorrect type reference).



##########
components/camel-keycloak/src/main/java/org/apache/camel/component/keycloak/KeycloakConstants.java:
##########
@@ -96,38 +99,62 @@ public final class KeycloakConstants {
     @Metadata(description = "The identity provider alias", javaType = "String")
     public static final String IDP_ALIAS = "CamelKeycloakIdpAlias";
 
-    @Metadata(description = "The identity provider ID", javaType = "String")
+    @Metadata(description = "The identity provider ID", javaType = "String",
+              deprecationNote = "Never read by the component: the identity 
provider operations address a provider by its alias"
+                                + " (CamelKeycloakIdpAlias)")
+    @Deprecated
     public static final String IDP_ID = "CamelKeycloakIdpId";
 
     // Authorization Services constants
     @Metadata(description = "The resource ID", javaType = "String")
     public static final String RESOURCE_ID = "CamelKeycloakResourceId";
 
-    @Metadata(description = "The resource name", javaType = "String")
+    @Metadata(description = "The resource name", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_NAME = "CamelKeycloakResourceName";
 
-    @Metadata(description = "The resource type", javaType = "String")
+    @Metadata(description = "The resource type", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_TYPE = "CamelKeycloakResourceType";
 
-    @Metadata(description = "The resource URI", javaType = "String")
+    @Metadata(description = "The resource URI", javaType = "String",
+              deprecationNote = "Never read by the component: createResource 
and updateResource take a ResourceRepresentation"
+                                + " as the POJO request body")
+    @Deprecated
     public static final String RESOURCE_URI = "CamelKeycloakResourceUri";
 
     @Metadata(description = "The policy ID", javaType = "String")
     public static final String POLICY_ID = "CamelKeycloakPolicyId";
 
-    @Metadata(description = "The policy name", javaType = "String")
+    @Metadata(description = "The policy name", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
policy operations take a PolicyRepresentation as the"
+                                + " POJO request body")
+    @Deprecated
     public static final String POLICY_NAME = "CamelKeycloakPolicyName";
 
-    @Metadata(description = "The policy type", javaType = "String")
+    @Metadata(description = "The policy type", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
policy operations take a PolicyRepresentation as the"
+                                + " POJO request body")
+    @Deprecated
     public static final String POLICY_TYPE = "CamelKeycloakPolicyType";
 
     @Metadata(description = "The permission ID", javaType = "String")
     public static final String PERMISSION_ID = "CamelKeycloakPermissionId";
 
-    @Metadata(description = "The permission name", javaType = "String")
+    @Metadata(description = "The permission name", javaType = "String",
+              deprecationNote = "Never read by the component: the resource 
permission operations take a PolicyRepresentation as"
+                                + " the POJO request body")
+    @Deprecated
     public static final String PERMISSION_NAME = "CamelKeycloakPermissionName";
 
-    @Metadata(description = "The scope name", javaType = "String")
+    @Metadata(description = "The scope name", javaType = "String",
+              deprecationNote = "Never read by the component: the scope 
operations take their representation as the POJO"
+                                + " request body")
+    @Deprecated
     public static final String SCOPE_NAME = "CamelKeycloakScopeName";

Review Comment:
   ⚠️ **Misleading deprecation note** — there are no authorization scope 
operations in this component that take a "scope representation" as a POJO body. 
The "scope operations" in the component are `ClientScope` operations (which are 
keyed on `CLIENT_SCOPE_NAME`, not `SCOPE_NAME`). `SCOPE_NAME` is 
`CamelKeycloakScopeName` — which the producer never reads. The deprecation note 
falsely implies a POJO body is required. Consider: `"Never read by the 
component"` — without the misleading explanation about scope operations.



##########
components/camel-keycloak/src/main/java/org/apache/camel/component/keycloak/KeycloakConstants.java:
##########
@@ -141,7 +168,10 @@ public final class KeycloakConstants {
     @Metadata(description = "The credential ID", javaType = "String")
     public static final String CREDENTIAL_ID = "CamelKeycloakCredentialId";
 
-    @Metadata(description = "The credential type", javaType = "String")
+    @Metadata(description = "The credential type", javaType = "String",
+              deprecationNote = "Never read by the component: the credential 
operations take a CredentialRepresentation as the"
+                                + " POJO request body")
+    @Deprecated

Review Comment:
   ⚠️ **Inaccurate deprecation note** — credential operations do NOT take a 
`CredentialRepresentation` as a POJO request body:
   - `getUserCredentials` returns them (no input body)
   - `deleteUserCredential` uses `CREDENTIAL_ID` header
   - `resetUserPassword` builds the `CredentialRepresentation` internally from 
`USER_PASSWORD` and `CREDENTIAL_TEMPORARY` headers
   
   None of these operations read a `CredentialRepresentation` from the exchange 
body. The deprecation note is misleading. Consider: `"Never read by the 
component: credential operations use dedicated headers (CREDENTIAL_ID, 
USER_PASSWORD)"` — or simply `"Never read by the component"`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to