netconf.git
6 years agoNETCONF-530 - netconf-testtool failed on start with NullPointerException 19/69719/5
Jakub Tóth [Mon, 19 Mar 2018 11:05:05 +0000 (12:05 +0100)]
NETCONF-530 - netconf-testtool failed on start with NullPointerException

missing revisions in default names of YANG models

Change-Id: I52c09699989b38ab828f99070081634dac9853ce
Signed-off-by: Jakub Tóth <jakub.toth@pantheon.tech>
6 years agoRemove unused test method 58/70058/3
Ryan Goulding [Sun, 25 Mar 2018 17:20:42 +0000 (13:20 -0400)]
Remove unused test method

This is done in preparation of Jackson removal.

Change-Id: Ie919f9a8a548f6498ab21a67b8eedd295ee898bd
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoMerge "Remove unused reference to Broker in NetconfDeviceSalProviderTest"
JakubToth [Mon, 26 Mar 2018 09:48:14 +0000 (09:48 +0000)]
Merge "Remove unused reference to Broker in NetconfDeviceSalProviderTest"

6 years agoMerge "Depend on odl-aaa-shiro-act feature instead of bundle"
JakubToth [Mon, 26 Mar 2018 09:02:35 +0000 (09:02 +0000)]
Merge "Depend on odl-aaa-shiro-act feature instead of bundle"

6 years agoRemove unused reference to Broker in NetconfDeviceSalProviderTest 32/70032/2
Tom Pantelis [Fri, 23 Mar 2018 15:25:44 +0000 (11:25 -0400)]
Remove unused reference to Broker in NetconfDeviceSalProviderTest

The Broker et el interfaces are being deprecated so remove references.

Change-Id: I17706b065f0e5503e83b37bfabe66596d563d5f1
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoDepend on odl-aaa-shiro-act feature instead of bundle 69/70069/2
Ryan Goulding [Sun, 25 Mar 2018 22:22:55 +0000 (18:22 -0400)]
Depend on odl-aaa-shiro-act feature instead of bundle

This is related to AAA-164, which involves exposing a feature for
AAA activation instead of a bundle.

JIRA: AAA-164
Change-Id: I032e7dc8afef4b053d2162194454cde73cf85f45
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoProperly specify Jackson runtime dependencies 70/70070/1
Ryan Goulding [Sun, 25 Mar 2018 22:48:37 +0000 (18:48 -0400)]
Properly specify Jackson runtime dependencies

Properly list feature dependencies for Jackson instead of relying on
AAA bringing these deps in.

Change-Id: I4857bf8498b7a64ddd12716c0a5e0b7d1d1d1928
JIRA: NETCONF-531
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoFix odl-config-netconf-connector 03/69903/1
Robert Varga [Thu, 22 Mar 2018 17:59:06 +0000 (18:59 +0100)]
Fix odl-config-netconf-connector

It should not be pulling in notifications-impl, but rather pull
it in via a feature.

Change-Id: Id49b573358df1d72685fba001247f0f1404af9cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd odl-restconf-common 27/69827/1
Robert Varga [Thu, 22 Mar 2018 15:57:12 +0000 (16:57 +0100)]
Add odl-restconf-common

Restconf features and up duplicating a lot of common infrastructure,
make sure we package it in a common feature.

Change-Id: Ia8f69fcf5668010e3f62a6204828bf819745ca87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd the entry for using TLS protocol type 97/69597/3
LiGuosheng [Mon, 19 Mar 2018 01:16:37 +0000 (09:16 +0800)]
Add the entry for using TLS protocol type

Add TLS protocol type to the method getClientConfig of class
AbstractNetconfTopology. Add test case.

Change-Id: Ia0d32c629d21c48a65d12edc76bc0decc2a3a9f6
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoMerge "NETCONF-525: fix netconf AuthProvider packaging"
JakubToth [Wed, 21 Mar 2018 08:02:42 +0000 (08:02 +0000)]
Merge "NETCONF-525: fix netconf AuthProvider packaging"

6 years agoNETCONF-525: fix netconf AuthProvider packaging 95/69695/1
Ryan Goulding [Tue, 20 Mar 2018 17:01:47 +0000 (13:01 -0400)]
NETCONF-525: fix netconf AuthProvider packaging

Change-Id: I79fe7d68d6f026ce22d2ced158531c26270d5105
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoUse YinExportUtils.writeModuleAsYinText() 43/69443/2
Robert Varga [Tue, 13 Mar 2018 14:57:10 +0000 (15:57 +0100)]
Use YinExportUtils.writeModuleAsYinText()

This removes the use of deprecated SchemaNode-based writer in favor
of EffectiveModuleStatement-based one.

Change-Id: I89b465ad25e34be6cb23344446a4078edacd8cf5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd branch for creating TLS client 81/69481/1
LiGuosheng [Wed, 14 Mar 2018 06:40:51 +0000 (14:40 +0800)]
Add branch for creating TLS client

Add TLS case to NetconfClientDispatcherImpl for creating TLS
clients.

Change-Id: I7da44d1c7c074633e7ae08b2863b4c3466066a4f
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoAdd TLS client channel initializer 45/69245/4
LiGuosheng [Thu, 8 Mar 2018 01:52:46 +0000 (09:52 +0800)]
Add TLS client channel initializer

