Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge/withdevelop #1684

Merged
merged 77 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e9bd619
Better handling of timeouts in reception of responses to notifications
kzangeli Jun 13, 2024
3fc55f9
Timeout back to 4 seconds + added the missing functest
kzangeli Jun 13, 2024
fcc82a6
Merge pull request #1627 from FIWARE/issue/1441-II
kzangeli Jun 13, 2024
9ce398c
README.md
kzangeli Jul 4, 2024
d29b5f3
Merge branch 'develop' into doc/README
kzangeli Jul 4, 2024
f33c217
README.md
kzangeli Jul 4, 2024
fbf15ac
test
kzangeli Jul 4, 2024
3caf5c8
Removed TEST
kzangeli Jul 4, 2024
60a160f
Removed TEST
kzangeli Jul 4, 2024
4311e64
Changed the link to v1.7.1 openapi
kzangeli Jul 4, 2024
94a97e7
Merge pull request #1632 from FIWARE/doc/README
kzangeli Jul 4, 2024
b6d536f
Fixed hyperlinks
kzangeli Jul 4, 2024
956389e
Merge branch 'develop' into doc/README
kzangeli Jul 4, 2024
70edc96
Merge pull request #1633 from FIWARE/doc/README
kzangeli Jul 4, 2024
6d403d5
Improved documentation
kzangeli Jul 10, 2024
7763607
Merge pull request #1635 from FIWARE/doc/README
kzangeli Jul 11, 2024
cd8bf2c
README.md
kzangeli Jul 11, 2024
0534e4c
Merge pull request #1636 from FIWARE/docs/README
kzangeli Jul 11, 2024
b993c3a
Returning core context in responses if Accept: application/ld+json
kzangeli Jul 11, 2024
090aec8
Merge remote-tracking branch 'origin/develop' into fix/core-context
kzangeli Jul 11, 2024
950e528
Style
kzangeli Jul 11, 2024
31ad864
One more functest needed the core-context-modification
kzangeli Jul 11, 2024
b955dd5
Merge pull request #1637 from FIWARE/fix/core-context
kzangeli Jul 12, 2024
d797f85
Fixed a leak + Improved CHANGES_NEXT_RELEASE
kzangeli Jul 12, 2024
00ba993
Merge pull request #1638 from FIWARE/hardening/valgrind
kzangeli Jul 13, 2024
ecd0f2e
Preparing develop post-release
kzangeli Jul 13, 2024
e51b101
Merge pull request #1639 from FIWARE/task/post-release
kzangeli Jul 15, 2024
c01a571
Distributed subscriptions: subordinate subscriptions are DELETED when…
kzangeli Jul 15, 2024
27149ac
Merge pull request #1640 from FIWARE/deature/deleteSubordinateSubs
kzangeli Jul 15, 2024
16496a4
First attempt with subordinate notifications via gateways
kzangeli Jul 17, 2024
0a7f18d
Adding two missing (new) files
kzangeli Jul 17, 2024
d9ac545
troe routine troePostBatchUpsert for orionldPostNotify
kzangeli Jul 18, 2024
1d69dc8
parent subId in url path for subordinate subs with prefix
kzangeli Jul 18, 2024
1bf3878
Subordinate subs get their notification::endpoint::receiverInfo from …
kzangeli Jul 18, 2024
83c7c7c
receiverInfo in subordinate subs
kzangeli Jul 19, 2024
5511a5b
Link + urn:ngsi-ld:request treatment
kzangeli Jul 19, 2024
ad79840
throttle to the subordinate susbcription
kzangeli Jul 19, 2024
b096876
More fixes for subordinate subs
kzangeli Jul 19, 2024
97e9c59
CHANGES_NEXT_RELEASE
kzangeli Jul 19, 2024
52ca8a0
Implemented csf URL param for GET registrations
kzangeli Aug 16, 2024
1300406
Using qMatch instead of csfMatch
kzangeli Aug 16, 2024
3feb834
Removed some leftover traces
kzangeli Aug 16, 2024
298a871
Style
kzangeli Aug 16, 2024
210b26c
Fixed an warning in release compilation
kzangeli Aug 16, 2024
9f18e94
Merge pull request #1655 from FIWARE/issue/1652
kzangeli Aug 16, 2024
0bf0367
Support for the URL parameter 'orderBy'
kzangeli Aug 19, 2024
5d3c511
Merge pull request #1656 from FIWARE/feature/orderByIfLocal
kzangeli Aug 19, 2024
0f2adf4
Adding PATCH of regs modifying/adding reg properties to an existing f…
kzangeli Aug 22, 2024
f5762db
Merge pull request #1657 from FIWARE/csf/patchAddingRegProperties
kzangeli Aug 22, 2024
12409f9
orderBy on entity id, type, and modifiedAt + One more URL parameter '…
kzangeli Aug 26, 2024
41204d9
Merge pull request #1658 from FIWARE/orderBy/id+type
kzangeli Aug 26, 2024
ad103e9
Merged with develop
kzangeli Aug 28, 2024
45e00c3
variable missing in main of unit test
kzangeli Aug 28, 2024
9f9fc2d
Fixes for better error handling
kzangeli Aug 29, 2024
10cce03
Merge pull request #1659 from FIWARE/issue/1644
kzangeli Aug 30, 2024
ea9d232
Rudimentary support for GET /info/sourceIdentity
kzangeli Sep 3, 2024
660c6bb
Merge pull request #1660 from FIWARE/feature/info
kzangeli Sep 3, 2024
e6b7c53
Full support for GET /info/sourceIdentity
kzangeli Sep 3, 2024
6689d82
Merge pull request #1661 from FIWARE/info/complete
kzangeli Sep 3, 2024
323b71d
Support for management::localOnly in registrations
kzangeli Sep 4, 2024
4723402
Merge pull request #1662 from FIWARE/reg/localOnly
kzangeli Sep 4, 2024
0eeea32
Support for new CLI parameter '-pageSize' to set the default paginati…
kzangeli Sep 4, 2024
ec10cd2
the new cli param variable also needed in the unit test main
kzangeli Sep 4, 2024
beba3bd
Merge pull request #1663 from FIWARE/cli/limit
kzangeli Sep 4, 2024
5183018
Fixed issue #1621
kzangeli Sep 4, 2024
8686b55
Removed an unfinished functest meant for another issue
kzangeli Sep 5, 2024
e8b09d6
Merge pull request #1664 from FIWARE/issue/1647
kzangeli Sep 6, 2024
850fc7b
Fixed issue #1649
kzangeli Sep 6, 2024
276550d
CHANGES_NEXT_RELEASE
kzangeli Sep 6, 2024
73a28c3
Merge pull request #1665 from FIWARE/issue/1649
kzangeli Sep 6, 2024
060c036
Implemented issue #1682 - default user context
kzangeli Oct 3, 2024
a25d8dc
upload-artifact@v4
kzangeli Oct 3, 2024
4a57baf
defaultUserContextUrl in unit test
kzangeli Oct 3, 2024
66bb3e2
Removed an old warning used for debugging
kzangeli Oct 3, 2024
a542986
Merge pull request #1683 from FIWARE/issue1682/defaultUserContext
kzangeli Oct 3, 2024
5463e79
Merged with develop
kzangeli Oct 3, 2024
3b8a19b
pageSize away from unit-test-main as I moved it to orionldState.cpp
kzangeli Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
## Fixed Issues:
#1621: URL-Encoding single quote in attribute values in TRoE DB
#1649: Crash when using subscriptions in a mixed environment (LD and V2)
#1682: Default User Context

