netconf.git
6 years agoUpdate .gitreview to stable/oxygen 07/68707/1
Anil Belur [Mon, 26 Feb 2018 06:59:45 +0000 (16:59 +1000)]
Update .gitreview to stable/oxygen

Change-Id: I68819e98b43d5653babd67fed6ec04cad83e73db
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
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"

6 years agoFix some sonar/checkstyle issues 17/64417/2
David Suarez [Tue, 17 Oct 2017 17:40:53 +0000 (19:40 +0200)]
Fix some sonar/checkstyle issues

Change-Id: Id38d1e320f68ca12625dedfc19ea81cd81ea3005
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoRemove deprecated CheckedFuture from callhome-provider module 25/64425/1
David Suarez [Tue, 17 Oct 2017 22:02:53 +0000 (00:02 +0200)]
Remove deprecated CheckedFuture from callhome-provider module

Some other changes regarding checkstyle, sonar and annotations.

Change-Id: I361e2fc1928620ac1ed178f77beb397d5110a761
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoMerge changes from topic 'ListenerAdapterTreeMigration'
Tomas Cere [Mon, 16 Oct 2017 08:39:28 +0000 (08:39 +0000)]
Merge changes from topic 'ListenerAdapterTreeMigration'

* changes:
  Transition ListenerAdapter to ClusteredDOMDataTreeListener
  Add unit tests for ListenerAdapter

6 years agoTransition ListenerAdapter to ClusteredDOMDataTreeListener 64/63264/14
Josh [Tue, 19 Sep 2017 07:42:39 +0000 (10:42 +0300)]
Transition ListenerAdapter to ClusteredDOMDataTreeListener

Solves this: https://bugs.opendaylight.org/show_bug.cgi?id=9147
This is in general an issue with ListenerAdapter which does not
currently work in a clustered deployment.

ListenerAdapterTest needed to be adjusted for two reasons:
1. There was a bug in ListenerAdapter where if leafNodesOnly
was set the leafNodesOnly logic was not applied in delete
notifications. The new ListenerAdapter code fixes that so
ListenerAdapterTest needed to be adjusted.
2. In DomDataTreeEtc, merge operations cause the key node
to count as "WRITE"-en for notifications even if it was not
changed. ListenerAdapterTest was adjusted accordingly. Bug
for this here: https://bugs.opendaylight.org/show_bug.cgi?id=9179

Change-Id: I3c40e02551d8f04354489e5ffb8c66f111bb3b96
Signed-off-by: Josh <jhershbe@redhat.com>
6 years agoAdd unit tests for ListenerAdapter 03/63203/6
Josh [Sun, 17 Sep 2017 12:16:51 +0000 (15:16 +0300)]
Add unit tests for ListenerAdapter

Test that json generated by ListenerAdapter is correct
for regular notifications and "leaf nodes only" notifications.

Change-Id: I62fa22b1e30ca6a8632b3d2614558e9ced0abf54
Signed-off-by: Josh <jhershbe@redhat.com>
6 years agoFix augmentation node lookup 37/64237/2
Robert Varga [Fri, 13 Oct 2017 09:00:03 +0000 (11:00 +0200)]
Fix augmentation node lookup

This fixes an issue where we erroneously checked instanceof
against optional rather than its content -- which is obviously
wrong.

Change-Id: I1b60d35c5ca85444fd7f6595606e82f72f06f1d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoImport MappingCheckedFuture from mdsal 00/64200/1
Robert Varga [Thu, 12 Oct 2017 12:31:11 +0000 (14:31 +0200)]
Import MappingCheckedFuture from mdsal

yangtools is getting rid of this class, import it from its new home
in mdsal.

Change-Id: Iff6f19893816ac576faaaaef0d62295341b8c842
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge "Bug 9256: Add websocket server config knob for ip"
Tomas Cere [Thu, 12 Oct 2017 10:18:08 +0000 (10:18 +0000)]
Merge "Bug 9256: Add websocket server config knob for ip"

6 years agoMerge "BUG 9112: NPE in karaf cli when device is still connecting"
Tomas Cere [Thu, 12 Oct 2017 10:17:57 +0000 (10:17 +0000)]
Merge "BUG 9112: NPE in karaf cli when device is still connecting"

6 years agoMerge "BUG-9048 Fix actor crash when writing incorrect data"
Tomas Cere [Thu, 12 Oct 2017 10:17:48 +0000 (10:17 +0000)]
Merge "BUG-9048 Fix actor crash when writing incorrect data"

6 years agoMerge "NetConf test tool improved so now it can be used as library not only as CLI...
Tomas Cere [Wed, 11 Oct 2017 13:37:37 +0000 (13:37 +0000)]
Merge "NetConf test tool improved so now it can be used as library not only as CLI tool."