The initializer will use the SslHandlerFactory to create
SslHandler each time the channel is active.

Change-Id: Id7010f3e47d60723b4be4bd0d6f99ffcf3a67aa2
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoConvert rfc8040 ListenerAdapter to DOMDataTreeChangeListener 93/69093/4
Tom Pantelis [Sat, 3 Mar 2018 18:43:55 +0000 (13:43 -0500)]
Convert rfc8040 ListenerAdapter to DOMDataTreeChangeListener

DOMDataChangeListener is scheduled for removal - the bierman02
ListenerAdapter was already converted. Also modified the
ListenerAdapter to use the org.json lib instead of the jackson
lib as the UT revealed that the jackson lib doesn't convert
the XML to JSON correctly and the bierman02 ListenerAdapter
was recently converted to use org.json.

Change-Id: I9e6778a206f412bb8498297cdcb94b77ebba25dd
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoAdd SslHandlerFactory to NetconfClientConfiguration 54/69254/2
LiGuosheng [Thu, 8 Mar 2018 08:40:15 +0000 (16:40 +0800)]
Add SslHandlerFactory to NetconfClientConfiguration

If client protocol is TLS, then add a SslHandlerFactory instance to
NetconfClientConfiguration instead of SSH AuthenticationHandler.

Change-Id: Ie0d06a31e1cfca7f78dc0721a76b4995d69cd529
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoBump yangtools to 2.0.2 75/69275/2
Robert Varga [Thu, 8 Mar 2018 14:25:07 +0000 (15:25 +0100)]
Bump yangtools to 2.0.2

This patch bumps yangtools to 2.0.2.

Change-Id: I35fce822efbf72b0f88e842e6f078e646c8161d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix compile errors in UTs 13/69413/3
Tom Pantelis [Mon, 12 Mar 2018 22:55:08 +0000 (18:55 -0400)]
Fix compile errors in UTs

This was caused by a recent controller patch which converted
CDS to implement the msdal APIs. Modified the affected UTs
to use the SerializedDOMDataBroker so as not to depend in CDS
implementation.

Change-Id: I1317310fe601387c03892a1ddd53ac79f1704f71
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoNETCONF-521: Replace literal '\n' by newline 50/69250/2
Luis Gomez [Thu, 8 Mar 2018 04:21:20 +0000 (20:21 -0800)]
NETCONF-521: Replace literal '\n' by newline

This fixes the private key decoding error in NETCONF-521.

Change-Id: Iddcd29ea8ce513068e49071c0bdabbb788c11064
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
6 years agoAdd interface SslHandlerFactory 23/68523/12
LiGuosheng [Fri, 23 Feb 2018 06:34:39 +0000 (14:34 +0800)]
Add interface SslHandlerFactory

This factory is used by the TLS clients to create SslHandler that will
be added to the channel pipeline when the channel is active. TLS
versions are configurable.

Change-Id: I95c2a0ff105020ac84b02d82207f830d70ef7197
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoMerge "Eliminate duplicate dependency"
JakubToth [Wed, 7 Mar 2018 11:32:47 +0000 (11:32 +0000)]
Merge "Eliminate duplicate dependency"

6 years agoWebsocket Uri should have scheme wss if registration is https 83/67283/10
Josh [Thu, 18 Jan 2018 11:43:22 +0000 (13:43 +0200)]
Websocket Uri should have scheme wss if registration is https

Change-Id: I870e704e3859eaa7a01c4a70d148bbfdc452da2c
Signed-off-by: Josh <jhershbe@redhat.com>
6 years agoEliminate duplicate dependency 96/69196/1
Robert Varga [Wed, 7 Mar 2018 09:52:23 +0000 (10:52 +0100)]
Eliminate duplicate dependency

Fixes a maven warning.

Change-Id: I4b07bacdff4f401503bc92e72c0045052de1f7b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd dependency on mdsal-binding-dom-codec 56/69156/2
Robert Varga [Tue, 6 Mar 2018 18:25:57 +0000 (19:25 +0100)]
Add dependency on mdsal-binding-dom-codec

One of the upstreams has removed it, add it back.

Change-Id: I18e1d695c5dc2a7cb35a1a9ef95c434030c192c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge "Remove deprecated registerDataChangeListener method"
JakubToth [Mon, 5 Mar 2018 20:54:25 +0000 (20:54 +0000)]
Merge "Remove deprecated registerDataChangeListener method"

6 years agoEnable findbugs in restconf-binding-parent 12/69012/2
Tom Pantelis [Fri, 2 Mar 2018 18:27:56 +0000 (13:27 -0500)]
Enable findbugs in restconf-binding-parent

Change-Id: I1746a4340a28749ba9c593c9cb9209695d9c8f94
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix findbugs violations in sal-rest-docgen-maven 56/68956/2
Tom Pantelis [Thu, 1 Mar 2018 15:25:02 +0000 (10:25 -0500)]
Fix findbugs violations in sal-rest-docgen-maven

- Method ignores exceptional return value
- Method may fail to close stream on exception
- Reliance on default encoding

