You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by GitBox <gi...@apache.org> on 2020/02/24 06:06:31 UTC

[GitHub] [unomi] sergehuber commented on a change in pull request #131: Add the ability to update event by item id

sergehuber commented on a change in pull request #131: Add the ability to update event by item id
URL: https://github.com/apache/unomi/pull/131#discussion_r383096239
 
 

 ##########
 File path: api/src/main/java/org/apache/unomi/api/Event.java
 ##########
 @@ -82,47 +83,83 @@ public Event() {
      * @param target    the target of the event if any
      * @param timestamp the timestamp associated with the event if provided
      */
-    public Event(String eventType, Session session, Profile profile, String scope, Item source, Item target, Date timestamp) {
-        super(UUID.randomUUID().toString());
-        this.eventType = eventType;
-        this.profile = profile;
-        this.session = session;
-        this.profileId = profile.getItemId();
-        this.scope = scope;
-        this.source = source;
-        this.target = target;
-
-        if (session != null) {
-            this.sessionId = session.getItemId();
-        }
-        this.timeStamp = timestamp;
+    public Event(String itemId, String eventType, Session session, Profile profile, String scope, Item source, Item target, Date timestamp) {
+        super(itemId);
 
 Review comment:
   The whole idea of using server-generated IDs for events is that Unomi can process requests coming directly from the Internet and therefore they cannot be trusted. Allowed IDs to be client specified can potentially open the system to attacks.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services