## New Features:
* Distributed subscriptions: subordinate subscriptions are DELETED when their "father" is deleted
* Native support for DDS
* Distributed subscriptions: subordinate subscriptions are DELETED when their "father" is deleted.
* Support for the URL parameter 'csf' in GET /ngsi-ld/v1/csourceRegistrations
* Support for the URL parameter 'orderBy' (must be an attribute) in GET /ngsi-ld/v1/entities, but only if 'local' is set. (This is not NGSI-LD standard. Yet ...)
- Also supporting sorting on entity id, type, and modifiedAt
- One more URL parameter '?reverse=true' to reverse the sorting order
* Support for GET /ngsi-ld/v1/info/sourceIdentity
* Support for management::localOnly in registrations
* Support for new CLI parameter '-pageSize' to set the default pagination limit (default is 20 if -pageSize is not used)

## Notes
* Lots of improvements for subordinate subscriptions - still not 100% ready, but a lot better.
28 changes: 26 additions & 2 deletions src/app/orionld/orionld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
*/
#include <stdio.h>
#include <unistd.h> // getppid, fork, setuid, sleep, gethostname, etc.
#include <string.h>
#include <string.h> // strchr
#include <fcntl.h> // open
#include <sys/types.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -249,6 +249,8 @@ char coreContextVersion[64];
bool triggerOperation = false;
bool noprom = false;
bool noArrayReduction = false;
char subordinateEndpoint[256];
char defaultUserContextUrl[256];
bool ddsSupport = false;
char ddsSubsTopics[512];
char ddsTopicType[512];
Expand Down Expand Up @@ -353,6 +355,9 @@ char ddsEnablerConfigFile[512];
#define DDS_TOPIC_TYPE_DESC "DDS topic type"
#define DDS_CONFIG_FILE_DESC "DDS configuration file"
#define DDS_ENABLER_CONFIG_FILE_DESC "DDS Enabler configuration file"
#define SUBORDINATE_ENDPOINT_DESC "endpoint URL for reception of notificatiopns from subordinate subscriptions (distributed subscriptions)"
#define PAGE_SIZE_DESC "default page size (no of entities, subscriptions, registrations)"
#define DUC_URL_DESC "URL to default user context"