Change-Id: I854a7eee9960645a4c4a9d867a284bf202826786
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix findbugs violations in sal-rest-docgen 46/68946/2
Tom Pantelis [Thu, 1 Mar 2018 14:15:53 +0000 (09:15 -0500)]
Fix findbugs violations in sal-rest-docgen

- Reliance on default encoding
- Field is a mutable collection
- Write to static field from instance method
- Exception is caught when Exception is not thrown
- Field not initialized in constructor but dereferenced without null check
- Useless object created

Change-Id: Iff717b38d3a5bee082e7a9fb30969a0d755bf4c2
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix findbugs violations in restconf-nb-rfc8040 12/68912/6
Tom Pantelis [Wed, 28 Feb 2018 23:58:03 +0000 (18:58 -0500)]
Fix findbugs violations in restconf-nb-rfc8040

- Possible null pointer dereference
- Method call passes null for non-null parameter
- Nullcheck of value previously dereferenced
- Consider using Locale parameterized version of invoked method
- Reliance on default encoding
- Inconsistent synchronization
- Inefficient use of keySet iterator instead of entrySet iterator
- Should be a static inner class
- Useless assignment in return statement
- Method uses the same code for two branches
- Method uses the same code for two switch clauses
- Write to static field from instance method
- Redundant nullcheck of value known to be non-null
- Exception is caught when Exception is not thrown
- Useless control flow

Change-Id: I217a81d9dc487fe7f8e62a9c882c7335815ae052
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRemove deprecated registerDataChangeListener method 47/69047/1
Tom Pantelis [Sun, 4 Mar 2018 03:37:43 +0000 (22:37 -0500)]
Remove deprecated registerDataChangeListener method

registerDataChangeListener is scheduled for removal. The
method now has a default implementation in the interface so
the methods can be removed from the 2 DOMDataBroker implementations.

Change-Id: I1f3ead35f0cfdfd95bbbf35d9163b1f1309c8b90
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoRestconf 8040 should return 204 for delete and put 05/68905/1
Tom Pantelis [Wed, 28 Feb 2018 19:13:38 +0000 (14:13 -0500)]
Restconf 8040 should return 204 for delete and put

restconf was returning 200 Ok but according to RCF8040, for put,
"If an existing resource is modified, a "204 No Content"
status-line is returned."" and for delete, "If the DELETE request
succeeds, a "204 No Content" status-line is returned.".

Change-Id: I7133cdd747c1869d6b640c873bbcdccd437e8900
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoSpecify explicit javax.ws.rs version in restconf 55/68255/9
Tom Pantelis [Wed, 14 Feb 2018 17:13:05 +0000 (12:13 -0500)]
Specify explicit javax.ws.rs version in restconf

This seems to fix the intermittent issue where restconf
fails to install due to 2 versions of javax.ws.rs and
javax.annotation.

Change-Id: I6b106d700b89df575ee975f45e047cedb8c03e02
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoNETCONF-514: Use exists instead of read for PUT 82/68782/4
Tom Pantelis [Mon, 26 Feb 2018 19:19:01 +0000 (14:19 -0500)]
NETCONF-514: Use exists instead of read for PUT

The PUT operation needs to check if the path already exists
in order to return the proper response code according to the RFC
however calling exists instead of read is more efficient on the
back end.

Change-Id: Ibd7e99324c6a151aae91083e0c90bdf877161dee
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix findbugs violations in restconf-nb-bierman02 56/68556/4
Tom Pantelis [Fri, 23 Feb 2018 16:55:18 +0000 (11:55 -0500)]
Fix findbugs violations in restconf-nb-bierman02

- Possible null pointer dereference
- Method call passes null for non-null parameter
- Nullcheck of value previously dereferenced
- Consider using Locale parameterized version of invoked method
- Reliance on default encoding
- Inefficient use of keySet iterator instead of entrySet iterator
- Private method is never called
- Boxing/unboxing to parse a primitive
- Method concatenates strings using + in a loop
- Unchecked/unconfirmed cast of return value from method
- Method uses the same code for two switch clauses
- Parameter must be non-null but is marked as nullable
- Redundant nullcheck of value known to be non-null
- Exception is caught when Exception is not thrown
- Useless control flow

Change-Id: Ifd737d8c54532d98dd162db8d2a5915e38b13ff1
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix findbugs violations in restconf-common 55/68555/4
Tom Pantelis [Fri, 23 Feb 2018 15:23:04 +0000 (10:23 -0500)]
Fix findbugs violations in restconf-common

- Non-transient non-serializable instance field in serializable class
- Consider using Locale parameterized version of invoked method
- Method invokes toString() method on a String
- Return value of method without side effect is ignored

Change-Id: I97eaadea79e0af6cc119b232c4df6016c17e55ee
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoAdd restconf binding parent pom 50/68550/4
Tom Pantelis [Fri, 23 Feb 2018 14:56:32 +0000 (09:56 -0500)]
Add restconf binding parent pom

Contains the common stuff including checkstyle and findbugs.

Change-Id: I4629e897991c9ee3bf763208392cc54c56ccb0a5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix checkstyle violations in restconf-common 49/68549/4
Tom Pantelis [Fri, 23 Feb 2018 14:25:46 +0000 (09:25 -0500)]
Fix checkstyle violations in restconf-common