6 years agoMerge "Replace deprecated Futures.addCallback by the newer version"
Tomas Cere [Wed, 11 Oct 2017 12:54:32 +0000 (12:54 +0000)]
Merge "Replace deprecated Futures.addCallback by the newer version"

6 years agoNetConf test tool improved so now it can be 58/64158/4
Juraj Veverka [Wed, 11 Oct 2017 11:27:58 +0000 (13:27 +0200)]
NetConf test tool improved so now it can be
used as library not only as CLI tool.

Change-Id: I14ca03d0b2cec0f6fe8b5994b3e195fa6de8a4d2
Signed-off-by: Juraj Veverka <juraj.veverka@pantheon.tech>
6 years agoRemove unnecessary bouncycastle dependencies 55/63955/3
Ryan Goulding [Wed, 4 Oct 2017 17:13:25 +0000 (13:13 -0400)]
Remove unnecessary bouncycastle dependencies

These are provided through the JRE's JCE, and should logically be
thought of as being provided through by the underlying environment
rather than direct dependencies.  This removes the places where
the dependency exists but is not needed.

Change-Id: I5c68f138d94db678aa77fba3ca645b50232dd757
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoBug 9256: Add websocket server config knob for ip 09/64109/2
Tomas Cere [Tue, 10 Oct 2017 08:50:57 +0000 (10:50 +0200)]
Bug 9256: Add websocket server config knob for ip

Also cleans up a couple of ugly NPE catches.

Change-Id: Ifd164aa76c406cc2082d603df8732d636f6e06a1
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBUG-9218: pull odl-mdsal-model-inventory 88/64088/1
Robert Varga [Mon, 9 Oct 2017 18:45:30 +0000 (20:45 +0200)]
BUG-9218: pull odl-mdsal-model-inventory

Rather than packaging controller's model, use if from the upstream
feature.

Change-Id: I41a1bc09beaed3b1caa8acc33807f29a59d2eb36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoReplace deprecated Futures.addCallback by the newer version 50/64050/1
David Suarez [Mon, 9 Oct 2017 08:21:47 +0000 (10:21 +0200)]
Replace deprecated Futures.addCallback by the newer version

The method addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback) is deprecated and will be replaced
by a new its new version addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback, Executor executor) in April 2018.

Some other minor changes to pass the new version of checkstyle.

Change-Id: I0aaf43e913ab241fd74e53ff91d7852e77b699b3
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoBUG 9112: NPE in karaf cli when device is still connecting 21/64021/1
Tomas Cere [Fri, 6 Oct 2017 13:07:13 +0000 (15:07 +0200)]
BUG 9112: NPE in karaf cli when device is still connecting

Change-Id: I753e1870ce5b86535163e43acd4a20b5f4d83df5
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoMerge "Directly inject CredentialAuth dependency"
Tomas Cere [Fri, 6 Oct 2017 11:50:43 +0000 (11:50 +0000)]
Merge "Directly inject CredentialAuth dependency"

6 years agoBUG-9048 Fix actor crash when writing incorrect data 08/63608/4
Tomas Cere [Wed, 27 Sep 2017 10:49:02 +0000 (12:49 +0200)]
BUG-9048 Fix actor crash when writing incorrect data

We need to catch all unechecked exceptions when writing data
in the clustered implementation since these will crash the actor
running and cause problems down the line.

Change-Id: Ib9d243d1db0f6e29e55c97f794a122f307420055
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoDirectly inject CredentialAuth dependency 16/61716/13
Ryan Goulding [Mon, 14 Aug 2017 19:48:46 +0000 (15:48 -0400)]
Directly inject CredentialAuth dependency

In today's blueprint-oriented OSGi DI, it is more efficient to
express the dependency on AAA's CredentialAuth API rather than to
spin waiting for a ServiceReference using a ServiceTracker.  This
change specifies direct injection of AAA's CredentialAuth Service
through blueprint wiring.

Change-Id: Iec02f8acc4763922505881a772ff128f1f9d9986
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
6 years agoBUG-9218: fix features to not duplicate upstream bundles 45/63845/3
Robert Varga [Fri, 29 Sep 2017 09:53:39 +0000 (11:53 +0200)]
BUG-9218: fix features to not duplicate upstream bundles

Restructures dependencies to pull in upstream features which
provide the bundles we need.

Change-Id: I7e1cf306abd100a1a50cc4248de78d85dc91df9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ccce725613d3078a0ad18f3f8fbfa5e1d9aea68c)