Expand Down Expand Up @@ -412,7 +417,6 @@ PaArgument paArgs[] =
{ "-connectionMemory", &connectionMemory, "CONN_MEMORY", PaUInt, PaOpt, 64, 0, 1024, CONN_MEMORY_DESC },
{ "-maxConnections", &maxConnections, "MAX_CONN", PaUInt, PaOpt, 1020, 1, PaNL, MAX_CONN_DESC },
{ "-reqPoolSize", &reqPoolSize, "TRQ_POOL_SIZE", PaUInt, PaOpt, 0, 0, 1024, REQ_POOL_SIZE },

{ "-inReqPayloadMaxSize", &inReqPayloadMaxSize, "IN_REQ_PAYLOAD_MAX_SIZE", PaULong, PaOpt, MB(1), 0, PaNL, IN_REQ_PAYLOAD_MAX_SIZE_DESC },
{ "-outReqMsgMaxSize", &outReqMsgMaxSize, "OUT_REQ_MSG_MAX_SIZE", PaULong, PaOpt, MB(8), 0, PaNL, OUT_REQ_MSG_MAX_SIZE_DESC },
{ "-notificationMode", &notificationMode, "NOTIF_MODE", PaString, PaOpt, _i "transient", PaNL, PaNL, NOTIFICATION_MODE_DESC },
Expand Down Expand Up @@ -458,11 +462,14 @@ PaArgument paArgs[] =
{ "-lmtmp", &lmtmp, "TMP_TRACES", PaBool, PaHid, true, false, true, TMPTRACES_DESC },
{ "-noprom", &noprom, "NO_PROM", PaBool, PaHid, false, false, true, NO_PROM_DESC },
{ "-noArrayReduction", &noArrayReduction, "NO_ARRAY_REDUCTION", PaBool, PaHid, false, false, true, NO_ARR_REDUCT_DESC },
{ "-subordinateEndpoint", &subordinateEndpoint, "SUBORDINATE_ENDPOINT", PaStr, PaOpt, _i "", PaNL, PaNL, SUBORDINATE_ENDPOINT_DESC },
{ "-pageSize", &pageSize, "PAGE_SIZE", PaInt, PaOpt, 20, 1, 1000, PAGE_SIZE_DESC },
{ "-dds", &ddsSupport, "DDS", PaBool, PaOpt, false, false, true, USE_DDS_DESC },
{ "-ddsSubsTopics", ddsSubsTopics, "DDS_SUBS_TOPICS", PaString, PaOpt, _i "", PaNL, PaNL, DDS_SUBS_TOPICS_DESC },
{ "-ddsTopicType", ddsTopicType, "DDS_TOPIC_TYPE", PaString, PaOpt, _i "NGSI-LD", PaNL, PaNL, DDS_TOPIC_TYPE_DESC },
{ "-ddsConfigFile", ddsConfigFile, "DDS_CONFIG_FILE", PaString, PaOpt, _i "", PaNL, PaNL, DDS_CONFIG_FILE_DESC },
{ "-ddsEnablerConfigFile", ddsEnablerConfigFile, "DDS_CONFIG_FILE_PATH", PaString, PaOpt, _i "", PaNL, PaNL, DDS_ENABLER_CONFIG_FILE_DESC },
{ "-duc", defaultUserContextUrl, "DUC_URL", PaString, PaOpt, _i "", PaNL, PaNL, DUC_URL_DESC },

PA_END_OF_ARGS
};
Expand Down Expand Up @@ -1115,6 +1122,23 @@ int main(int argC, char* argV[])
}
}

