sysrepo: make us recognizable as a CLI client
sysrepo is built as a platform for collaborative management of YANG
datastores. One part of this approach is that clients can do "anything",
that the NACM is opt-in, etc, and that there's a need for a mechanism
for clients to identify themselves. This mechanism is already used by
the NETCONF server, Netopeer2, for passing some NETCONF-specific
information such as NETCONF session IDs, etc.
Another use case is the sysrepo-ietf-alarms daemon which exports an RPC
that can be used by applications that use sysrepo to submit new alarms.
When talking at the localhost or sysrepo level, it's a public API
because other sysrepo clients (such as velia) can use it for
creating/updating alarms. At the same time, it should not be accessible
through NETCONF or RESTCONF or even the local CLI.
Let's identify ourselves with some unique string. Since the only other
well-known user at this time is the NETCONF server, Netopeer2, which
uses `netopeer2`, let's use the app name here as well.
Change-Id: I48716b88aea3961360d5c98b4d0444478e6e07d5
Cc: https://github.com/sysrepo/sysrepo/pull/3172
diff --git a/src/sysrepo_access.cpp b/src/sysrepo_access.cpp
index 34e0388..4f1a04a 100644
--- a/src/sysrepo_access.cpp
+++ b/src/sysrepo_access.cpp
@@ -35,6 +35,7 @@
, m_session(m_connection.sessionStart())
, m_schema(std::make_shared<YangSchema>(m_session.getContext()))
{
+ m_session.setOriginatorName("sysrepo-cli");
}
namespace {