6 years agoBUG-9132: don't provide a value for restconf/streams/events 54/63854/1
Evan Zeller [Thu, 28 Sep 2017 01:15:31 +0000 (18:15 -0700)]
BUG-9132: don't provide a value for restconf/streams/events

The yang type of events leaf is 'type empty', meaning there should be no value.
As of Carbon performing a GET on restconf/streams causes a cast
exception due to the empty string value here. See EmptyJSONCodec in
yangtools.

Change-Id: If0501b9c5459f4255096a4f070968c87a749407e
Signed-off-by: Evan Zeller <evanrzeller@gmail.com>
6 years agoBump odlparent 2.0.4 to 2.0.5 22/63622/2
Stephen Kitt [Wed, 27 Sep 2017 13:34:28 +0000 (15:34 +0200)]
Bump odlparent 2.0.4 to 2.0.5

Change-Id: I8ec7b8adcc7f2805e0a214ac3aee64368df40291
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoBump netconf to use yangtools 1.2.0 62/63762/7
Anil Belur [Thu, 28 Sep 2017 07:40:31 +0000 (17:40 +1000)]
Bump netconf to use yangtools 1.2.0

Also reverts I1914426b96029d7d2377f77b9f7df8beb14e607a to downgrade
yangtools properly.

Jira: releng-485
Change-Id: Ie344af870af6a85e859b1e35ca268f5bf988b00b
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMerge "Adjust test-tool to yangtools changes"
Tomas Cere [Wed, 27 Sep 2017 16:15:25 +0000 (16:15 +0000)]
Merge "Adjust test-tool to yangtools changes"

6 years agoAdjust test-tool to yangtools changes 18/63618/1
Jakub Morvay [Wed, 27 Sep 2017 13:10:47 +0000 (15:10 +0200)]
Adjust test-tool to yangtools changes

yang-maven-plugin adds revision to packaged yang file name. Netconf
test-tool should register yang resources with valid filenames, i.e
name@revision.yang, when preparing for assembly of its schema context.

Change-Id: I1914426b96029d7d2377f77b9f7df8beb14e607a
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
6 years agoAdd local MultivaluedHashMap implementation 53/63053/3
Tom Pantelis [Tue, 12 Sep 2017 16:03:00 +0000 (12:03 -0400)]
Add local MultivaluedHashMap implementation

The JSONRestconfService implementation contains a local UriInfo
implementation, SimpleUriInfo, that uses a MultivaluedHashMap
implementation from javax.ws.rs.core. This class is provided by
the dependency used at compile time however, the runtime bundle
that provides the javax.ws.rs.core interfaces doesn't provide
MultivaluedHashMap. Therefore I added our own local MultivaluedHashMap
class based on the external class. I also refactored SimpleUriInfo into
it's own class as it's used by both JSONRestconfService implementations.

Change-Id: I1af0771327d46c72e55facf14c41038fd583e0ed
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoMinor cleanup of blueprint config 00/63500/1
Atul Gosain [Tue, 22 Aug 2017 00:46:01 +0000 (17:46 -0700)]
Minor cleanup of blueprint config

The path for private file was left here due to which the netconf module
looks for the private key file and shows error in the log which is a false alarm.
Cleaning up the configuration

Change-Id: Ied9cc137ab67cab158318a6c2f34da19dc174fe0
Signed-off-by: Atul Gosain <atul.gosain@gmail.com>
Signed-off-by: Atul Gosain <agosain@brocade.com>
6 years agoRPC for netconf node addition. Supports encrypt option for password encryption. 78/62678/8
Atul Gosain [Fri, 21 Jul 2017 04:44:33 +0000 (21:44 -0700)]
RPC for netconf node addition. Supports encrypt option for password encryption.

Change-Id: I34beb880cbe2ccc6a3fe8e5f6cd4253f7e1938f4
Signed-off-by: Atul Gosain <atul.gosain@gmail.com>
Signed-off-by: Atul Gosain <agosain@brocade.com>
6 years agoMerge "Bug 8988 - Check for empty payload properly"
Tomas Cere [Thu, 21 Sep 2017 08:56:56 +0000 (08:56 +0000)]
Merge "Bug 8988 - Check for empty payload properly"

6 years agoEnable public key based authentication for netconf 77/62677/5
Atul Gosain [Tue, 27 Jun 2017 02:13:26 +0000 (19:13 -0700)]
Enable public key based authentication for netconf

Change-Id: Icca97924515537b670688767d41ddd4bd6e1bbf6
Signed-off-by: Atul Gosain <agosain@brocade.com>
6 years agoBUG 8839: Revert "Make netconf utilize encrypted passwords only" 76/62676/5
Tomas Cere [Tue, 11 Jul 2017 14:57:59 +0000 (14:57 +0000)]
BUG 8839: Revert "Make netconf utilize encrypted passwords only"