if (subordinateEndpoint[0] != 0)
{
char* slash = strchr(subordinateEndpoint, '/');

if ((slash != NULL) && (slash[1] == '/') && (slash[2] != 0)) // xxx:// is skipped
slash = strchr(&slash[2], '/');

char* prefix = slash;
subordinatePathLen = snprintf(subordinatePath, sizeof(subordinatePath) - 1, "%s/notifications/", prefix);

LM_T(LmtSubordinate, ("entity subordinate prefix: '%s'", subordinateEndpoint));
LM_T(LmtSubordinate, ("path portion: '%s'", prefix));
LM_T(LmtSubordinate, ("subordinatePath: '%s'", subordinatePath));
}
else
bzero(subordinatePath, sizeof(subordinatePath));

#if 0
//
// Uncomment this piece of code and run the functests (-ld) to make sure everything works "more or less" with the Legacy Driver disabled.
Expand Down
2 changes: 2 additions & 0 deletions src/app/orionld/orionldRestServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#include "orionld/serviceRoutines/orionldPutAttribute.h"
#include "orionld/serviceRoutines/orionldGetEntityMap.h"
#include "orionld/serviceRoutines/orionldDeleteEntityMap.h"
#include "orionld/serviceRoutines/orionldGetInfo.h"

#include "orionld/serviceRoutines/orionldGetTemporalEntities.h"
#include "orionld/serviceRoutines/orionldGetTemporalEntity.h"
Expand Down Expand Up @@ -105,6 +106,7 @@ static OrionLdRestServiceSimplified getServiceV[] =
{ "/ngsi-ld/v1/csourceRegistrations", orionldGetRegistrations },
{ "/ngsi-ld/v1/jsonldContexts/*", orionldGetContext },
{ "/ngsi-ld/v1/jsonldContexts", orionldGetContexts },
{ "/ngsi-ld/v1/info/sourceIdentity", orionldGetInfo },
{ "/ngsi-ld/v1/temporal/entities/*", orionldGetTemporalEntity },
{ "/ngsi-ld/v1/temporal/entities", orionldGetTemporalEntities },
{ "/ngsi-ld/ex/v1/version", orionldGetVersion },
Expand Down
7 changes: 7 additions & 0 deletions src/lib/logMsg/traceLevels.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ typedef enum TraceLevels
LmtContextCacheStats, // Context Cache Statistics
LmtContextDownload, // Context Download
LmtCoreContext, // Core Context
LmtUserContext, // User Context

// GeoJSON
LmtGeoJSON = 110, // GeoJSON ... everything (for now)
Expand All @@ -125,6 +126,11 @@ typedef enum TraceLevels
LmtEntityMapRetrieve, // Retrieval of an entity map
LmtEntityMapDetail, // Details of the entity-registration maps

//
// Subordinate Subscriptions
//
LmtSubordinate = 140,

//
// Misc
//
Expand All @@ -135,6 +141,7 @@ typedef enum TraceLevels
LmtKjlParse, // Trace level start for K libs
LmtMqtt = 205, // MQTT notifications
LmtQ, // Query Language
LmtCsf, // CSF - 'q' for registrations
LmtPostgres, // Postgres (TRoE)
LmtSql, // SQL command for TRoE
LmtPgPool, // Postgres Connection Pool
Expand Down
8 changes: 7 additions & 1 deletion src/lib/mongoBackend/mongoGetSubscriptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ using ngsiv2::EntID;
*/
static void extractSubscriptionId(Subscription* s, const BSONObj* rP)
{
s->id = getFieldF(rP, "_id").OID().toString();
mongo::BSONElement bsonElement = rP->getField("_id");
mongo::BSONType bsonType = bsonElement.type();

if (bsonType == mongo::jstOID)
s->id = bsonElement.OID().toString();
else
s->id = bsonElement.String();
}


Expand Down
13 changes: 12 additions & 1 deletion src/lib/orionld/common/orionldState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ PernotSubCache pernotSubCache;
EntityMap* entityMaps = NULL; // Used by GET /entities in the distributed case, for pagination
bool entityMapsEnabled = false;
bool distSubsEnabled = false;
OrionldContext* defaultUserContextP = NULL;
int pageSize = 20;



Expand All @@ -125,6 +127,15 @@ char postgresServerVersion[128];



//
// Variables for notifications from subordinate subscriptions (distributed subscriptions)
//
char subordinatePath[256];
int subordinatePathLen = -1;
OrionLdRestService* subordinateNotificationServiceP = NULL;



