[IOT-2147] Disable 50-83 requests in CloudClient
authorAndrii Shtompel <a.shtompel@samsung.com>
Thu, 11 May 2017 12:13:18 +0000 (15:13 +0300)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 12 May 2017 11:14:38 +0000 (11:14 +0000)
Change-Id: I3c8fc1d162580b2590f46da10896bd0573b47d2a
Signed-off-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19797
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/sample/cloud/cloudCommon.c

index e61013a..8a71e4e 100644 (file)
 
 #define TAG "cloudCommon"
 
+//[IOT-2147] Requests 50-83 are not confirmed to new OCF spec
+//disable them for 1.3 rel, later (1.3.1 or after) they should be rewritten and enabled again
+#define DISABLE_50_83_REQUESTS_FOR_1_3_REL 1
+
 #define DEFAULT_HOST            "10.113.68.85"//"127.0.0.1"
 #define DEFAULT_PORT            OC_MULTICAST_PORT
 #define DEFAULT_AUTH_PROVIDER   "github"
@@ -104,6 +108,7 @@ typedef enum {
     ACL_INDIVIDUAL_DELETE = 43,
     ACL_INDIVIDUAL_DELETE_ACE = 44,
 
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
     ACL_GROUP_CREATE = 50,
     ACL_GROUP_FIND   = 51,
     ACL_GROUP_JOIN   = 52,
@@ -120,6 +125,7 @@ typedef enum {
     ACL_GROUP_GET_INVITE  = 81,
     ACL_GROUP_DELETE_INVITE  = 82,
     ACL_GROUP_CANCEL_INVITE  = 83,
+#endif
 
     EXIT          = 99
 }CloudRequest;
@@ -177,6 +183,7 @@ static void printMenu(OCMode mode)
     printf("** %d - ACL individual delete Request\n", ACL_INDIVIDUAL_DELETE);
     printf("** %d - ACL individual delete ACE Request\n", ACL_INDIVIDUAL_DELETE_ACE);
 
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
     printf("** ACL GROUP MANAGER\n");
     printf("** %d - ACL Create Group Request\n", ACL_GROUP_CREATE);
     printf("** %d - ACL Find Group Request\n", ACL_GROUP_FIND);
@@ -197,6 +204,7 @@ static void printMenu(OCMode mode)
     printf("** %d - ACL Retrieve invitation Request\n", ACL_GROUP_GET_INVITE);
     printf("** %d - ACL Delete invitation Request\n", ACL_GROUP_DELETE_INVITE);
     printf("** %d - ACL Cancel invitation Request\n", ACL_GROUP_CANCEL_INVITE);
+#endif
 
     printf("** EXIT\n");
     printf("** %d - Exit cloud %s\n", EXIT, title);
@@ -260,6 +268,7 @@ static void handleAclIdCB(void* ctx, OCClientResponse *response, void* aclId)
     OICFree(aclId);
 }
 
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
 /**
  * This function prints group id and calls default callback function handleCB()
  *
@@ -287,6 +296,7 @@ static void handleAclPolicyCheckCB(void* ctx, OCClientResponse *response, void*
     handleCB(ctx, response, gp);
     OICFree(gp);
 }
+#endif
 
 /**
  * This function prints received acl and calls default callback function handleCB()
@@ -303,6 +313,7 @@ static void handleAclIndividualGetInfoCB(void* ctx, OCClientResponse *response,
     //TODO: changes in aclresources.c required to fix that
 }
 
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
 /**
  * This function prints received group id list and calls default callback function handleCB()
  *
@@ -316,6 +327,7 @@ static void handleAclFindMyGroupCB(void* ctx, OCClientResponse *response, void*
     handleCB(ctx, response, gidList);
     clearStringArray((stringArray_t *)gidList);
 }
+#endif
 
 /**
  * This function prints received acl and calls default callback function handleCB()
@@ -331,6 +343,7 @@ static void handleGetCrlCB(void* ctx, OCClientResponse *response, void* crl)
     DeleteCrl((OicSecCrl_t *)crl);
 }
 
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
 /**
  * This function prints received invitation response and calls default callback function handleCB()
  *
@@ -345,6 +358,7 @@ static void handleAclGetInvitationCB(void* ctx, OCClientResponse *response, void
     clearInviteResponse((inviteResponse_t *)invite);
     OICFree(invite);
 }
+#endif
 
 static OCStackResult saveTrustCert(void)
 {
@@ -471,6 +485,7 @@ static void *userRequests(void *data)
         case CRL_POST:
             res = OCWrapperPostCRL(&endPoint, handleCB);
             break;
+#ifndef DISABLE_50_83_REQUESTS_FOR_1_3_REL
         case ACL_GROUP_CREATE:
             res = OCWrapperAclCreateGroup(&endPoint, handleAclCreateGroupCB);
             break;
@@ -510,6 +525,7 @@ static void *userRequests(void *data)
         case ACL_POLICY_CHECK_REQUEST:
             res = OCWrapperAclPolicyCheck(&endPoint, handleAclPolicyCheckCB);
             break;
+#endif
         case ACL_ID_GET_BY_DEVICE:
             res = OCWrapperAclIdGetByDevice(&endPoint, handleAclIdCB);
             break;