This reverts commit 1867bf17d781f21473dabcde2ad3f85b9b1defc6.

Change-Id: Ia5d97c118d805bdeff9e47f466a9ec64b58c03ca
Signed-off-by: Tomas Cere <tcere@cisco.com>
6 years agoBug 8988 - Check for empty payload properly 55/63055/4
Jakub Morvay [Tue, 12 Sep 2017 14:48:23 +0000 (16:48 +0200)]
Bug 8988 - Check for empty payload properly

Do not use InputStream#avalaible method to check for empty payload's
input streams in our implementations of MessageBodyReader interface.
InputStream#avalaible method returns an estimate of the number of bytes
that can be read from input stream without blocking. We cannot be sure
the stream is actually empty, even if this method returns 0.

Wrap the payload's input stream in PushbackInputStream and try to read
and unread from it instead.

Change-Id: I43b3a8d837f3dc4bc59d7cc2db29ffa06786844f
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
6 years agoAdjust tests for yangtools changes 02/63302/2
Jakub Morvay [Tue, 19 Sep 2017 20:57:23 +0000 (22:57 +0200)]
Adjust tests for yangtools changes

yang-maven-plugin now adds revision to the packaged yang file name.
This is introduced in https://git.opendaylight.org/gerrit/#/c/62706/.
Adjust NetconfMappingTest and NetconfMDSalMappingTest to that.

https://git.opendaylight.org/gerrit/#/c/62731/ enforces revisions to be
in valid yyyy-MM-dd format. Adjust Restconf tests to this change.

Change-Id: I00372ee98b15d3194c8a8567a041f24f161d7276
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
6 years agoSplit Restconf implementations (draft02 and RFC) - features 20/62920/8
Jakub Toth [Fri, 8 Sep 2017 16:27:32 +0000 (18:27 +0200)]
Split Restconf implementations (draft02 and RFC) - features

  * remove restconf rfc8040 implemetation from bierman02
  * add features for restconf-nb-rfc8040

Change-Id: I96110d0721c39acdc88332e748f81de07fd5663d
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoSplit Restconf implementations (draft02 and RFC) - Application 19/62919/9
Jakub Toth [Fri, 8 Sep 2017 12:02:11 +0000 (14:02 +0200)]
Split Restconf implementations (draft02 and RFC) - Application

  * add blueprint + web.xml for restconf-nb-rfc8040

Change-Id: Ifd8ea387ace5580ddd36dde59000b7cd69515272
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoSplit Restconf implementations (draft02 and RFC) - providers tests 72/62872/7
Jakub Toth [Thu, 7 Sep 2017 22:26:11 +0000 (00:26 +0200)]
Split Restconf implementations (draft02 and RFC) - providers tests

Change-Id: If8c26aa059508763e4730d69d9b64f594ec9e302
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoSplit Restconf implementations (draft02 and RFC) - move providers 71/62871/6
Jakub Toth [Thu, 7 Sep 2017 21:49:11 +0000 (23:49 +0200)]
Split Restconf implementations (draft02 and RFC) - move providers

Change-Id: Iab075f8d91001a646783f35aa5fe1550d811d01b
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoSplit Restconf implementations (draft02 and RFC) - tests 55/62855/7
Jakub Toth [Thu, 7 Sep 2017 16:27:41 +0000 (18:27 +0200)]
Split Restconf implementations (draft02 and RFC) - tests

Change-Id: I4e20a07ed96e63a1238ade12c7fc3377853ec211
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
6 years agoSplit Restconf implementations (draft02 and RFC) - move 54/62854/6
Jakub Toth [Thu, 7 Sep 2017 08:28:14 +0000 (10:28 +0200)]
Split Restconf implementations (draft02 and RFC) - move
sal-rest-connector

  * move Patch parts, RestUtil, RestconfSchemaUtil,
    RestconfValidationUtils, IdentityValuesDTO to common module
  * move packages from bierman02 to rfc8040:
    * /restconf/base/services/ ->
        /restconf/nb/rfc8040/services/simple
    * /restconf/common/wrapper/services ->
        /restconf/nb/rfc8040/services/wrapper
    * /restconf/common/references/ ->
        /restconf/nb/rfc8040/references
    * /restconf/handlers -> /restconf/nb/rfc8040/handlers
    * /restconf/parser -> /restconf/nb/rfc8040/utils/parser
    * /restconf/restful -> /restconf/nb/rfc8040/rests
    * /restconf/utils -> /restconf/nb/rfc8040/utils

Change-Id: I8259d69ab2378a25ddcf41d0b6f14dd65afc2507
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>