// -----------------------------------------------------------------------------
//
// orionldStateInit - initialize the thread-local variable orionldState
Expand Down Expand Up @@ -163,7 +174,7 @@ void orionldStateInit(MHD_Connection* connection)

// Pagination
orionldState.uriParams.offset = 0;
orionldState.uriParams.limit = 20;
orionldState.uriParams.limit = pageSize;

// orionldState.delayedKjFreeVecSize = sizeof(orionldState.delayedKjFreeVec) / sizeof(orionldState.delayedKjFreeVec[0]);

Expand Down
17 changes: 17 additions & 0 deletions src/lib/orionld/common/orionldState.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ typedef struct OrionldUriParams
char* notExists;
char* metadata;
char* orderBy;
bool reverse;
bool collapse;
bool reset;
char* attributeFormat;
Expand All @@ -169,6 +170,7 @@ typedef struct OrionldUriParams
bool onlyIds;
bool entityMap;
char* format;
char* csf;

OrionldContextKind kind;

Expand Down Expand Up @@ -320,6 +322,7 @@ typedef struct OrionldMongoC
typedef struct OrionldConnectionState
{
OrionldPhase phase;
bool orionldErrorDone; // Don't override error - don't call orionldError()
bool distributed; // Depends on a URI param, but can be modified (to false) via an HTTP header
MHD_Connection* mhdConnection;
char clientIp[64]; // IP address of the requester
Expand Down Expand Up @@ -619,6 +622,10 @@ extern EntityMap* entityMaps; // Used by GET /entities in t
extern bool entityMapsEnabled; // Enable Entity Maps
extern bool distSubsEnabled; // Enable distributed subscriptions
extern bool noArrayReduction; // Used by arrayReduce in pCheckAttribute.cpp
extern int pageSize; // Pagination limit
extern char defaultUserContextUrl[256];
extern OrionldContext* defaultUserContextP;

extern char localIpAndPort[135]; // Local address for X-Forwarded-For (from orionld.cpp)
extern unsigned long long inReqPayloadMaxSize;
extern unsigned long long outReqMsgMaxSize;
Expand Down Expand Up @@ -663,6 +670,16 @@ extern char postgresServerVersion[128];



// -----------------------------------------------------------------------------
//
// Variables for notifications from subordinate subscriptions (distributed subscriptions)
//
extern char subordinateEndpoint[256];
extern char subordinatePath[256];
extern int subordinatePathLen;
extern OrionLdRestService* subordinateNotificationServiceP;


// -----------------------------------------------------------------------------
//
// orionldStateInit - initialize the thread-local variable orionldState
Expand Down
36 changes: 19 additions & 17 deletions src/lib/orionld/context/orionldAttributeExpand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,23 @@
char* orionldAttributeExpand
(
OrionldContext* contextP,
char* shortName,
const char* shortName,
bool useDefaultUrlIfNotFound,
OrionldContextItem** contextItemPP
)
{
if (strcmp(shortName, "id") == 0) return shortName;
else if (strcmp(shortName, "@id") == 0) return shortName;
else if (strcmp(shortName, "type") == 0) return shortName;
else if (strcmp(shortName, "@type") == 0) return shortName;
else if (strcmp(shortName, "scope") == 0) return shortName;
else if (strcmp(shortName, "location") == 0) return shortName;
else if (strcmp(shortName, "createdAt") == 0) return shortName;
else if (strcmp(shortName, "modifiedAt") == 0) return shortName;
else if (strcmp(shortName, "observationSpace") == 0) return shortName;
else if (strcmp(shortName, "operationSpace") == 0) return shortName;
char* sName = (char*) shortName; // just to avoid a warning for strcmp

if (strcmp(sName, "id") == 0) return sName;
else if (strcmp(sName, "@id") == 0) return sName;
else if (strcmp(sName, "type") == 0) return sName;
else if (strcmp(sName, "@type") == 0) return sName;
else if (strcmp(sName, "scope") == 0) return sName;
else if (strcmp(sName, "location") == 0) return sName;
else if (strcmp(sName, "createdAt") == 0) return sName;
else if (strcmp(sName, "modifiedAt") == 0) return sName;
else if (strcmp(sName, "observationSpace") == 0) return sName;
else if (strcmp(sName, "operationSpace") == 0) return sName;

#if 1
// FIXME: 'observedAt' as an attribute is not a thing - special treatment only if sub-attribute
Expand All @@ -70,15 +72,15 @@ char* orionldAttributeExpand
//
// We should probably forbid an attribute to have the name 'observedAt'
//
else if (strcmp(shortName, "observedAt") == 0)
else if (strcmp(sName, "observedAt") == 0)
{
orionldContextItemExpand(contextP, shortName, false, contextItemPP);
return shortName;
orionldContextItemExpand(contextP, sName, false, contextItemPP);
return sName;
}
#endif

if (orionldContextItemAlreadyExpanded(shortName) == true)
return shortName;
if (orionldContextItemAlreadyExpanded(sName) == true)
return sName;

return orionldContextItemExpand(contextP, shortName, useDefaultUrlIfNotFound, contextItemPP);
return orionldContextItemExpand(contextP, sName, useDefaultUrlIfNotFound, contextItemPP);
}
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldAttributeExpand.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
extern char* orionldAttributeExpand
(
OrionldContext* contextP,
char* shortName,
const char* shortName,
bool useDefaultUrlIfNotFound,
OrionldContextItem** contextItemPP
);
Expand Down
10 changes: 10 additions & 0 deletions src/lib/orionld/contextCache/orionldContextCacheInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ void orionldContextCacheInit(void)
LM_W(("Falling back to Built-in Core Context (hard-coded copy of %s)", builtinCoreContextUrl));
}