Change-Id: Ib57f7ba64c0804e2c3cdd81c264c0b2a80f24d5f
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoMerge "Convert netconf-util, netconf-ssh, netconf-tcp to blueprint"
JakubToth [Tue, 27 Feb 2018 19:48:28 +0000 (19:48 +0000)]
Merge "Convert netconf-util, netconf-ssh, netconf-tcp to blueprint"

6 years agoNETCONF-512: Add cases for missing NormalizedNode types 51/68651/2
Tom Pantelis [Sat, 24 Feb 2018 01:17:02 +0000 (20:17 -0500)]
NETCONF-512: Add cases for missing NormalizedNode types

ReadDataTransactionUtil.prepareData was missing cases for
LeafSetNode, OrderedLeafSetNode, OrderedMapNode and UnkeyedListNode.

Change-Id: Iaf44ce9b24044584e37d524835ec4a51843acd32
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoBump versions by x.(y+1).z for next dev cycle 42/68742/1
Anil Belur [Mon, 26 Feb 2018 07:41:44 +0000 (17:41 +1000)]
Bump versions by x.(y+1).z for next dev cycle

Change-Id: I5bc40f2e225853e1a98101ac8de0a5363d4677ea
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
6 years agoConvert netconf-util, netconf-ssh, netconf-tcp to blueprint 18/61718/9
Ryan Goulding [Tue, 24 Oct 2017 21:23:10 +0000 (17:23 -0400)]
Convert netconf-util, netconf-ssh, netconf-tcp to blueprint

netconf-util, netconf-ssh, and netconf-tcp still used a BundleActivator
and accompanying ServiceTracker for service instantiation.  netconf-ssh
and netconf-tcp depend on netconf-util for NetconfConfiguration, so it
was decided to do the conversion of all three bundles in one patch.

netconf-util utilizes blueprint-cm to instantiate NetconfConfiguration
based on the ManagedService identified by the "netconf" PID.

Tests that were aimed at testing bespoke Activator logic were removed,
since the accompanying Activators were removed.  ServiceTrackers were
removed in favor of bean references.  Scaffolding used to locate the
NetconfConfiguration ManagedService was also removed since it is now
directly referenced using blueprint.

JIRA: NETCONF-510
Change-Id: I27452ea509bc50333ffc00c6d1d8de3133e8b850
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoClosed nested JSON writers 69/67869/6
Stephen Kitt [Fri, 2 Feb 2018 15:57:30 +0000 (16:57 +0100)]
Closed nested JSON writers

With I9c597fe96937867cffdcbeeddd4b1507de20f2ee,
JSONNormalizedNodeStreamWriter.createNestedWriter() leaves it up to
the caller to close the provided JsonWriter. This patch ensures that
that is the case.

Change-Id: If20a596db06e40d1636de168dd11677372964364
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit b6be299466349d775d860ab45d785028e6b899f7)

6 years agoModify NetconfKeystoreAdapter to expose private keys and certificates 00/68000/10
LiGuosheng [Wed, 7 Feb 2018 08:24:56 +0000 (16:24 +0800)]
Modify NetconfKeystoreAdapter to expose private keys and certificates

Supply a method of using private keys and trusted certificates to
create JDK KeyStore. Improve code and test cases.

Change-Id: I56dff8cec16eeb320b4765a5d8c5bd3ffe562556
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoFix root data node QName equality check 22/68422/1
Igor Foltin [Tue, 20 Feb 2018 09:30:52 +0000 (10:30 +0100)]
Fix root data node QName equality check

This fixes the http error status 500 when trying to read
the whole mounted datastore using the new restconf
implementation based on RFC8040.

When serializing a NormalizedNode that represents
the data root we need to serialize only its children.

Change-Id: Ia87ea7d5244199680f528901ce85f9b78f9d5e3e
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoClean up NetconfHelloMessage 04/68204/3
Robert Varga [Tue, 13 Feb 2018 18:23:20 +0000 (19:23 +0100)]
Clean up NetconfHelloMessage

- do not invoke toString() during message checking
- use UntrustedXML directly to instantiate documents
- use Optional.fromNullable()
- Invert equality calls, making sure we invoke them on constants
- eliminate the need to catch DocumentedException

Change-Id: I6bb2165cc7b0644c5236e4c5967b03915d978e3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix a NetconfDocumentedException warning 05/68205/3
Robert Varga [Tue, 13 Feb 2018 18:25:07 +0000 (19:25 +0100)]
Fix a NetconfDocumentedException warning

Exceptions are serializable, hence thei need a version.

Change-Id: I3fcc125fc5bbd0ce661ce5ec2c63ffd5c0094d7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDepend on odl-config-util 09/68209/3
Robert Varga [Tue, 13 Feb 2018 19:30:32 +0000 (20:30 +0100)]
Depend on odl-config-util

Rather than packaging config-util in this project, rely on packaging
provided by controller.

JIRA: NETCONF-508
Change-Id: I156ca6948ac4db5bc1ac977b3cdfa98259c12c55
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoNETCONF-509: no-input RPCs should use RestconfDocumentedException 71/68271/1
Evan Zeller [Wed, 14 Feb 2018 23:15:41 +0000 (15:15 -0800)]
NETCONF-509: no-input RPCs should use RestconfDocumentedException

