Robert Varga [Tue, 18 Feb 2025 17:32:13 +0000 (18:32 +0100)]
Correct builder flow
Do not split static method invocation and properly format builder fluent
flow.
JIRA: NETCONF-714
Change-Id: I0eb2e13bdf333d0f0bfc0cf8a2913a98cff58ae8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 19 Feb 2025 02:27:27 +0000 (03:27 +0100)]
Clean up SubscriptionStateService
SubscriptionStateService should be referencing YANG-modeled entities and
generally operate with NormalizedNode/DOMNotification assumptions.
Depend on the rfc8650 model and pick up the constructs we need from
there.
JIRA: NETCONF-714
Change-Id: Id61f0c3aac7e4b77a3f2c867721f7d956c1c27e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 19 Feb 2025 00:39:05 +0000 (01:39 +0100)]
Clean up features
Factoring things out has moved our dependencies a bit, making
odl-netconf-util and odl-netconf-ssh dead features.
This renames odl-netconf-util to odl-netconf-mdsal-common, carrying a
dependency on mdsal-dom-api. We package netconf-mdsal-common and
netconf-dom-api here.
We then drop netconf-auth from odl-netconf-api, as it really is a thing
specific to the auth plugin.
JIRA: NETCONF-714
Change-Id: I3267a73ee8e8f8c32a9764a6a642aa17264b6fa0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Feb 2025 23:37:10 +0000 (00:37 +0100)]
Add netconf.common.mdsal.DOMNotificationEvent
The contract of NetconfMessageTransformer.NetconfDeviceNotification is
useful across plugins/*.
Promote it as DOMNotificationEvent, coming in two flavors:
- Rfc6020, i.e. top-level notifications
- Rfc7950, i.e. instance notifications
JIRA: NETCONF-714
Change-Id: I5ef7163bddc8c3b959d8299a0c0f2378f7f50494
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Feb 2025 23:15:07 +0000 (00:15 +0100)]
Clean up DefaultSslContextFactoryProviderTest
SecurityHelper.decodeCertificate() is a static method, use it as such.
Change-Id: Iad41f9e9ad41e156607f4c82cc4704417eeb7ae3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Feb 2025 23:13:58 +0000 (00:13 +0100)]
Remove unneeded suppression
This @SuppressWarnings is flagged as unnecessary, remove it.
Change-Id: I652cd68a6534dfc7d0505ea2babecec124f476c4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Feb 2025 22:15:59 +0000 (23:15 +0100)]
Modernize netconf-common-mdsal
Turn this into a bnd-based JPMS module, improving the contract and
usability.
Change-Id: I4d182b8116d338f1db9d3387865e87598dd6a029
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Feb 2025 15:15:33 +0000 (16:15 +0100)]
Enforce dependencies for all bnd-parent users
Default to enforcing dependecies, so that modern bundles have always
up-to-date dependencies by default.
Change-Id: Idb156b4c869efffad6335b860405a0e0077df238
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Peter Suna [Thu, 13 Feb 2025 11:49:30 +0000 (12:49 +0100)]
Fix exception handling order in decodeException
The order of exception checks was reversed, causing
NetconfDocumentedException to be caught by the parent
DocumentedException handler.
This commit swaps the order to ensure NetconfDocumentedException
is handled when it occurs.
JIRA: NETCONF-1197
Change-Id: I292f6285a513a9211cc5fb35019489e57e6de628
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Ivan Hrasko [Mon, 4 Nov 2024 13:54:42 +0000 (14:54 +0100)]
Add subscription resource
Add web resource providing possibility to stream
subscribed notifications over SSE at:
<server>:<port>/subscriptions/<subscription-id>
JIRA: NETCONF-714
Change-Id: I8667266afae97e7efa6e08ea888a681d60eee769
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Oleksandr Zharov [Thu, 13 Feb 2025 08:49:46 +0000 (09:49 +0100)]
Split StateMachine test
Split StateMachine test into two - positive and negative.
JIRA: NETCONF-714
Change-Id: Iee42e848380998c49b178e1390fb40d4068b0699
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Oleksandr Zharov [Thu, 13 Feb 2025 08:38:38 +0000 (09:38 +0100)]
Get subscription without dealing with exceptions
Refactored get methods for subscription state and session
to not throw exceptions if subscription wasn't found.
JIRA: NETCONF-714
Change-Id: I82fd63c41716a6729d2e8bb28ebe7476c13d0cfc
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Oleksandr Zharov [Thu, 13 Feb 2025 08:21:01 +0000 (09:21 +0100)]
Fix String#format usage
Fixed wrong usage of String#format.
JIRA: NETCONF-714
Change-Id: I2926ffd15297d56352fc02c7e1b503c1bff12c33
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Yaroslav Lastivka [Fri, 14 Feb 2025 08:09:23 +0000 (10:09 +0200)]
Update user-guide for notification subscriptions
Aligned the user guide with the current YANG notification subscription
logic, updating steps and examples for accuracy.
JIRA: NETCONF-714
Change-Id: I7c05e6bfa0c23a5bb02a5298b44db3ec8ab604cc
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Yaroslav Lastivka [Tue, 11 Feb 2025 20:18:22 +0000 (22:18 +0200)]
Replace File(String) with Paths.get(String)
Updated BenchmarkOpenApiIT and MountPointE2ETest
to use Paths.get(String).toFile() instead of new File(String),
aligning with modern Java NIO best practices.
Change-Id: I1be86eacd2392ae52f01286fe742e1e88df96cfa
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Robert Varga [Tue, 11 Feb 2025 23:12:32 +0000 (00:12 +0100)]
Bump infrautils to 7.1.1
Pick up improvements from upstream.
Change-Id: Ib88e770872bf17fa94ffb21efcaaddc6d2924bb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Tue, 11 Feb 2025 12:26:14 +0000 (13:26 +0100)]
Revert "Fix testtool request failure to netty endpoint"
The issue NETCONF-1378 has been fixed. Now we can remove workaround
introduced in NETCONF-1376.
This reverts commit
760ac1687d5467fa05d739e3c5221ced376a518c.
Change-Id: I27686166a14feca3cab9e8dd15f33d5fe05e809b
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Tue, 11 Feb 2025 10:31:20 +0000 (11:31 +0100)]
Use odl-codegen-extensions
yang-ext has a number of different extensions. Use
odl-codegen-extensions, which is focused on just codegen support.
Change-Id: I72a2b70acab4aeb509d4e126abfdf8cade10e42c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 17:26:44 +0000 (18:26 +0100)]
Modernize netconf-testtool
- Runtime.exec(String) is deprected since Java 18, migrate ScaleUtil
and mark a FIXME for follow-up cleanup
- use HashMap.newHashMap(int) instead Maps
- use Path.of() for path manipulation
- ditch Preconditions.checkState() in favor of a simple check and throws
Change-Id: Id0dde8dcb0bf06271d7f896e1df8925d85d3a575
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 16:43:38 +0000 (17:43 +0100)]
Use Path.of() in MountPointEndToEndTest
This is the sole violation reported by modernizer: fix it.
Change-Id: Idef9e644cefc402961156ea374bc0b4eebe90b1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 16:38:32 +0000 (17:38 +0100)]
Eliminate TestUtils
Inline methods into their sole user. Duplicate TEST_ENTRIES, as they are
very simple.
Change-Id: I1c6311809ddc21568577c2add85844a40ad4b9eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 16:34:25 +0000 (17:34 +0100)]
Modernize keystore-plaintext-localfile
Use java.nio.file.Path instead of File, fixing modernizer warnings.
Change-Id: Ia17d4d5abcac6a78b8e52d300b2a5aff1dad4136
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 16:18:55 +0000 (17:18 +0100)]
Modernize netconf-client-mdsal
Use HashMap.newHashMap() and Path.of(), as noted by modernizer.
Change-Id: I596876103dcd5eb2157b9be0cb1b6ea8f0c1afc0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 16:04:16 +0000 (17:04 +0100)]
Modernize keystore-legacy
Use HashMap.newHashMap() instead of Maps.newHashMapWithExpectedSize.
Change-Id: Ib6ad7a3c678e7ed0bddcc429da677fa9b769acf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 13:39:38 +0000 (14:39 +0100)]
Fix odl-restconf-notification
This feature ends up pulling in an MD-SAL bundle, use the proper feature
for that.
JIRA: NETCONF-714
Change-Id: Ieb5caa2f7d52036bdf845c1705ddaf6994cae17a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Mon, 10 Feb 2025 10:30:20 +0000 (11:30 +0100)]
Refactor RestconfStream.Registry usage
- remove redundant parameters of RestconfStream.Registry
- remove redundant fields which are only hiding local parameter usage
- improve nullability checks
JIRA: NETCONF-714
Change-Id: I113ee3d0f730ea536c5ad43a59106e837e0a47b2
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 13:44:00 +0000 (14:44 +0100)]
Use odl-mdsal-model-rfc7407-ietf-x509-cert-to-name
We are using a raw bundle in odl-netconf-impl. Fix that by referencing
odl-mdsal-model-rfc7407-ietf-x509-cert-to-name, which is its upstream
packaging.
Change-Id: I62a5497c68719b83e4d4450bba7326c660ddc31e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 10:59:50 +0000 (11:59 +0100)]
Modernize netconf-server-mdsal
Use Path.of() instead of Paths.get() and similar conversions.
Change-Id: I490e0565973e0be7c165572cb9c2b983395bd8b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 10:54:46 +0000 (11:54 +0100)]
Modernize NetconfCapabilityMonitoringService
Use HashMap.newHashMap() to allocate the map.
Change-Id: Ideb22393f639c69a0da591435ea5932278f66378
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 10:52:05 +0000 (11:52 +0100)]
Modernize PathNode
Use LinkedHashMap.newLinkedHashMap().
Change-Id: I62230d947f38486b0842a49db464d79292620c71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 10:44:13 +0000 (11:44 +0100)]
Modernize NetconfMessageFactoryTest
Use nio for resolve paths.
Change-Id: Idbf903da7bb379e320aa6e38559142d6e012e52e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 10:39:23 +0000 (11:39 +0100)]
Modernize XmlUtil
Add readXmlToElement(Path) and use NIO Files.newInputStream().
Change-Id: I8175aedafb601954370dd8665a93c851f10b39bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 07:42:27 +0000 (08:42 +0100)]
Bump upstreams
Adopt:
- odlparent-14.0.7
- infrautils-7.1.0
- yangtools-14.0.9
- mdsal-14.0.9
Change-Id: I09074ce7ce91c80c13e197fdd929c29bd1fefa15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 10 Feb 2025 11:15:29 +0000 (12:15 +0100)]
Add modernizer suppressions
We have some plugin crosstalk from upstreams, let's disable modernizer
where needed.
Change-Id: I48138bffff7de1a92bb08e6c2436bf579608c110
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Samuel Schneider [Mon, 27 Jan 2025 08:14:09 +0000 (09:14 +0100)]
Create Listener to Sender interface
Fully switch to refactored restconf-server SSE support.
Remove old unused logic.
For this create SSEResponse to manage SSE connection.
JIRA: NETCONF-714
Change-Id: I287bee2b2863837ea94e54d1b14e9ac9f813401b
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Matej Sramcik [Wed, 22 Jan 2025 11:06:46 +0000 (12:06 +0100)]
Complete ChannelSender
Finish FIXMEs in Channel Sender to allow HTTP1.
JIRA: NETCONF-714
Change-Id: I80574f08e47ecc9d71c48732bb34ab41662f8c6b
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Ivan Hrasko [Wed, 20 Nov 2024 14:27:45 +0000 (15:27 +0100)]
Add StreamsResource
Instead of registering ServerSseHandler into Netty's pipeline
as handler of all "text/event-stream" GET requests create
dedicated resource to server /streams path.
JIRA: NETCONF-714
Change-Id: I7218062a105516fa5fab71f9219159be14971701
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Robert Varga [Sun, 9 Feb 2025 02:31:16 +0000 (03:31 +0100)]
Split out usecases/
We have two packaging use cases, for which we want to test. The library
of tests is yet to be defined. Use cases may also expand.
The idea of this directory the cartesian product of (packaging x IT),
such that we have a broad integration test coverage.
Change-Id: Iafc0f3a834e7786f23b3fcba31b12b3086b41118
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Matej Sramcik [Wed, 29 Jan 2025 14:00:54 +0000 (15:00 +0100)]
Rework SubscriptionStateServiceTest
SubscriptionStateServiceTest class improved by making it parametrized
to reduce duplicate code.
JIRA: NETCONF-714
Change-Id: Id5eb5124e4f0db6fab770da5983d00b9458fbfa9
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Thu, 6 Feb 2025 15:30:38 +0000 (16:30 +0100)]
Improve bnd-parent
Add bnd.bnd file to provide local repository overloads, improving
manifests a bit.
Change-Id: Ia839558105d288c3df6d01bbd86487bb1e8ada60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Thu, 6 Feb 2025 14:24:32 +0000 (15:24 +0100)]
Refactor RestconfSession
RestconfSession#prepareRequest does not need ChannelHandler parameter.
Remove it and adapt all consequences across usages of it to create
PreparedRequest instances.
JIRA: NETCONF-714
Change-Id: I9e597657618131a0f9b3432d56f1fa2174981e7e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Thu, 6 Feb 2025 13:55:30 +0000 (14:55 +0100)]
Refactor RestconfSubscriptionsStreamRegistry
Refactor RestconfSubscriptionsStreamRegistry:
- organize constants
- refactor methods
JIRA: NETCONF-714
Change-Id: Icf81c90212280174e075e87094093beffa1a6d39
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Wed, 16 Oct 2024 10:52:23 +0000 (12:52 +0200)]
Use a switch expression in SecurityHelper
Use a switch expression instead of an if/else cascade.
Change-Id: I0e3df820381b77bd5cebb145bbc8a545e1c6f02e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 7 Sep 2024 17:05:39 +0000 (19:05 +0200)]
Refactor restconf-server SSE support
ServerSseHandler cannot hope to correctly implement SSE transition
because it depends on protocol being used:
- for HTTP/1.1 it needs to integrade with Channel pipeline and disable
normal HTTP requests
- for HTTP/2 it needs to track the streamId on which request was made,
so that RST_STREAM frames correctly terminate the event stream
JIRA: NETCONF-1419, NETCONF-714
Change-Id: I994c661ae17cda53eae9950db4bc3eadb97d2e19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Oleksandr Zharov [Wed, 11 Dec 2024 20:05:51 +0000 (21:05 +0100)]
Implement RestconfSubscriptionsStreamRegistry
Implemented createStream method to handle creation of
default NETCONF stream.
JIRA: NETCONF-714
Change-Id: Id772fb8e247efb3c29732cd8a8a03e69106d10c1
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Peter Suna [Wed, 4 Dec 2024 11:23:10 +0000 (12:23 +0100)]
Add E2E benchmark OpenApi integration test
Add benchmark test with Juniper models to test OpenApi with large
models. Main goal is to teste if OpenApi can handle large models
with limited memory.
JIRA: NETCONF-939
Change-Id: I252c0f9ff7801a0a8a3579a64a20a404ac946d18
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Ivan Hrasko [Tue, 4 Feb 2025 12:20:48 +0000 (13:20 +0100)]
Cleanup EndpointRoot class
Cleanup EndpointRoot class:
- remove unnecessary toString call
- fix typo
Change-Id: I0c97f2048d5fd7fdc0a932d550d7a6003b5c0e94
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Matej Sramcik [Wed, 29 Jan 2025 13:55:11 +0000 (14:55 +0100)]
Replace errorId by reason
Field errorID is not correct name of field. Changed to "reason"
according to RFC 8639.
JIRA: NETCONF-714
Change-Id: Ie5474e8fee5e687185bb8020948383b749040a98
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Yaroslav Lastivka [Tue, 19 Nov 2024 09:06:09 +0000 (11:06 +0200)]
Implement subtree filtering
Added support for subtree filtering of NormalizedNode
structures within the restconf-server-spi module
Added subtree filtering chapter to the user-guide.
JIRA: NETCONF-714
Change-Id: I8fc246b5516582fb389a097e3366e867e71f7e84
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Ivan Hrasko [Tue, 3 Dec 2024 08:28:08 +0000 (09:28 +0100)]
Refactor AbstractRestconfStreamRegistry
Refactor AbstractRestconfStreamRegistry in a way that createStream
method is moved to MdsalRestconfStreamRegistry in order to allow us
to add other overrides, for example for subscribed notifications.
JIRA: NETCONF-714
Change-Id: I5be4e7d51969f8aca024badd8173043dc1c5db68
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Matej Sramcik [Tue, 19 Nov 2024 07:00:00 +0000 (08:00 +0100)]
Expose NETCONF event stream for subscriptions
Create default event stream called NETCONF for purposes of
subscribed notifications.
JIRA: NETCONF-1417
Change-Id: I405789db2fa8011362e3bce34df2134b20720645
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Tue, 3 Dec 2024 17:47:40 +0000 (18:47 +0100)]
Improve SSHTransportStack documentation
Explain the indexing we have, so it is clearer what is it that we are
tracking.
JIRA: NETCONF-1423
Change-Id: I058333e67e185f1cb2c4510a6f48477ed7e20b34
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 3 Dec 2024 16:59:04 +0000 (17:59 +0100)]
Improve TransportIoSession.getHandler()
Return ChannelInboundHandler, to make it clear we are attaching an
inbound processor.
Change-Id: Idff8b3f562666dc8202ee7319baa94f5208750d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 29 Jan 2025 14:55:10 +0000 (15:55 +0100)]
Bump upstreams
Adopt:
- yangtools-14.0.7
- mdsal-14.0.8
Since controller-11 now has a bnd-parent, use that to simplify our
dependency tracking.
Also notif-leaves-update.xml is updated to account for YANGTOOLS-1651
slighly changing iteration order of modified nodes.
Change-Id: I52c4dadc00a551d5a3a9928b113864b00128bb5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Oleksandr Zharov [Tue, 8 Oct 2024 20:43:13 +0000 (22:43 +0200)]
Java based tests for OpenApi over Netty
Added tests for OpenApi over Netty using toaster
model.
JIRA: NETCONF-1371
Change-Id: I8a9c9ecc20c6cc34d1d8809c22a85c16bf04f9db
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Anil Belur [Wed, 11 Dec 2024 02:35:16 +0000 (12:35 +1000)]
CI: Enable Gerrit Verify workflows with GHA
This is a pre-req to move Jenkins jobs to GHA.
Change-Id: I0c2a0c8213d476bebe450768ef1bb9cbaa16f737
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Anil Belur [Wed, 11 Dec 2024 02:35:40 +0000 (12:35 +1000)]
CI: Enable Github2Gerrit workflow
This allows Github devs/users to contribute to the repo using the
Github workflow.
Change-Id: I483ee5a88688eba6a1e3498b8c5499929be4b7b0
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Peter Suna [Thu, 12 Dec 2024 12:24:26 +0000 (13:24 +0100)]
Skip device update on NetconfNodeHandler close
If NetconfNodeHandler is closing and removing device
registration, it is unnecessary to update device data
when they are removed in the next step.
JIRA: NETCONF-1432
Change-Id: I946de0539c89302fb558d871437cff2e1801567a
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Robert Varga [Mon, 2 Dec 2024 22:09:29 +0000 (23:09 +0100)]
Refactor transport.http.Response
Refactor Response to allow pure data holder instances to be used. This
improves dispatch, as we do not overload meaning and opens up the
possibility of further types of responses.
RequestResponse is renamed to FiniteResponse, to reflect the fact it is
of flexible, but finite, size.
JIRA: NETCONF-1419
Change-Id: I4288f520c1ffa0db3587e5a1653517f23771228a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 10 Dec 2024 15:58:18 +0000 (16:58 +0100)]
Do not issue content-type in HEAD requests
A HEAD request with a body does not make sense, do not generate these.
Change-Id: Ib78f122b522fd533764436ca4881760b7dd81c28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Yaroslav Lastivka [Mon, 11 Nov 2024 09:28:57 +0000 (11:28 +0200)]
Document RESTCONF subscriptions in user-guide
Added chapter for NETCONF user-guide how to establish,
listen, modify and terminate subscriptions for YANG notifications.
JIRA: NETCONF-714
Change-Id: Id478e123654a519f630390b989a77cf84886b581
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Oleksandr Zharov [Fri, 29 Nov 2024 18:17:19 +0000 (19:17 +0100)]
Expose supported features from RFC 8639
This patch provides class that exposes supprorted featers
from RFC 8639.
JIRA: NETCONF-714
Change-Id: Ia096f29c22c0591f476047fcc55ca562224b70a3
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Ivan Hrasko [Wed, 27 Nov 2024 14:23:48 +0000 (15:23 +0100)]
Add copyStreamId to AbstractBasicAuthHandler
Copy copyStreamId method into AbstractBasicAuthHandler as its
previous location ServerSseHandler class will be removed.
JIRA: NETCONF-714
Change-Id: Ia56124c457216dd147f1fe4dc32ce4b5ae7e230c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Samuel Schneider [Tue, 22 Oct 2024 07:58:40 +0000 (09:58 +0200)]
Implement subscription RPCs
Implement RPCs for managing RFC 8639 notification subscriptions.
Create se service for managing subscription data in mdsal
datastore.
JIRA: NETCONF-714
Change-Id: I71357f48a554e6f43ad30d12c724184daaa63b60
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
Oleksandr Zharov [Thu, 14 Nov 2024 12:04:18 +0000 (13:04 +0100)]
Implement simple state machine
Added simple state machine to add some controle over
subscriptions state transition.
JIRA: NETCONF-714
Change-Id: I23ba8a2b03104b3c7742b5cd59b33de8060daad0
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Matej Sramcik [Tue, 29 Oct 2024 13:11:31 +0000 (14:11 +0100)]
Implement subscription state change notifications
Added SubscriptionStateService which use md-sal
DOMNotificationPublishService to send notifications for subscription
status change - modified, completed, resumed, terminated and suspended.
JIRA: NETCONF-714
Change-Id: I67dcaad79d64223b3d3770e8acb35db44d867da9
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Yaroslav Lastivka [Tue, 29 Oct 2024 10:47:33 +0000 (12:47 +0200)]
Add odl-restconf-notification feature
Created feature for restconf notification subscriptions.
JIRA: NETCONF-714
Change-Id: Id905eb89efb720b143ba55c9239e5eb4117863da
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Yaroslav Lastivka [Thu, 24 Oct 2024 12:38:52 +0000 (15:38 +0300)]
Add restconf-notifications-mdsal package
Created dedicated package for interact with mdsal.
JIRA: NETCONF-714
Change-Id: Ib2ec5c7982a22d61851979bcbefa6194a90b54ad
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Yaroslav Lastivka [Wed, 16 Oct 2024 10:33:54 +0000 (13:33 +0300)]
Add restconf-subscription package
Added utility method for generatign subscriptions IDs.
JIRA: NETCONF-714
Change-Id: Iad0decb5dd952b010665a0db4f3da570f44f28fb
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Matej Sramcik [Thu, 4 Jan 2024 13:05:37 +0000 (14:05 +0100)]
Disconnect device deleted from allowed devices
After removing connected device from the allowed devices,
the device continued to stay connected with the node
in the netconf topology.
This change ensures that a device is properly disconnected
after being removed from the allowed devices.
JIRA: NETCONF-989
Change-Id: I35cba26c4d004a5f90b9fa4f65651c9f58f386bd
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ivan Hrasko [Wed, 27 Nov 2024 14:18:45 +0000 (15:18 +0100)]
Mark ServerSseHandler deprecated
Registering ServerSseHandler into Netty's pipeline is:
- preventing us to implement another SSE based web resources,
for example those needed for subscribed notifications.
- adding performance drawback as ServerSseHandler is invoked
on every GET request.
JIRA: NETCONF-714
Change-Id: I368ae2ee547611129b0ea0d86d9b99d260e854c3
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Mon, 2 Dec 2024 11:32:06 +0000 (12:32 +0100)]
Exclude commons-logging
commons-logging is provided by pax-logging in Karaf, hence we should not
be generating a dependency on it.
Change-Id: I19aa406575e5e7fc2ab0834eb24d7a21870ab57c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 9 Oct 2024 12:37:08 +0000 (14:37 +0200)]
Do not buffer entities in PathsEntity
We have the target generator ready -- hence we can just run generate()
without buffering.
Change-Id: Ifda1116eec357fc14bca7b6ff74fe39a422d6433
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 30 Nov 2024 14:19:04 +0000 (15:19 +0100)]
Bump upstreams
Adopt:
- odlparent-14.0.5
- infrautils-7.0.5
- yangtools-14.0.6
- mdsal-14.0.6
Change-Id: Iedd5c0afd4f900e7404f75d4454654de3649f5da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 30 Nov 2024 21:48:01 +0000 (22:48 +0100)]
Fixup checkstyle
Upgraded checkstyle is finding new violations, fix them up.
Change-Id: I0844f56c3c605cc26455bf6a69c044ad46e7d3b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Oleksandr Zharov [Wed, 3 Jul 2024 18:00:31 +0000 (20:00 +0200)]
Migrate to Pekko
Replaced usage of Akka to Pekko.
Done according to:
https://pekko.apache.org/docs/pekko/current/project/migration-guides.html
JIRA: NETCONF-1341
Change-Id: I9fac889f3d5ce446fc7e0c9b37ca40a4ef754bf2
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Robert Varga [Tue, 26 Nov 2024 11:45:55 +0000 (12:45 +0100)]
Bump upstreams
Adopt:
- controller-11.0.0-SNAPSHOT
- aaa-0.21.0-SNAPSHOT
Change-Id: I4ee2510f9b6828503438a393d43be2a89dc484c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 20:17:15 +0000 (21:17 +0100)]
Migrate HttpClientServerTest
Use HTTPServerSession for test harness, as we are entering a phase where
mocking would have to duplicate production code.
Since we are using HTTPServerSession, we can verify our task gets
executed on the corresponding virtual thread. That in turn allows us to
ditch the executor service in favor of an explicit sleep.
JIRA: NETCONF-1419
Change-Id: If1958fd6e57180565cd3d0bd5b341cfa0427b3b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 19:00:48 +0000 (20:00 +0100)]
Split out CleartextUpgradeHandler
The code structure is clear: we have two handlers:
- AlpnUpgradeHandler handles the transition from TLS for HTTPS
- CleartextUpgradeHandler handles the transition frop TCP for HTTP
Split out the anonymous class into a named entity, so we have an
improved debugging experience -- including transition debug messages.
We also talk to our superclass to not automatically release the message,
and therefore we do not need to undo its work in channelRead().
JIRA: NETCONF-1419
Change-Id: I428e1ed91d7c3c5a6beb51af56fd8abcac112a16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ruslan Kashapov [Fri, 6 Sep 2024 10:56:07 +0000 (13:56 +0300)]
Fix cleartext HTTP/2 upgrade
HttpServerUpgradeHandler is a HttpObjectAggregator, therefore we need to
pass a consistent maximum request size -- otherwise it will reject the
first HTTP/1 request.
The second part of the puzzle is intercepting the first request: for
this we already have a an UpgradeEvent hook.
JIRA: NETCONF-1378
Change-Id: Ibeb85fe84e645411b4ac634649335f82189f0dba
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 12:36:49 +0000 (13:36 +0100)]
Refactor HTTPScheme.initializeServerPipeline()
The split nature of setup makes it quite unclear as to what is going on.
This improves the code flow, as we now understand that channelHandler()
is a HTTP2->HTTP1 thing -- hence we can allocate it only when needed.
This leads to TLS-based-HTTP1 not allocating it at all.
JIRA: NETCONF-1419
Change-Id: Ib8998b648fac27536c2b7b64fac6818de1fb0374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 11:31:01 +0000 (12:31 +0100)]
Remove {Plain,Tls}HTTPServer
The two subclasses differ only in HTTPScheme and pipeline setup. Move
pipeline setup to HTTPScheme and eliminate the two subclasses.
The result is a centralized view of what the pipeline looks like as well
make it possible to setup the pipeline without HTTPServer.
JIRA: NETCONF-1419
Change-Id: I82a589a39a60748545ee110e6d2643bc16ce80fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 14:53:58 +0000 (15:53 +0100)]
Use HTTPTransportChannel in enableClientSse()
We are mucking around the pipeline to figure out the scheme we are
using. Pass down HTTPTransportChannel which has this info readily
available.
JIRA: NETCONF-1419
Change-Id: I24e7c971787c8988a09a1b4ec1be895b4f6dffff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 25 Nov 2024 14:39:34 +0000 (15:39 +0100)]
Pass HTTPScheme to ClientHttp2RequestDispatcher
We know whether or not we are being set up for HTTPS, pass that
knowledge down to ClientHttp2RequestDispatcher, which thus loses a
dependency on TlsHandler.
JIRA: NETCONF-1419
Change-Id: I23fcf6003915fb4a87e2f46dbdeb6b07a8d59b62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Nov 2024 21:19:14 +0000 (22:19 +0100)]
Add HTTPScheme
Expose supported channel setups via HTTPScheme, which is an enum,
unliike the Netty equivalent. This will allow us to host some
implementation details there in the future.
JIRA: NETCONF-1419
Change-Id: I29892928ed06c872d445c22a2589819dd7cac71a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 22 Nov 2024 19:41:41 +0000 (20:41 +0100)]
Propagate client auth failure
We should trigger onTransportFailed() when we fail to authenticate to
the server.
JIRA: NETCONF-1423
Change-Id: I58ff67d663c2728488eea6206d1ba03c4d707ac3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 22 Nov 2024 19:37:10 +0000 (20:37 +0100)]
Propagate SSH channel open failures
A SSHTransportStack may fail to open the "NETCONF" subsystem, which
means the transport has failed. Propagate this failure to listeners.
JIRA: NETCONF-1423
Change-Id: Ide8a0e3a91bdf48fdc36399b4b9b97d742435cbb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 22 Nov 2024 19:46:03 +0000 (20:46 +0100)]
Annotate sessionId(Session)
We are always returning non-null here, annotate that fact.
Change-Id: I9f3b4425f98fef3656391cb8f4116cdec039fd6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 19 Nov 2024 10:56:33 +0000 (11:56 +0100)]
Add a few more README.mds
This adds READMEs to keystore, transport and truststore directories.
Change-Id: I0b38dbf6a9371f7cd190d94831162a8e96110f28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 14 Nov 2024 23:31:34 +0000 (00:31 +0100)]
Expand README.md
Add a big explanation diagram of what we are doing here and add
protocol/README.md
Change-Id: I5458052f75560827bd826b3f3e3887e94818e894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Tue, 12 Nov 2024 08:26:41 +0000 (09:26 +0100)]
Use /openapi/api/v3/mounts without ending slash
New Netty based RESTCONF OpenApi server does not recognize
URL when it ends by slash ('/').
Adapt swagger-initializer accordingly.
JIRA: NETCONF-1370
Change-Id: Ie585e778686fff84eb091847ac9cbad63cacdd69
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Ruslan Kashapov [Thu, 5 Sep 2024 07:06:43 +0000 (10:06 +0300)]
Netty endpoint for RESTCONF OpenApi
Introduce OpenApiResourceProvider, which registers to each
NettyEndpoint's WebHostResourceProvider whiteboard.
Each NettyEndpoint then drives instantiation of its own
WebHostResourceInstance for each registered provider.
JIRA: NETCONF-1370
Change-Id: I4005f3bd1fe238672cfdee465474d625a628a561
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Robert Varga [Sun, 10 Nov 2024 19:16:25 +0000 (20:16 +0100)]
Split out ServerRequestExecutor
This is a reusable piece, not directly tied to the pipeline. Split it
out, making for a leader HTTPServerSession.
JIRA: NETCONF-1424
Change-Id: Ifc9e79ec32d91a2871a65e8b751267dec0cfbe67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 10 Nov 2024 18:35:55 +0000 (19:35 +0100)]
Shutdown threadpools when channelInactive()
A secodary event that should trigger us shutting down is when the
channel does down. Add that hook.
JIRA: NETCONF-1424
Change-Id: I14390525996a11da12feaffa3802db2e7be13d73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 12 Nov 2024 03:27:41 +0000 (04:27 +0100)]
Make sure RestconfStream.Sender gets non-null
null event chunks are simply not allowed, annotate as much.
Change-Id: I9e97cc5ef1756106324d440b3bffca392561d1f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Yaroslav Lastivka [Fri, 8 Nov 2024 13:52:44 +0000 (15:52 +0200)]
Add credentials for CallHome Netconf node
Added empty unencrypted login credentials configuration for
CallHome Netconf nodes in CallHomeMountService.
Ensures compatibility with NetconfDeviceTopologyAdapter,
which now requires credentials for creating NetconfNode
after applying NETCONF-1235.
JIRA: NETCONF-1427
Change-Id: I24b1020ca10229bb394e3a2c8930f8269dd86d4e
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Robert Varga [Mon, 11 Nov 2024 12:59:09 +0000 (13:59 +0100)]
Modernize callhome-provider
Use DataObject{Identifier,Reference} instead of InstanceIdentifier.
Change-Id: I9f976c71372e3b822e4fe7cc00450dcdf9860082
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ivan Hrasko [Mon, 21 Oct 2024 09:22:59 +0000 (11:22 +0200)]
Indicate RESTCONF server features
Indicate that RESTCONF server implementation supports:
HttpListen and HttpsListen features.
HttpsCallHome will be supported after server refactoring
is completed and we will have a user for it.
CentralRestconfServerSupported feature is going to be relocated
into new apps/central-restconf-server package.
Change-Id: I0a52ed7918547ef39f18e1dcfc0f473cc5a4f857
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Peter Suna [Thu, 7 Nov 2024 12:24:14 +0000 (13:24 +0100)]
Stop device reconnection with wrong config
Call onDeviceFailure directly on delegate attribute instead
of calling onDeviceFailed method, which tries to reconnect with
same incorrect configuration.
JIRA: NETCONF-1425
Change-Id: I0b5e09fadcca0e140d16d01f94abdf9cd882e8a1
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Robert Varga [Wed, 6 Nov 2024 23:41:45 +0000 (00:41 +0100)]
Fix BytebufRequestResponse capitalization
The response holds a ByteBuf, not a Bytebuf. Capitalize correctly.
Change-Id: Ibb6fcce0794b83af6e8ab13c026342d770288d83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>