//
// Default User Context
//
if (defaultUserContextUrl[0] != 0)
{
defaultUserContextP = orionldContextFromUrl(defaultUserContextUrl, NULL);
if (defaultUserContextP == NULL)
LM_W(("Unable to download the default user context"));
}

if (contextArray == NULL)
return;

Expand Down
9 changes: 8 additions & 1 deletion src/lib/orionld/dbModel/dbModelToApiRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

extern "C"
{
#include "kalloc/kaStrdup.h" // kaStrdup
#include "kjson/KjNode.h" // KjNode
#include "kjson/kjLookup.h" // kjLookup
#include "kjson/kjBuilder.h" // kjArray, kjString, kjChildAdd, kjChildRemove, ...
Expand All @@ -35,6 +36,7 @@ extern "C"

#include "orionld/common/orionldState.h" // orionldState
#include "orionld/common/numberToDate.h" // numberToDate
#include "orionld/common/eqForDot.h" // eqForDot
#include "orionld/context/orionldContextItemAliasLookup.h" // orionldContextItemAliasLookup
#include "orionld/dbModel/dbModelToApiRegistration.h" // Own interface

Expand Down Expand Up @@ -246,7 +248,12 @@ bool dbModelToApiRegistration(KjNode* dbRegP, bool sysAttrs, bool forCache)
{
for (KjNode* propertyP = propertiesP->value.firstChildP; propertyP != NULL; propertyP = propertyP->next)
{
propertyP->name = orionldContextItemAliasLookup(orionldState.contextP, propertyP->name, NULL, NULL);
char dotName[256];
strncpy(dotName, propertyP->name, sizeof(dotName) - 1);
eqForDot(dotName);

propertyP->name = orionldContextItemAliasLookup(orionldState.contextP, dotName, NULL, NULL);
propertyP->name = kaStrdup(&orionldState.kalloc, propertyP->name);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/lib/orionld/distOp/distOpSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,6 @@ bool distOpSend(DistOp* distOpP, const char* dateHeader, const char* xForwardedF
uriParamAdd(&urlParts, "id", distOpP->entityId, -1);
}

if (local == true)
uriParamAdd(&urlParts, "local=true", NULL, 10);

if (distOpP->qNode != NULL)
{
char buf[256];
Expand All @@ -520,6 +517,9 @@ bool distOpSend(DistOp* distOpP, const char* dateHeader, const char* xForwardedF
}
}

if ((local == true) || (distOpP->regP->localOnly == true))
uriParamAdd(&urlParts, "local=true", NULL, 10);

if (orionldState.uriParams.lang != NULL)
uriParamAdd(&urlParts, "lang", orionldState.uriParams.lang, -1);

Expand Down
1 change: 1 addition & 0 deletions src/lib/orionld/entityMaps/entityMapCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ EntityMap* entityMapCreate(DistOp* distOpList, char* idPattern, QNode* qNode, Or
geoInfoP,
NULL,
geojsonGeometryLongName,
orionldState.uriParams.orderBy,
true,
false);

Expand Down
Loading
Loading