When invoked with an "input" value currently the implementation throws
IllegalStateException up to the servlet container which results in the
ugly jetty default error page and reveals stack trace information.
Provide a clear message that the invoked RPC should not take any input values.

Change-Id: Id13499b80bed9a2ea7666a3aa6d775da341055ab
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
6 years agoDon't include stacktraces in REST responses 39/67439/6
Evan Zeller [Mon, 22 Jan 2018 20:12:38 +0000 (12:12 -0800)]
Don't include stacktraces in REST responses

OWASP best practices recommend user facing error messages should not
contain stack traces or line numbers. The full stack trace should still be available in karaf.log.

Change-Id: Ia8ffed91ecdbf8a1d299c90c33882bbc18d55b50
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
6 years agoFix odl-restconf-noauth packaging yangtools bundle 84/68184/1
Robert Varga [Tue, 13 Feb 2018 12:49:37 +0000 (13:49 +0100)]
Fix odl-restconf-noauth packaging yangtools bundle

Depend on the corresponding feature and cleanup versions.

Change-Id: Ic3086cab94515b6c508cacc472ddc7095a51436c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge "NETCONF-506: fix YII deserialization in FilterContentValidator"
JakubToth [Sat, 10 Feb 2018 00:10:54 +0000 (00:10 +0000)]
Merge "NETCONF-506: fix YII deserialization in FilterContentValidator"

6 years agoAdd test cases for NetconfSalKeystoreService 54/67954/4
LiGuosheng [Tue, 6 Feb 2018 11:39:59 +0000 (19:39 +0800)]
Add test cases for NetconfSalKeystoreService

Test cases for adding private keys and trusted certificates into
the keystore.

Change-Id: I493e3f88e636ee7c53363e1cbf54ba6c1714d156
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoNETCONF-506: fix YII deserialization in FilterContentValidator 43/67743/4
Marek Gradzki [Tue, 30 Jan 2018 19:27:17 +0000 (20:27 +0100)]
NETCONF-506: fix YII deserialization in FilterContentValidator

Treat leafref keys in the same way as indentityref keys.
Follows https://git.opendaylight.org/gerrit/#/c/53996/

See also NETCONF-384.

Change-Id: I36a67b12e23c7da43f4e5c6002de8ae031d18e6a
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
6 years agojira NETCONF-489 Add TLS support for connecting to a netconf device 11/67711/3
LiGuosheng [Tue, 30 Jan 2018 09:35:11 +0000 (17:35 +0800)]
jira NETCONF-489 Add TLS support for connecting to a netconf device

The X.509 certificate yang model definition and rpc implementation.

Change-Id: Ic125707f80a23f21e183fa732adfb0083f853bca
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoNETCONF-505: fix decoding of URLs with external leafref 23/67723/1
Marek Gradzki [Tue, 30 Jan 2018 11:45:07 +0000 (12:45 +0100)]
NETCONF-505: fix decoding of URLs with external leafref

Use mount point schema rather than global.

Change-Id: Id386bc462961b42103cf0e3f2e984f4e034bba76
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
6 years agoNETCONF-502: Use GSON for swagger serdes 81/67581/3
Ryan Goulding [Thu, 25 Jan 2018 16:09:48 +0000 (11:09 -0500)]
NETCONF-502:  Use GSON for swagger serdes

This utilized the GsonProvider currently in AAA to do serdes
for odl-mdsal-apidocs.  This will not pass until the
subsequent AAA patches are merged.

Change-Id: Iba67d65b3f72f26f0507b62327a41e570fc3cea4
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoMerge "Add missing 'Path' annotations in jax-rs implementations for REST services"
JakubToth [Thu, 25 Jan 2018 23:14:06 +0000 (23:14 +0000)]
Merge "Add missing 'Path' annotations in jax-rs implementations for REST services"

6 years agoodl-restconf-nb-rfc8040-noauth depends on odl-yangtools-export 71/67571/1
Robert Varga [Thu, 25 Jan 2018 14:30:31 +0000 (15:30 +0100)]
odl-restconf-nb-rfc8040-noauth depends on odl-yangtools-export

Rather than pulling in dependency bundle, make sure we reference
the correct feature in which it is packaged.

Change-Id: I1b61b12655217cbee44ea82a8401b90523c63206
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoDrop references to object-cache 70/67570/1
Robert Varga [Thu, 25 Jan 2018 14:20:31 +0000 (15:20 +0100)]
Drop references to object-cache

object-cache artifacts are experimental and not used anymore,
drop them from netconf features.

Change-Id: Ife39dfd2fb7dc967745b810f52472d3fd94c2220
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd missing 'Path' annotations in jax-rs implementations for REST services 68/67568/1
Igor Foltin [Thu, 25 Jan 2018 12:55:06 +0000 (13:55 +0100)]
Add missing 'Path' annotations in jax-rs implementations for REST services

Change-Id: I1d666b4ea2017f79adf079fe76dcf8827516f8b1
Signed-off-by: Igor Foltin <igor.foltin@pantheon.tech>
6 years agoNETCONF-501: Remove feature prerequisite 67/67367/4
Luis Gomez [Sat, 20 Jan 2018 00:06:04 +0000 (16:06 -0800)]
NETCONF-501: Remove feature prerequisite

