lubos-cicut [Thu, 21 Dec 2023 11:27:42 +0000 (12:27 +0100)]
Test revision requirement in schema service
This patch adapt old tests, because they were using not existing
module.
JIRA: NETCONF-1160
Change-Id: I2ca913b69fb128d9e4aafa4baf1571c7db7650a6
Signed-off-by: Oleksandr Panasiuk <oleksandr.panasiuk@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Oleksandr Zharov [Thu, 25 Jan 2024 11:14:37 +0000 (12:14 +0100)]
Update user guide with key-based auth
Added example payload for device creation using key-based authentication.
JIRA: NETCONF-1186
Change-Id: Iadb4f6651091113631d3ed1707ba86f00931a4ac
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Oleksandr Zharov [Thu, 9 Nov 2023 16:59:01 +0000 (17:59 +0100)]
Enforce base64 encoding for netconf-keystore
Changed type to binary for all leafs that are claiming their type as
base64.
We are no more reusing groupings for RPC. Purpose of it is to left
all RPC logic untouched by this patch.
JIRA: NETCONF-1186
Change-Id: I870427af766c55a5e65b336046e64f048c2b7fdd
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Yaroslav Lastivka [Wed, 31 Jan 2024 09:26:01 +0000 (11:26 +0200)]
Improve error path for list items
Enhanced the throwing of RestconfDocumentedException
to include a more precise path.
JIRA: NETCONF-1222
Change-Id: I19f9b7c413ba24a38d716c2140ad35ef94c5ff49
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Robert Varga [Sun, 4 Feb 2024 15:45:28 +0000 (16:45 +0100)]
Flatten callhome-provider
There is no point in separating components here -- flatten them to a
single package. We may end up promoting some of these to
netconf-client-mdsal and/or netconf-topology, but that is a separate
story.
JIRA: NETCONF-590
Change-Id: I1d8d96351b75965849d32028329716075c2da84c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 17:40:33 +0000 (18:40 +0100)]
Rework SslHandlerFactory
Tracking down all the possible implementations and bridging of
SslHandlerFactor is not nice.
Turn SslHandlerFactory into an abstract class, with an explicit
fixed specialization.
This also allows us to put the configuration parsing bits to where
users can find them -- and create dynamic SslContexts as appropriate.
Furthermore this ends up differentiating the deprecated
netconf.client.SslHandlerFactory -- which becomes SslContextFactory and
we end up ditching the manual SSLEngine creation.
JIRA: NETCONF-1237
Change-Id: I2cd4721336f9867921123521d7b18d91a8743835
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 2 Feb 2024 20:54:55 +0000 (21:54 +0100)]
Decrypt key credentials in keystore-legacy
This moves the decryption and decoding logic into keystore-legacy, so
that the lifecycle is controlled.
JIRA: NETCONF-1237
Change-Id: Ib39d034f87f98114aff1106490d237eea99d0940
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 2 Feb 2024 15:28:12 +0000 (16:28 +0100)]
Use NetconfKeystoreService in tls auth provider
Rather than listening to datastore, use the associated service to
acquire readily-decoded certificates.
While we are at it, we index them to a multimap, so we do not need to
iterate through them all the time.
JIRA: NETCONF-1243
Change-Id: I93e546684e6f31e309da45d0cf07cc30de31565a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 22:38:32 +0000 (23:38 +0100)]
Fix SslHandler indirection
We should be binding the factory at configuration time, not when it is
actually needed.
JIRA: NETCONF-1243
Change-Id: I36854bfab82a9d240cc641b5eb525b396215901a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 23:34:42 +0000 (00:34 +0100)]
Remove callhome-server
The server/provider split does not make sense here -- we end up with
ping-pong through callbacks and whatnot.
Bring the thwo parts into a single component, as callhome-server touches
topology anyway.
While this is not directly tied to the SSL context work, callhome-server
is monitoring netconf-keystore, so the lifecycle needs to tied together
correctly.
JIRA: NETCONF-1243
Change-Id: I75b0b28202a03105169ef675fba7713561eacd68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 21:56:33 +0000 (22:56 +0100)]
Expose NetconfKeystoreService
We are performing translation of datastore configuration state into Java
equivalent. Let's expose that as a service and run a full component,
which supports asynchronous updates.
This also defers start by not reporting initial state until we have
observed the datastore.
JIRA: NETCONF-1237
Change-Id: Ib6b34d707eb664a94cb4a30049e50444f47fc5ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Matej Sramcik [Tue, 23 Jan 2024 13:06:29 +0000 (14:06 +0100)]
Eliminate thread-blocking on NetconfMessage.toString()
The NetconfMessage.toString() method is synchronized on the
TRANSFORMER.
This creates bottleneck if method is processing a lot of messages.
Used XmlUtil.toString() instead of Transformer to fix the issue.
JIRA: NETCONF-1227
Change-Id: I26ec52bc53787801d2a01db4a8096a855a30718a
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 23:34:12 +0000 (00:34 +0100)]
Clean up CachedYangTextSchemaSource
Rename to CachedYangTextSource and inherit from StringYangTextSource,
which does everything we need it to do. Also update the test to use
JUnit5.
Change-Id: Ibc0d19ebe4ca7582319da3f864dc7c4d5af2459c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 17:21:16 +0000 (18:21 +0100)]
Register call-home listeners globally
This is probably a migration omission. Since the listeners have no
effects, it is safe to run them concurrently. Do just that, fixing at
least 3 warnings.
Change-Id: Ia42beebb17d54afc12fc2d5f68b04af92ff1ec77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 11:22:20 +0000 (12:22 +0100)]
Eliminate callhome-model artifact
Move the model into its sole user and eliminate the artifact.
JIRA: NETCONF-1243
Change-Id: I41a7a1dd79227b1672119dacae33df713f0b2a35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 31 Jan 2024 11:17:51 +0000 (12:17 +0100)]
Make AuthorizedKeysDecoder thread-safe
AuthorizedKeysDecoder is mutating state of a single instance, which is
counter-intuitive and leads to the last decoded key to be left present
in the instance.
Fix this by making the deconding method static and keeping the instance
an internal thing, closing the leak and making the decoding process
inherently thread-safe.
Change-Id: I000b100773d206aee6b0e4f634f7d46a8b56544e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 10:52:10 +0000 (11:52 +0100)]
Switch ssh-host-key to binary
Using a String with Base64 is a rather lacking employ of YANG, as 'type
binary' is encoded in JSON and XML as Base64, so we get codecs for free.
JIRA: NETCONF-1243
Change-Id: I90158893570e2dd6d80a69a78acf8fe99f84ae1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 17:20:33 +0000 (18:20 +0100)]
Obsolete non-transport ssh-host-key
Update the model layout to make 'transport' choice mandatory and
make ssh-host-key obsolete.
JIRA: NETCONF-1243
Change-Id: I178d5d8d7858d6c4074214ac8cce598f5c2b6ec1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 04:36:15 +0000 (05:36 +0100)]
Refactor NetconfSalKeystoreRpcs
Move RPC implementations into keystore-legacy and wrap them in a
ClusterSingletonService.
JIRA: NETCONF-1237
Change-Id: I1fdc81500c90cb46235838c9e77e741d44160807
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 12:32:20 +0000 (13:32 +0100)]
Remove SP dependency
This dependency seems to be unused now == remove it.
Change-Id: I691fcb0e6e84c1f40fcf4a62c26113c7ed76e6ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Mon, 22 Jan 2024 12:34:45 +0000 (13:34 +0100)]
Create SchemasEntity class to simplify SchemasStream
Created SchemasEntity class to simplify SchemasStream. SchemasEntity
now hold collection of SchemaEntity as in PathsEntity. Class
SchemaStream is no more necessary.
JIRA: NETCONF-938
Change-Id: I02ac62704dabe94d5c793af383bb6a0c7bbd4a0a
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 06:33:03 +0000 (07:33 +0100)]
Optimize AuthorizedKeysDecoder
Use pre-computed bytes for our constants and do not compute individual
components twice.
Change-Id: Iff1428f529db3c5df634cd80b8c08da6772bdbee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2024 00:23:05 +0000 (01:23 +0100)]
Require key specification
We have a testing-only utility method. Ditch it in favor of supplying
the value from tests.
JIRA: NETCONF-1237
Change-Id: Ibe0a0f3c78365043401e5a80db00c3e841ac9027
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 23:15:42 +0000 (00:15 +0100)]
Move data processing to update thread
We are interpreting datastore data and applying to Java native
constructs. Rather than doing that each time we are asked for a
SslHandler, move the processing to when the data changes.
This also makes things a tad more defensive, so that we do not propagate
invalid configuration (but issue stern warnings).
JIRA: NETCONF-1237
Change-Id: Ib76c7ff6e3203e26c035e4ca475072a9d3964f77
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 19:30:25 +0000 (20:30 +0100)]
Split out keystore-legacy
Tracking down the lifecycle of SslContexts brings us to our handling of
key material.
This is currently tangled netconf-client-mdsal using our home-grown (and
problematic) model.
Split out netconf-keystore.yang and the baseline implementation into
keystore-legacy. Now that it sits side-by-side with keystore-api, we can
compare the two.
Since this change requires us to intercept a hidden object, rework the
test in terms of JUnit5.
JIRA: NETCONF-1237
Change-Id: Id9d410e88ec588e148c5f1dff3aad574b3cc8328
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 16:35:52 +0000 (17:35 +0100)]
Further warnings mitigation
This is straightforward conversion to new methods.
Change-Id: I9ddb943ad73a0b131f910ffcbc4a99d3d87e261c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 15:58:01 +0000 (16:58 +0100)]
Clean up callhome-provide warnings
We have a few warnings from upstreams, fix them up.
Change-Id: I97235589a17d315f5e183e9f4f2b1b9daa7f9aef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2024 15:57:07 +0000 (16:57 +0100)]
Clean up netconf-client-mdsal warnings
The bump to mdsal-13 is causing a large number of warnings, start fixing
them up.
Change-Id: I0dde1197b9ed0026b0e7de3177b6d0411ff15a53
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 12:38:20 +0000 (13:38 +0100)]
Fix wrong path reference - schema for actions
Last patch lost pre-rewrite logic. This patch applies old logic again.
JIRA: NETCONF-938
Change-Id: I76c960d324b487a8de101a0949ba3214685f34e4
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Ivan Hrasko [Tue, 16 Jan 2024 14:49:54 +0000 (15:49 +0100)]
Use nio Channels in OpenAPI read
Override read(byte[], int, int) method using nio Channels
to speed up retrieval of documentation.
JIRA: NETCONF-1234
Change-Id: I3bfc4110cfe828302a08f86756c4535077fe5c5c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 23:53:43 +0000 (00:53 +0100)]
Remove SchemaServiceStub
We have FixedDOMSchemaService, use that instead of brewing our own.
Change-Id: Ib1cf5a7ac2f9417865d98b73228a2b7b6c4281d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 23:25:24 +0000 (00:25 +0100)]
Clean up utility method
We have introduced a nasty bit of code, clean it back up again.
Change-Id: Iea78986db79a106d9fc15cfdbad65ea3cca0245e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 16 Jan 2024 12:24:13 +0000 (13:24 +0100)]
Bump upstreams
Adopt:
- yangtools-13.0.1
- mdsal-13.0.0
- controller-9.0.0
- aaa-0.19.1
Change-Id: I690bf875372e058d96920e6470bfd63be74194bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 11:32:11 +0000 (12:32 +0100)]
Disconnect NetconfDeviceRpc from DOMRpcService
DOMService is about to get very picky about class hierarchy, let's make
sure we do not attempt to combine multiple DOMServices.
This adds a bit of indirection, but opens up the possibility to properly
separate invocation paths and their expectations.
Change-Id: Iecdb60e9664a97c400eab5100ef05a84e3f555e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 03:50:14 +0000 (04:50 +0100)]
NetconfRpcService should be extensible
We are capturing a good base contract, but the documentation contradicts
the actual implementation.
The difference is that the API says it supports RFC4741/6241, but in
reality we also support RFC6020 and (optionally) RFC5277/6470.
This patch turns to DOMExtensibleService to allow for a baseline service
which potentially has extensions.
Change-Id: I541b9f76c6eecbbf85f593b68cd0ade6c5c286e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 Jan 2024 01:45:40 +0000 (02:45 +0100)]
Import PKIUtilTest
We have ditched the use of PKIUtil and that class is going away. Rehost
PKIUtilTest to test our code instead. This code is imported from aaa.git
at
ee5509ac1864eec537a9f9422fe49fc85b368e48.
JIRA: AAA-269
Change-Id: Ib7b9a41c5ba4e398ac859a8221fa2735d3b62afb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 21:25:01 +0000 (22:25 +0100)]
Clean up NetconfServerSessionNegotiatorTest
Split the three test cases into individual methods, migrating to JUnit5.
Since SshdSocketAddress is not asserted against, we remove it along with
the dependency on shaded-sshd.
Change-Id: I7b297ce843ac7dcd12312493663b4b04384fb370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 20:50:26 +0000 (21:50 +0100)]
Do not use SecurityUtils in callhome-provider
Use plain KeyStore access to acquire provides. This eliminate
AuthorizedKeysDecoder's dependency on sshd -- which does not make sense
in its current shape and form.
Change-Id: I95e743a34d78f7220e2edf49dbac177a132f0c3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 20:49:22 +0000 (21:49 +0100)]
Access RemoteAddress exactly once
We are using the value twice, so let's save it in a local variable.
Change-Id: Ib38a12a3ee71199cbdf8e118225225d2c4ada6f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 20:47:12 +0000 (21:47 +0100)]
Remove netconf-api dependency
callhome-provider does not deal with netconf-api directly, remove the
unused dependency.
Change-Id: I0f100db47c5e31897bc37af1fd136f6ec1fa4ce3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 20:12:14 +0000 (21:12 +0100)]
Clean up netconf-common-mdsal dependencies
We have a number of warnings here, fix them up.
Change-Id: Ib12bd9d67aa2c76f7b51392b8f3c9a83a8ab2ff3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 20:03:55 +0000 (21:03 +0100)]
Clean up netconf-nb dependencies
The dependency graph has changed significantly, this patch eliminates
the problems reported in netconf-nb.
Change-Id: Ice97ce72a1e02d74fb60c7a54c8d2b2d6b2b9d5c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 19:57:50 +0000 (20:57 +0100)]
Clean up netconf-client-mdsal dependencies
We are using netconf-common, but not shaded-sshd and not
netconf-netty-util.
Change-Id: I9bc99d8270b4b2d3467925b8a9e43d6b989db7c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 19:47:57 +0000 (20:47 +0100)]
Fix shutdown message
The timer is being stopped, not started, fix that.
Change-Id: Iebce87f8710bbb05c6e60f4fbcfd4a7b691938fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 19:39:18 +0000 (20:39 +0100)]
Eliminate use of PKIUtil
aaa-encrypt-service is confused as to what it's role is. We are using a
a very simple method from PKIUtil -- inline and optimize it for our use,
making it clear we depend on BouncyCastle.
Change-Id: Ic9bbda2c49f41f7bca483ac0127f08a8ff992e9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 19:21:08 +0000 (20:21 +0100)]
Remove AuthenticationHandler
This class is not used anywhere, remove it and clean up dependencies,
making it plenty clear that netconf-netty-util is just a Netty thing.
JIRA: NETCONF-1108
Change-Id: I0454c53b2c3b9d8573c1b386c37df97e7fc2df1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 18:07:14 +0000 (19:07 +0100)]
Activate NetconfClientFactoryImpl lazily
This is a simple service, which should be deactivated when it is not
needed. Also drop the use of properties, as there really is no point.
JIRA: NETCONF-1108
Change-Id: I880ccb112b3c86fa196fe2c20157e070bc5efd47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 15:44:55 +0000 (16:44 +0100)]
Introduce NetconfTimer
The wiring of a global timer is not quite what we want, as it makes
tracking down where and how it is used quite hard.
Add an explicit NetconfTimer interface and a default implementation to
provide indirection in from on the Netty timer.
This has the benefit of reigning in the lifecycle of the timer, so we
actually end up sharing it across components properly.
JIRA: NETCONF-590
Change-Id: Ib58c9f5668ec859d68432116fe63f954f6eae08e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 18:30:47 +0000 (19:30 +0100)]
Eliminate netconf.nettyutil.handler.ssh.client
All of this code has been rendered unused, remove it.
JIRA: NETCONF-1108
Change-Id: I3543a42edd7f2464544af6a54036444ee923cf01
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 27 Jan 2024 18:11:15 +0000 (19:11 +0100)]
Clean up NetconfClientConfiguration
Use normal reference to SslHandlerFactory.
Change-Id: I17bcb552d6a6539f8efc0d0cfc23ebaa3bf68ca8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jan 2024 19:10:33 +0000 (20:10 +0100)]
Remove NetconfMessageTransformUtil.FILTER_NODEID
We have Filter.QNAME, which we can use without relying on a special
constant. While at it, fixup GET RPC's input.
Change-Id: I3040c99ae983e2bcd5e28f29007cf031ff1a3a54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jan 2024 03:53:28 +0000 (04:53 +0100)]
Remove use of threadpool-config-impl
We are using just one utility, inline the few lines of code that are
needed to make the threadpool work.
JIRA: CONTROLLER-2092
Change-Id: I93d08f348f3331a8b28e40c7f18f60831cd18d8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jan 2024 14:37:09 +0000 (15:37 +0100)]
Bump sshd to 2.12.0
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.12.0.md
Change-Id: I8aebc6496f95f97c8133b2ced6bfa246da7f5864
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:34:58 +0000 (09:34 +0100)]
Fix nullability checks in operations entity classes
During rewrite we have lost requireNonNull checks. This patch
contains all classes which extend OperationEntity.
JIRA: NETCONF-938
Change-Id: I117e723ebfaab1c048f457bda073e29748329495
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Robert Varga [Fri, 26 Jan 2024 03:06:38 +0000 (04:06 +0100)]
Remove netconf-config
Rehost the remaining threadpool into netconf-topology and let users
inject is as NetconfTopologySchemaAssembler.
JIRA: NETCONF-1232
Change-Id: I3dd7a24d689c53aafd1e067028991302a8925ef4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jan 2024 00:48:52 +0000 (01:48 +0100)]
Eliminate GlobalNetconfSshScheduledExecutor
The only thing this executor is used is for ietf-monitoring listener
updates for netconf-server.
Rather than having a tuneable threadpool, just acknowledge the fact we
need a single thread for this task and manage it internally
NetconfMonitoringServiceImpl if possible.
JIRA: NETCONF-1232
Change-Id: I081947c28981442777ea8bc91a77df01641d23fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:31:58 +0000 (09:31 +0100)]
Fix nullability checks in PropertyEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: I6b8a38164a60fd61b35c10af559f6e41514095b3
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:30:29 +0000 (09:30 +0100)]
Fix nullability checks in ParameterSchemaEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: Ibd745802a31aa29cce57706056b25e7fdaaa6486
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:30:06 +0000 (09:30 +0100)]
Fix nullability checks in PathsEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: I8dcbafa3bc88e09da176b036e0c1e98c45778a90
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:29:03 +0000 (09:29 +0100)]
Fix nullability checks in SecurityEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: Icebdd9d178a1850dd60b58aea32e432a23902c2f
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:28:42 +0000 (09:28 +0100)]
Fix nullability checks in SecuritySchemesEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: I7975d31f053ac223e80728ba1cc2579148d332f2
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 26 Jan 2024 08:27:34 +0000 (09:27 +0100)]
Fix nullability checks in ServersEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: If55ddb78471d457db3eb1c8f99ad2f004ddbf2aa
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Thu, 25 Jan 2024 07:47:11 +0000 (08:47 +0100)]
Fix nullability checks in ParameterEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: Ic03d603bfa0ae5356f82576471ba50d8d4331d7d
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Thu, 25 Jan 2024 07:42:52 +0000 (08:42 +0100)]
Fix nullability checks in ServerEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: I36e524b42a43698a80972e4980ab7450dfb95e66
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Thu, 25 Jan 2024 07:39:09 +0000 (08:39 +0100)]
Fix nullability checks in InfoEntity class
During rewrite we have lost requireNonNull checks.
JIRA: NETCONF-938
Change-Id: I31b556927df909878e3bbe0b0bc3cc6865660011
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Wed, 17 Jan 2024 16:53:30 +0000 (17:53 +0100)]
Fix wrong path reference - schema for actions
After rewrite we lost reference to parent node in some of actions
paths. This patch repairs it.
JIRA: NETCONF-938
Change-Id: I90d048a3157e0cf07b52621eee351ee6119790af
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Robert Varga [Thu, 25 Jan 2024 21:31:03 +0000 (22:31 +0100)]
Add restconf-{client,server}
This patch adds the bare-bones ietf-restconf-{client,server} models from
draft-ietf-netconf-restconf-client-server-29 without packaging or
implementing them.
JIRA: NETCONF-773
Change-Id: Ie1070076544e4b3b30f75f641cdc66bfb0efff43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jan 2024 21:17:41 +0000 (22:17 +0100)]
Add transport-http
This patch adds the bare-bones ietf-http-{client,server} models from
draft-ietf-netconf-http-client-server-13 without providing feature
packaging.
A baseline intended set of features is also introduced, but nothing else
is done on the implementation side.
JIRA: NETCONF-773
Change-Id: Ic86a6fd8d850c8cc16a25db54fc8f7f27a20bf0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jan 2024 20:19:10 +0000 (21:19 +0100)]
Refresh IETF client/server models
This updates the models to the versions published in
- draft-ietf-netconf-crypto-types-28
- draft-ietf-netconf-keystore-29
- draft-ietf-netconf-trust-anchors-22
- draft-ietf-netconf-tcp-client-server-17
- draft-ietf-netconf-tls-client-server-34
- draft-ietf-netconf-ssh-client-server-34
- draft-ietf-netconf-netconf-client-server-30
The ietf-truststore.yang model is augmented with four if-feature
statements which are missing in the published model. Their absence
causes binding runtime to fail because it sees the two leaves using
their respective leafref types and it cannot resolve them (becase we do
not support central-truststore).
JIRA: NETCONF-590
Change-Id: I1fe3be6151a5aa633b1e8a2405454063cfba8c84
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 25 Jan 2024 16:32:18 +0000 (17:32 +0100)]
Clean up netconf-{common,client}-mdsal constants
We have a ton of constants relating to naming elements which hark back
to when we did not have Binding representation of RPCs and anyxmls.
These days we have pre-generated constants, so use those, which makes
for looser code coupling and better expressiveness in terms of what we
are doing.
Change-Id: Ied0bda7c3c78cdaa0c59bbca6f1aa9b87342848d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Peter Suna [Wed, 24 Jan 2024 14:36:54 +0000 (15:36 +0100)]
Set backoff-jitter for call-home devices
Call-home devices are not using datastore defaults. We have to set
the default value for backoff-jitter programatically.
JIRA: NETCONF-1193
Change-Id: I2ff37fce1ccd195bba9768257bb96886095b6d0d
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Robert Varga [Wed, 24 Jan 2024 22:38:46 +0000 (23:38 +0100)]
Fix odl-restconf-common dependencies
We need to depend on the MD-SAL feature packaging the RFC8072 model.
JIRA: NETCONF-1118
Change-Id: I6c9cba22c8af011cd7bf254c8c35a1d5179b5ff4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jan 2024 21:17:45 +0000 (22:17 +0100)]
Do not package iana-crypt-hash
MD-SAL is already providing a pre-packaged model, consume that instead
of rolling our own.
Change-Id: I9486ecfe0519351c7a8588e4a894b222fc8224bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jan 2024 16:48:58 +0000 (17:48 +0100)]
Do not use threadpool-config-impl in websocket-client
threadpool-config-impl provides just a few simple wrappers, ditch their
use and just use Java/Guava equivalents.
Change-Id: I31eafb83c05b1d79b1c7f96021a8157ffd26089e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Yaroslav Lastivka [Thu, 18 Jan 2024 09:08:06 +0000 (11:08 +0200)]
Update User Guide with Enhanced Authentication Details
Added note wich emphasizing encryption key access and
password format in User Guide.
JIRA: NETCONF-1217
Change-Id: I3503df759326915de55246fcda9d6462c994c52c
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Robert Varga [Mon, 22 Jan 2024 21:13:39 +0000 (22:13 +0100)]
Make RESTCONF base path configurable
Move BASE_PATH constant into OSGi configuration to make it
configurable and propagate it to other components through
RestconfStreamServletFactory.
JIRA: NETCONF-1218
Change-Id: Ie1aed49ed37ff3e0cc862db77c7b88c7470c082a
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 22 Jan 2024 13:36:48 +0000 (14:36 +0100)]
Fixup NetconfDeviceCommunicatorTest
Use Mockito.spy() again, now that we have an upgraded Mockito.
Change-Id: Ibdb5322f1cd2a46bf70f891a406f461c046aad76
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Wed, 6 Sep 2023 05:54:25 +0000 (07:54 +0200)]
Create Unit Test for POST existing data error
Successfully create resource of your choice using POST request.
When we invoke the same request again, we get the error
response 500 Internal Server Error. According to RFC 8040
we should get 409 Conflict.
Unit Test has been created to verify this issue.
JIRA: NETCONF-1130
Change-Id: Iad1254d2f058a8aa69ed1076e43823224d54c06e
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
lubos-cicut [Wed, 17 Jan 2024 08:41:03 +0000 (09:41 +0100)]
Use OpenApiServiceImpl#DEFAULT_PAGESIZE after rewrite
Renew usage of constant OpenApiServiceImpl#DEFAULT_PAGESIZE which
we lost during rewrite OpenApi.
JIRA: NETCONF-938
Change-Id: I211f85f1f740c40173bc40c8c058d047cfc79a01
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
lubos-cicut [Tue, 16 Jan 2024 18:14:23 +0000 (19:14 +0100)]
Use DefinitionNames#addUnlinkedName after rewrite
Renew usage of DefinitionNames#addUnlinkedName which we lost during
rewrite OpenApi.
JIRA: NETCONF-938
Change-Id: I6cd173752075483974b53d4761dd4c125fb8fcc6
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Ivan Hrasko [Thu, 18 Jan 2024 14:51:08 +0000 (15:51 +0100)]
Remove unused lock field
Remove unused lock from from MountPointOpenApi class.
JIRA: NETCONF-938
Change-Id: I4e2b6806c81e7ea23baa5f57cd0eda416e34b3da
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Fri, 19 Jan 2024 11:30:33 +0000 (12:30 +0100)]
Add max-backoff-millis to user guide
Inform users that we have created new netconf device
configuration parameter called max-backoff-millis.
JIRA: NETCONF-1139
Change-Id: Ie4fd03062b97dc74a74c81059d8bfe76ff520943
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Fri, 19 Jan 2024 11:24:43 +0000 (12:24 +0100)]
Set max-backoff-millis for call-home devices
Call-home devices are not using datastore defaults. We have to set
the default value for max-backoff-millis programatically.
JIRA: NETCONF-1193
Change-Id: Ic39cdb9b2dc1210c6e5a8c9ee5485c0040bfc944
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
lubos-cicut [Fri, 12 Jan 2024 10:07:59 +0000 (11:07 +0100)]
Refactor leaf names in odl-netconf-device.yang
Name simplifications of leafs between-attempts-timeout-millis to
min-backoff-millis, max-timeout-between-attempts-millis to
max-backoff-millis and sleep-factor to backoff-multiplier.
JIRA: NETCONF-1193
Change-Id: I237929dca4bf95c10a953c5734f2e0aea5808d89
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Fri, 19 Jan 2024 08:58:19 +0000 (09:58 +0100)]
Mark backoff settings obsolete
Mark between-attempts-timeout-millis,
max-timeout-between-attempts-millis and sleep-factor as obsolete.
They will be renamed to min-backoff-millis,
max-backoff-millis and backoff-multiplier in the next future release.
JIRA: NETCONF-1193
Change-Id: Ie978dda4ae88be209afde73e09e3cfc0f3827d65
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Thu, 18 Jan 2024 13:52:39 +0000 (14:52 +0100)]
Mark backoff settings deprecated
Mark between-attempts-timeout-millis,
max-timeout-between-attempts-millis and sleep-factor as deprecated.
They will be renamed to min-backoff-millis,
max-backoff-millis and backoff-multiplier in the future release.
JIRA: NETCONF-1193
Change-Id: Ifc33d1974f1724046beaf1b7e59c12fee5b73448
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
lubos-cicut [Tue, 16 Jan 2024 07:45:21 +0000 (08:45 +0100)]
Use PathsEntity class to simplify PathsStream
Use PathsEntity class to simplify PathsStream. PathsEntity holds
a collection of PathEntity. Class PathStream is no more necessary.
JIRA: NETCONF-938
Change-Id: Idee405b28ebcb6007a3be1ce93230658bf46024b
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Fri, 5 Jan 2024 15:40:57 +0000 (16:40 +0100)]
Use configurable basePath in PathsStream
Added possibility to use configurable basePath in OpenApi paths which
we have lost during rewrite.
Deleted constant BASE_PATH which was hardcoded to be "/".
JIRA: NETCONF-938
Change-Id: Ic4e9317aa463b3fe98709530c59a359c513fd341
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Samuel Schneider [Wed, 10 Jan 2024 17:08:12 +0000 (18:08 +0100)]
Update documentation of RFC 8040 configuration
Update documentation to reflect removal of restconf8040.cfg
file. The configuration can be changed in karaf's
etc/org.opendaylight.restconf.nb.rfc8040.cfg file instead.
JIRA: NETCONF-1219
Change-Id: I96b8f1e68e216a8d9fa61decdcca51c567b86c87
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Robert Varga [Tue, 16 Jan 2024 13:51:32 +0000 (14:51 +0100)]
Implement registerNotificationListeners()
Bulk listener registration, as introduced a long time ago, should be
supported for all clients. Make sure we have an implementation.
While we are here, also fix thread safety hazards around
registration/unregistration -- with minimal critical sections.
Optimize retained memory by specializing empty/one/multiple registrations,
which in turn allows for some code reuse.
JIRA: NETCONF-1224
Change-Id: I8e40a6c149dbc8bea63d840cbd4cd0a807860175
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
lubos-cicut [Fri, 12 Jan 2024 08:42:31 +0000 (09:42 +0100)]
Support random backoff between connection attempts
First connection attempt gets initialized to minimum sleep, each
subsequent is exponentially backed off by sleepFactor (default 1.5)
until reach max sleep and randomized by +/- jitter (default 0.1).
JIRA: NETCONF-1193
Change-Id: Ia252e61e6b574bad09969e2c629c14ebf7320644
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
lubos-cicut [Thu, 4 Jan 2024 10:01:16 +0000 (11:01 +0100)]
Support maximum wait time of connection attempts
First connection attempt gets initialized to minimum sleep, each
subsequent is exponentially backed off by sleepFactor. So the value
is limited because it could grow indefinitely.
Added leaf to odl-netconf-device.yang to get possibility of max wait
time between connection attempts. Default value set to 30 minutes.
JIRA: NETCONF-1193
Change-Id: If5865911fd2822dfcfde15eb1974e58fbc104489
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Yaroslav Lastivka [Tue, 16 Jan 2024 13:15:21 +0000 (15:15 +0200)]
Fix XML Namespace Handling in serializeExceptionToXml
In the commit
1b59089de6b8306b3f6c9dd7b14299c14f6c00d3,
we inadvertently introduced an issue in the
serializeExceptionToXml method where the XML namespace was
set in a manner not compliant with XML standards,
causing issues in XML parsing.
Additionally, the method did not utilize the currentDatabindContext
for writing the error-path, which could lead to incorrect
serialization of error paths in certain contexts.
The fix involves correctly setting the default XML namespace for
the errors element. Additionally, the method now properly utilizes
the currentDatabindContext for encoding error paths.
JIRA: NETCONF-1130
Change-Id: Ia7900bff2e63d23213896b5e0c96a514ace92873
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Ivan Hrasko [Mon, 15 Jan 2024 14:17:56 +0000 (15:17 +0100)]
Replace escape character by empty line
The newline escape character in InfoEntity description is
marked by IDE as redundant. Use blank line instead.
Change-Id: I146bc26c800214321e3681f205ea4554b934c2b4
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Mon, 15 Jan 2024 14:16:39 +0000 (15:16 +0100)]
Make ServersStream fields final
The ServersStream class fields are effectively final.
Mark them with final keyword.
Change-Id: Ib28c78e166e500022185f3c7e08e763344e98511
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
lubos-cicut [Thu, 14 Dec 2023 17:56:13 +0000 (18:56 +0100)]
Refactor SchemasStreams class
Refactored SchemasStream in order to have separate *Stream class
for components and schemas.
JIRA: NETCONF-938
Change-Id: I69a02493f370d60ffe3f8d905456275277d012b9
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Ivan Hrasko [Tue, 28 Nov 2023 14:29:17 +0000 (15:29 +0100)]
Remove not validating JSON/XML stream writters
We have now customized logic to write JSON/XML errors
in RestconfDocumentedExceptionMapper. Thus we no longer need
Json/XmlStreamWriterWithDisabledValidation classes.
JIRA: NETCONF-1130
Change-Id: I2249004c58070d8ad46a1f9dae78fbb5222f5230
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Yaroslav Lastivka [Tue, 24 Oct 2023 07:45:17 +0000 (10:45 +0300)]
XML: Resolve 500 response from device exception
Utilize a custom XmlWriter to prepare the ietf-restconf
error response body. To emit the error-path value,
use the XmlCodec from the device to generate the correct
path format based on the device's model context.
JIRA: NETCONF-1130
Change-Id: I04ae0df51475d7bd49296b7e166fab835afdbaf3
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Peter Suna [Mon, 18 Sep 2023 11:21:18 +0000 (13:21 +0200)]
JSON: Resolve 500 response from device exception
Utilize a custom JsonWriter to prepare the ietf-restconf
error response body. To emit the error-path value,
use the JSONCodec from the device to generate the correct
path format based on the device's model context.
JIRA: NETCONF-1130
Change-Id: Id82849cabf3fd99b22b4d95eaf9ff5a3ce815b8b
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Tue, 9 Jan 2024 13:06:15 +0000 (14:06 +0100)]
Simplify synchronization in MountPointOpenApi
Use ConcurrentSkipListMap and ConcurrentHashMap for instanceIdToLongId
and longIdToInstanceId respectivelly which removes the necessity to use
additional locking when we put or get from them.
Change-Id: I8db52cd2aa69c5dacc465db1c20b4d4a6c7dacb2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>