You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by GitBox <gi...@apache.org> on 2020/04/06 17:53:15 UTC

[GitHub] [celix] abroekhuis opened a new pull request #187: Added interceptors to RSA, currently only DFI is updated.

abroekhuis opened a new pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187
 
 
   One TODO left in the code. @pnoltes what do you want to fill in in the rsaType?

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r404889708
 
 

 ##########
 File path: bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
 ##########
 @@ -365,6 +365,18 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn) {
             service[pos] = '\0';
             unsigned long serviceId = strtoul(service,NULL,10);
 
+            celix_properties_t *metadata = NULL;
+
+            for (int i = 0; i < request_info->num_headers; i++) {
+                struct mg_header header = request_info->http_headers[i];
+                if (strncmp(header.name, "X-RSA-Metadata-", 15) == 0) {
 
 Review comment:
   👍 X-RSA-Metadata will work nicely. 

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r405049867
 
 

 ##########
 File path: bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
 ##########
 @@ -813,6 +825,22 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
     if(!curl) {
         status = CELIX_ILLEGAL_STATE;
     } else {
+        struct curl_slist *metadataHeader = NULL;
+        if (metadata != NULL && celix_properties_size(metadata) > 0) {
+            const char *key = NULL;
+            CELIX_PROPERTIES_FOR_EACH(metadata, key) {
+                const char *val = celix_properties_get(metadata, key, "");
+                size_t length = strlen(key) + strlen(val) + 18; // "X-RSA-Metadata-key: val\0"
 
 Review comment:
   never mind. there is a celix_utils_strdup, but no celix_utils_strlen

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r404890347
 
 

 ##########
 File path: bundles/remote_services/remote_service_admin_dfi/src/remote_service_admin_dfi.c
 ##########
 @@ -813,6 +825,22 @@ static celix_status_t remoteServiceAdmin_send(void *handle, endpoint_description
     if(!curl) {
         status = CELIX_ILLEGAL_STATE;
     } else {
+        struct curl_slist *metadataHeader = NULL;
+        if (metadata != NULL && celix_properties_size(metadata) > 0) {
+            const char *key = NULL;
+            CELIX_PROPERTIES_FOR_EACH(metadata, key) {
+                const char *val = celix_properties_get(metadata, key, "");
+                size_t length = strlen(key) + strlen(val) + 18; // "X-RSA-Metadata-key: val\0"
 
 Review comment:
   use celix_utils_strlen (is bounded using a strnlen)

----------------------------------------------------------------
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

[GitHub] [celix] abroekhuis merged pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
abroekhuis merged pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187
 
 
   

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on issue #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on issue #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#issuecomment-610442965
 
 
   > @pnoltes I see quite often that a build fails due to installation failure of dependencies. Is there something we can do about it?
   
   Not sure, we also had this issue on travis (from time to time), but I see it quite often. 

----------------------------------------------------------------
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

[GitHub] [celix] abroekhuis commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
abroekhuis commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r405586717
 
 

 ##########
 File path: bundles/remote_services/rsa_common/src/remote_interceptors_handler.c
 ##########
 @@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <stdlib.h>
+
+#include "celix_bundle_context.h"
+#include "celix_constants.h"
+#include "utils.h"
+
+#include "remote_interceptors_handler.h"
+
+typedef struct entry {
+    const celix_properties_t *properties;
+    remote_interceptor_t *interceptor;
+} entry_t;
+
+struct remote_interceptors_handler {
+    celix_array_list_t *interceptors;
 
 Review comment:
   You are right, will add it. To both the psa and rsa handler

----------------------------------------------------------------
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

[GitHub] [celix] abroekhuis commented on issue #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
abroekhuis commented on issue #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#issuecomment-609986577
 
 
   @pnoltes I see quite often that a build fails due to installation failure of dependencies. Is there something we can do about it?

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r404891525
 
 

 ##########
 File path: bundles/remote_services/rsa_common/src/remote_interceptors_handler.c
 ##########
 @@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <stdlib.h>
+
+#include "celix_bundle_context.h"
+#include "celix_constants.h"
+#include "utils.h"
+
+#include "remote_interceptors_handler.h"
+
+typedef struct entry {
+    const celix_properties_t *properties;
+    remote_interceptor_t *interceptor;
+} entry_t;
+
+struct remote_interceptors_handler {
+    celix_array_list_t *interceptors;
 
 Review comment:
   is the protection also missing for the pubsub interceptor handler? 

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on a change in pull request #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#discussion_r404891226
 
 

 ##########
 File path: bundles/remote_services/rsa_common/src/remote_interceptors_handler.c
 ##########
 @@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <stdlib.h>
+
+#include "celix_bundle_context.h"
+#include "celix_constants.h"
+#include "utils.h"
+
+#include "remote_interceptors_handler.h"
+
+typedef struct entry {
+    const celix_properties_t *properties;
+    remote_interceptor_t *interceptor;
+} entry_t;
+
+struct remote_interceptors_handler {
+    celix_array_list_t *interceptors;
 
 Review comment:
   protect this with a celix mutex

----------------------------------------------------------------
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

[GitHub] [celix] pnoltes commented on issue #187: Added interceptors to RSA, currently only DFI is updated.

Posted by GitBox <gi...@apache.org>.
pnoltes commented on issue #187: Added interceptors to RSA, currently only DFI is updated.
URL: https://github.com/apache/celix/pull/187#issuecomment-610570362
 
 
   > One TODO left in the code. @pnoltes what do you want to fill in in the rsaType?
   
   as discussed remove it from the api

----------------------------------------------------------------
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