Change-Id: I8e18996cb2fe1d05bc07d30de160912eef3ca970
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
6 years agoNETCONF-494: use RFC7951 JSON codecs 51/67351/1
Robert Varga [Fri, 19 Jan 2018 14:31:17 +0000 (15:31 +0100)]
NETCONF-494: use RFC7951 JSON codecs

RFC8040 requires us to use a different codec for encoding instance
identifiers. Update the RFC8040 northbound to select this codec.

Also update the bierman02 northbound to explicitly bind to
the legacy LHOTKA codec.

Change-Id: I436e17b7c7695aaf75a27e7967b1bcfaf4815686
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMinimize yangtools dependencies and bump to 2.0.1 60/67260/2
Robert Varga [Wed, 17 Jan 2018 22:54:03 +0000 (23:54 +0100)]
Minimize yangtools dependencies and bump to 2.0.1

Squash dependencies so that netconf features are pulling in
the bare minimum set of yangtools features directly and use
version ranges for them.

Properties should be avoided and inter-project dependencies should
be expressed via ${upstream}-artifacts dependencyManagement import.

yangtools-2.0.1 contains a fix to multi-revision modules, which are
badly broken in 2.0.0. It also introduces APIs we require to fix
compliance with RFC8040 (i.e. follow RFC7159).

Change-Id: I0e0e63841d511123243560f166db50c2fc9270fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge "Clean up netconf-parent root pom"
Jakub Morvay [Fri, 12 Jan 2018 14:00:54 +0000 (14:00 +0000)]
Merge "Clean up netconf-parent root pom"

6 years agoAdjust to yangtools-2.0.0/odlparent-3.0.0 changes 02/64202/42
Robert Varga [Thu, 12 Oct 2017 12:33:55 +0000 (14:33 +0200)]
Adjust to yangtools-2.0.0/odlparent-3.0.0 changes

This also bumps sshd-core to 1.6.0, as that is what karaf ships
by default.

Change-Id: I064b1621bfa729c58e3b3ef6646787a6112301aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBump yangtools to 2.0.0 01/64201/14
Robert Varga [Thu, 12 Oct 2017 11:40:28 +0000 (13:40 +0200)]
Bump yangtools to 2.0.0

This bumps odlparent to 3.0.2 and yangtools to 2.0.0. Feature
references are updated so the reactor is consistent, build failures
are addressed in a follow-up patch.

Change-Id: I186d0900d361a3e33e779629f7ce60329fd61143
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoClean up netconf-parent root pom 84/66984/1
Ryan Goulding [Tue, 9 Jan 2018 16:44:11 +0000 (11:44 -0500)]
Clean up netconf-parent root pom

The root pom had some long running xml fields and other small
formatting issues.  Additionally, it introduced a profile that
was unused ("integrationtests").  I also cleaned up the modules
so that they are listed in alphabetic order.

Change-Id: I1ca3e40d7520fb1fc0cd5aa277c802db8d052275
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoBUG: jira NETCONF-493 ReconnectPromise throws IllegalStateException continuously 75/66775/3
李国胜10121395 [Wed, 27 Dec 2017 11:50:04 +0000 (19:50 +0800)]
BUG: jira NETCONF-493 ReconnectPromise throws IllegalStateException continuously

ReconnectPromise will execute method setFailure() more than once
if reconnecting to a netconf device failed more than once, and the
setFailure() method will start throwing IllegalStateException at
the second time invocation, so there should add limitation to the
call of setFailure() to avoid IllegalStateException.

Change-Id: I2d6802e6ac643215192527319d565da36a16caf5
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoBug jira NETCONF-492: netconf:list-devices throws a NullPointerException 61/66761/2
李国胜10121395 [Tue, 26 Dec 2017 03:06:27 +0000 (11:06 +0800)]
Bug jira NETCONF-492: netconf:list-devices throws a NullPointerException

When initiate a connection to a netconf device, the operational data store of this device
will be set to failure if the negotiation fails, but the write to the operational data
store just involve ConnectionStatus and ConnectedMessage, and this will cause
netconf:list-devices to throw a NullPointerException, and we can get nothing from this
command.

Change-Id: I64529d7408c315222b3ceabe4e2b2748038faa01
Signed-off-by: Li guosheng <li.guosheng6@zte.com.cn>
6 years agoAdded more configuration options for NetconfDeviceSimulator 74/66574/1
Juraj Veverka [Mon, 18 Dec 2017 20:48:33 +0000 (21:48 +0100)]
Added more configuration options for NetconfDeviceSimulator
- yang resourves loaded from classpath
- username / password AuthProvider
- public key authenticator
all changes are backwards compatible

Change-Id: Iba2c3106d456050ed84a2bbbaf1da2a227fa3566
Signed-off-by: Juraj Veverka <juraj.veverka@pantheon.tech>
6 years agoUsing writeAndFlush to response PingWebSocketFrame with PongWebSocketFrame, instead... 44/66044/2
HeYunBo [Wed, 29 Nov 2017 12:20:36 +0000 (20:20 +0800)]
Using writeAndFlush to response PingWebSocketFrame with PongWebSocketFrame, instead of write

