netconf.git
3 months agoEnforce base64 encoding for netconf-keystore 96/108896/22
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>
3 months agoImprove error path for list items 96/110096/3
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>
3 months agoFlatten callhome-provider 32/110132/2
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>
3 months agoRework SslHandlerFactory 62/110062/16
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>
3 months agoDecrypt key credentials in keystore-legacy 28/110128/4
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>
3 months agoUse NetconfKeystoreService in tls auth provider 24/110124/1
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>
3 months agoFix SslHandler indirection 11/110111/3
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>
3 months agoRemove callhome-server 12/110112/2
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>
3 months agoExpose NetconfKeystoreService 10/110110/3
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>
3 months agoEliminate thread-blocking on NetconfMessage.toString() 28/109928/5
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>
3 months agoClean up CachedYangTextSchemaSource 68/110068/6
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>
3 months agoRegister call-home listeners globally 83/110083/3
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>
3 months agoEliminate callhome-model artifact 01/110101/1
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>
3 months agoMake AuthorizedKeysDecoder thread-safe 00/110100/1
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>
3 months agoSwitch ssh-host-key to binary 92/110092/5
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>
3 months agoObsolete non-transport ssh-host-key 82/110082/7
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>
3 months agoRefactor NetconfSalKeystoreRpcs 90/110090/5
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>
3 months agoRemove SP dependency 93/110093/2
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>
3 months agoCreate SchemasEntity class to simplify SchemasStream 08/109908/7
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>
3 months agoOptimize AuthorizedKeysDecoder 91/110091/1
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>
3 months agoRequire key specification 88/110088/1
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>
3 months agoMove data processing to update thread 86/110086/3
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>
3 months agoSplit out keystore-legacy 85/110085/5
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>
3 months agoFurther warnings mitigation 81/110081/3
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>
3 months agoClean up callhome-provide warnings 80/110080/1
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>
3 months agoClean up netconf-client-mdsal warnings 79/110079/1
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>
3 months agoFix wrong path reference - schema for actions 17/110017/2
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>
3 months agoUse nio Channels in OpenAPI read 03/109803/8
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>
3 months agoRemove SchemaServiceStub 69/110069/2
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>
3 months agoClean up utility method 67/110067/1
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>
3 months agoBump upstreams 00/109800/42
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>
3 months agoDisconnect NetconfDeviceRpc from DOMRpcService 61/110061/6
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>
3 months agoNetconfRpcService should be extensible 58/110058/5
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>
3 months agoImport PKIUtilTest 52/110052/2
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>
3 months agoClean up NetconfServerSessionNegotiatorTest 50/110050/1
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>
3 months agoDo not use SecurityUtils in callhome-provider 49/110049/1
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>
3 months agoAccess RemoteAddress exactly once 48/110048/1
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>
3 months agoRemove netconf-api dependency 47/110047/1
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>
3 months agoClean up netconf-common-mdsal dependencies 46/110046/2
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>
3 months agoClean up netconf-nb dependencies 45/110045/1
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>
3 months agoClean up netconf-client-mdsal dependencies 44/110044/1
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>
3 months agoFix shutdown message 43/110043/2
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>
3 months agoEliminate use of PKIUtil 42/110042/1
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>
3 months agoRemove AuthenticationHandler 41/110041/1
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>
3 months agoActivate NetconfClientFactoryImpl lazily 38/110038/4
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>
3 months agoIntroduce NetconfTimer 37/110037/8
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>
3 months agoEliminate netconf.nettyutil.handler.ssh.client 40/110040/2
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>
3 months agoClean up NetconfClientConfiguration 39/110039/2
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>
3 months agoRemove NetconfMessageTransformUtil.FILTER_NODEID 00/110000/2
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>
3 months agoRemove use of threadpool-config-impl 08/110008/4
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>
3 months agoBump sshd to 2.12.0 24/110024/2
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>
3 months agoFix nullability checks in operations entity classes 15/110015/3
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>
3 months agoRemove netconf-config 07/110007/5
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>
3 months agoEliminate GlobalNetconfSshScheduledExecutor 06/110006/4
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>
3 months agoFix nullability checks in PropertyEntity class 14/110014/2
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>
3 months agoFix nullability checks in ParameterSchemaEntity class 13/110013/2
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>
3 months agoFix nullability checks in PathsEntity class 12/110012/2
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>
3 months agoFix nullability checks in SecurityEntity class 11/110011/2
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>
3 months agoFix nullability checks in SecuritySchemesEntity class 10/110010/2
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>
3 months agoFix nullability checks in ServersEntity class 09/110009/2
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>
3 months agoFix nullability checks in ParameterEntity class 91/109991/2
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>
3 months agoFix nullability checks in ServerEntity class 90/109990/2
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>
3 months agoFix nullability checks in InfoEntity class 89/109989/2
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>
3 months agoFix wrong path reference - schema for actions 25/109825/7
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>
3 months agoAdd restconf-{client,server} 02/110002/3
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>
3 months agoAdd transport-http 01/110001/3
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>
3 months agoRefresh IETF client/server models 85/109985/4
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>
3 months agoClean up netconf-{common,client}-mdsal constants 99/109999/6
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>
3 months agoSet backoff-jitter for call-home devices 54/109954/2
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>
3 months agoFix odl-restconf-common dependencies 64/109964/1
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>
3 months agoDo not package iana-crypt-hash 63/109963/1
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>
3 months agoDo not use threadpool-config-impl in websocket-client 60/109960/1
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>
3 months agoUpdate User Guide with Enhanced Authentication Details 28/109828/5
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>
3 months agoMake RESTCONF base path configurable 01/109701/9
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>
3 months agoFixup NetconfDeviceCommunicatorTest 10/109910/1
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>
3 months agoCreate Unit Test for POST existing data error 15/107715/6
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>
3 months agoUse OpenApiServiceImpl#DEFAULT_PAGESIZE after rewrite 17/109817/6
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>
3 months agoUse DefinitionNames#addUnlinkedName after rewrite 07/109807/5
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>
3 months agoRemove unused lock field 37/109837/3
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>
3 months agoAdd max-backoff-millis to user guide 56/109856/1
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>
3 months agoSet max-backoff-millis for call-home devices 55/109855/1
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>
3 months agoRefactor leaf names in odl-netconf-device.yang 54/109754/8
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>
3 months agoMark backoff settings obsolete 51/109851/1
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>
3 months agoMark backoff settings deprecated 35/109835/3
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>
3 months agoUse PathsEntity class to simplify PathsStream 96/109796/3
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>
3 months agoUse configurable basePath in PathsStream 43/109643/6
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>
3 months agoUpdate documentation of RFC 8040 configuration 02/109702/9
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>
3 months agoImplement registerNotificationListeners() 02/109802/10
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>
3 months agoSupport random backoff between connection attempts 33/109633/12
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>
3 months agoSupport maximum wait time of connection attempts 30/109630/11
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>
4 months agoFix XML Namespace Handling in serializeExceptionToXml 01/109801/1
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>
4 months agoReplace escape character by empty line 80/109780/4
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>
4 months agoMake ServersStream fields final 79/109779/2
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>
4 months agoRefactor SchemasStreams class 15/109315/5
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>
4 months agoRemove not validating JSON/XML stream writters 96/109096/8
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>
4 months agoXML: Resolve 500 response from device exception 11/108611/16
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>
4 months agoJSON: Resolve 500 response from device exception 04/107904/27
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>
4 months agoSimplify synchronization in MountPointOpenApi 89/109689/3
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>
4 months agoRemove no more used RFC 8040 configuration file 40/109640/5
Ivan Hrasko [Fri, 5 Jan 2024 13:39:05 +0000 (14:39 +0100)]
Remove no more used RFC 8040 configuration file

Delete not used restconf8040.cfg file which was supposed to hold
configuration which can be in fact set in karaf's
etc/org.opendaylight.restconf.nb.rfc8040 file.

When present the file is used to overwrite default values specified in
OSGiNorthbound class.

JIRA: NETCONF-1219
Change-Id: I6dbc1c5696b59d6b2592dbbf01873243ebacd73f
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
4 months agoUse BufferedReader to read OpenApi 90/109690/3
Ivan Hrasko [Tue, 9 Jan 2024 15:18:56 +0000 (16:18 +0100)]
Use BufferedReader to read OpenApi

Use BufferedReader when creating OpenApi document to
achieve better efficiency.

JIRA: NETCONF-938
Change-Id: I11c6f935be2022c6fae175100e01f2c51a487831
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>