Change-Id: Icc749f3a5255cf7385274dd546251160bcd0f8aa
Signed-off-by: HeYunBo <he.yunbo@zte.com.cn>
6 years agoBUG-9160: fix ReadDataTransactionUtil creating two adapters 22/63122/6
wusandi [Thu, 14 Sep 2017 06:58:56 +0000 (14:58 +0800)]
BUG-9160: fix ReadDataTransactionUtil creating two adapters

It should not directly add all of NotificationListenerAdapter objects
for XML stream to the list of NotificationListenerAdapter for JSON stream.
And to fix it, just to concat them together instead of putting one to
another.

Change-Id: I2c8eedc04281f10ea6742db854309d8182b1966b
Signed-off-by: wusandi <wusandi@163.com>
6 years agoMerge "Support for patch command"
Tomas Cere [Thu, 30 Nov 2017 14:59:46 +0000 (14:59 +0000)]
Merge "Support for patch command"

6 years agoSupport for patch command 90/65690/5
Balaji Varadaraju [Sat, 18 Nov 2017 02:50:10 +0000 (20:50 -0600)]
Support for patch command

The internal JSON libary did not have support for HTTP PATCH command.
This patch provides the support for the PATCH command. Support is
provided in both deprecated and new RESTCONF libraries.

Change-Id: I2bb81fe46bab5ec49fac3bff156e04f9a1b7c227
Signed-off-by: Balaji Varadaraju <bvaradar@brocade.com>
6 years agoRemove duplicated schema service in provider 76/65876/1
Jakub Toth [Thu, 23 Nov 2017 23:14:50 +0000 (00:14 +0100)]
Remove duplicated schema service in provider

Change-Id: I24bc553e2b0bcff8c598d86fe0956bd4ff4f8cb2
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoFix harcoded port in location of streams 72/65872/2
Jakub Toth [Thu, 23 Nov 2017 14:46:06 +0000 (15:46 +0100)]
Fix harcoded port in location of streams

Change-Id: I449772b7233186f29df97a3968f65b19204f79ca
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoFix NPE when trying to download restconf provided yang files 04/65804/5
Tomas Cere [Tue, 21 Nov 2017 15:45:42 +0000 (16:45 +0100)]
Fix NPE when trying to download restconf provided yang files

Restconf throws a NPE when trying to download the provided yang files
due to using Module.getSource() which is deprecated an @Nullable.
Switch this to using DOMSchemaService.
This fixes the NPE only in the rfc8040 implementation,
draft02 still most likely has it.

Change-Id: Ic8fc94a26a1e29e037872dfdc16c97ef19fcf115
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
6 years agoAdd update method of handlers for REST services 58/65458/6
Jakub Toth [Sun, 12 Nov 2017 17:04:52 +0000 (18:04 +0100)]
Add update method of handlers for REST services

Change-Id: I64a7f7a47f43566a50839ce1a83ba0fdd4034ed9
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoFix KeyPairProvider initialization in NetconfSshServerProvider 63/65363/2
Marek Gradzki [Thu, 9 Nov 2017 12:49:00 +0000 (13:49 +0100)]
Fix KeyPairProvider initialization in NetconfSshServerProvider

As a side offect of https://git.opendaylight.org/gerrit/#/c/60138,
RSA private key is stored unencrypted on disk.

Without additional countermeasures this might not be a good idea.

This patch sets DEFAULT_PRIVATE_KEY_PATH to null which disables
key pair serialization.

Change-Id: Ibbf51f702bc47d768db16d6a3f406a1b2ec906fb
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
6 years agoMerge "Remove netconf-cli"
Tomas Cere [Thu, 9 Nov 2017 10:56:20 +0000 (10:56 +0000)]
Merge "Remove netconf-cli"

6 years agoMake ServicesWrapperImpl as argument in provider 54/65254/6
Jakub Toth [Tue, 7 Nov 2017 10:41:09 +0000 (11:41 +0100)]
Make ServicesWrapperImpl as argument in provider

Change-Id: Id491309eb0f1bc75337ace02072248f25d60a1b9
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoRemove netconf-cli 65/65265/1
Tomas Cere [Tue, 7 Nov 2017 13:42:36 +0000 (14:42 +0100)]
Remove netconf-cli

This was living in limbo for some time, I think it's time to say goodbye.
The overhead for keeping this buildable is a wasted effort I think, so remove this.

Change-Id: Icc45c9a78afa380c2e96ea373c02c47f644191a1
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoRestore the deprecated credentials name. 75/64875/2
Tomas Cere [Mon, 30 Oct 2017 11:40:59 +0000 (12:40 +0100)]
Restore the deprecated credentials name.

Renaming caused downstream breakage so restore the old name.

Change-Id: I835b178d8f62b1c693f81f11316eeb67c146bf8c
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoMerge "Remove the default loopback mount from the old connector feature"
Tomas Cere [Fri, 27 Oct 2017 14:43:25 +0000 (14:43 +0000)]
Merge "Remove the default loopback mount from the old connector feature"

6 years agoMerge changes from topic 'keyauth-refactor'
Tomas Cere [Fri, 27 Oct 2017 13:27:22 +0000 (13:27 +0000)]
Merge changes from topic 'keyauth-refactor'

* changes:
  BUG-9261: rename pair-id to key-id
  BUG-9262 Add rpc for remove-device
  BUG-9261: Move keystore to use Config datastore.
  Do not return null in RpcHandlerDefault
  BUG-9261: Add basic public key auth to testtool
  BUG-9261: Add credential handler for PublicKey auth
  BUG-9261: introduce netconf keystore service
  BUG-9261: introduce new Credential types

6 years agoRemove the default loopback mount from the old connector feature 97/64797/2
Tomas Cere [Fri, 27 Oct 2017 09:39:52 +0000 (11:39 +0200)]
Remove the default loopback mount from the old connector feature

This is conflicting in sft when two projects pull in the old feature
and the new clustered topology feature. Cfg subsystem should have no
users now so remove it.

Change-Id: I97819282f39af332fa78bf58cbb99321ffa79ae0
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9261: rename pair-id to key-id 01/64801/2
Tomas Cere [Fri, 27 Oct 2017 11:19:20 +0000 (13:19 +0200)]
BUG-9261: rename pair-id to key-id

Makes more sense since we are not dealing with pairs.

Change-Id: I3f15304506844a23232541703182c73a7256379d
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9262 Add rpc for remove-device 18/64718/2
Tomas Cere [Wed, 25 Oct 2017 13:57:00 +0000 (15:57 +0200)]
BUG-9262 Add rpc for remove-device

Change-Id: I0abb373b29e6c3e89b4b2c0b424782c57c70418e
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9261: Move keystore to use Config datastore. 58/64658/3
Tomas Cere [Tue, 24 Oct 2017 12:31:44 +0000 (14:31 +0200)]
BUG-9261: Move keystore to use Config datastore.

We want the keystore persisted since we want to keep the
configuration valid across restarts so keep this in the persisted ds.

Change-Id: I806271f4fac3b66113253616baeedae42784896c
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoDo not return null in RpcHandlerDefault 54/64654/3
Tomas Cere [Tue, 24 Oct 2017 11:59:41 +0000 (13:59 +0200)]
Do not return null in RpcHandlerDefault

Change-Id: I692a03a65e1bd8dbd471ec2756320d374e397261
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9261: Add basic public key auth to testtool 53/64653/3
Tomas Cere [Tue, 24 Oct 2017 11:14:20 +0000 (13:14 +0200)]
BUG-9261: Add basic public key auth to testtool

Adds public key authenticator that accepts every connection to
testtool.

Change-Id: I49e98613cf5fb5dc33c8ccb465cdc16044b33f5e
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9261: Add credential handler for PublicKey auth 52/64652/3
Tomas Cere [Thu, 19 Oct 2017 13:10:51 +0000 (15:10 +0200)]
BUG-9261: Add credential handler for PublicKey auth

Change-Id: I073188bede6fb592147da5891793cf84abced276
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9261: introduce netconf keystore service 51/64651/2
Tomas Cere [Thu, 19 Oct 2017 10:21:34 +0000 (12:21 +0200)]
BUG-9261: introduce netconf keystore service

Change-Id: I97e1e65029c339bd28557787841d485392cf9c44
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoMerge "Add missing flush() on buffered writer."
Tomas Cere [Wed, 25 Oct 2017 09:26:58 +0000 (09:26 +0000)]
Merge "Add missing flush() on buffered writer."

6 years agoBUG-9261: introduce new Credential types 50/64650/1
Tomas Cere [Tue, 17 Oct 2017 13:06:43 +0000 (15:06 +0200)]
BUG-9261: introduce new Credential types

Introduces credential types for:
  -encrypted passwords
  -unencrypted passwords
  -key-pair authentication

While keeping backwards compatibility with the old way of storing
credentials as a deprecated case.

Change-Id: Ifb7cfaa5284467639d6c0e1d8bac2b4b5876bedc
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoAdd missing flush() on buffered writer. 10/64610/1
Andrej Záň [Mon, 23 Oct 2017 14:02:07 +0000 (16:02 +0200)]
Add missing flush() on buffered writer.

Missing flush caused, that backing ByteArrayOutputStream was empty
and thus mounted resources was not showing up in apidoc.

Change-Id: I14445b9f85cea1918321e59519129e21cb37dd81
Signed-off-by: Andrej Záň <andrej.zan@pantheon.tech>
6 years agoTesttool functionality enhanced. User now may 55/64555/1
Juraj Veverka [Fri, 20 Oct 2017 07:39:53 +0000 (09:39 +0200)]
Testtool functionality enhanced. User now may
inject own implementation of NetconfOperationService
using configuration object.

Change-Id: I41ac6d807db56ee07fbfde9d9b5bb80e714b7ca2
Signed-off-by: Juraj Veverka <juraj.veverka@pantheon.tech>
6 years agoRemove explicit default super-constructor calls 52/64452/1
David Suarez [Wed, 18 Oct 2017 13:53:23 +0000 (15:53 +0200)]
Remove explicit default super-constructor calls

The default constructor is called by default (hence its name), no need
to call it explicitly.

Change-Id: I7ea6f1ab540b424f4812b8cfdea048a43a73f469
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoMerge "Fix some sonar/checkstyle issues"
Tomas Cere [Wed, 18 Oct 2017 11:11:24 +0000 (11:11 +0000)]
Merge "Fix some sonar/checkstyle issues"