python: support connecting with an interactive password prompt

That unique_ptr has to be hidden and not exported to Python because
pybind11 currently does not support "taking back" objects from Python's
ownership, and that's essentially what is needed for consuming a moved
unique_ptr. This means that we cannot really avoid that constructor
duplication in this context.

This patch comes with no test because so far, we have not used
password-based (well, kbdinteractive-based) authentication for NETCONF.

Here's how to use it, anyway:

 def auth(auth_name, instruction, prompt, echo):
     print(f'{auth_name}: {instruction}')
     if echo:
         return raw_input(prompt)
     else:
         return getpass.getpass(prompt)

 conn = nc.NetconfAccess(server=..., username=..., interactive_auth=auth)

Change-Id: Iee3be17b024869f3cdebfd8ef876c20e177def74
1 file changed
tree: c978cce8f830b9e6dc9c190d99ae88d2afed6c60
  1. .clang-format
  2. .gitmodules
  3. .zuul.yaml
  4. CMakeLists.txt
  5. Doxyfile.in
  6. LICENSE
  7. LICENSE.md
  8. README.md
  9. ci/
  10. cmake/
  11. docs/
  12. src/
  13. submodules/
  14. tests/
README.md

Console interface to NETCONF servers

This program provides an interactive console for working with YANG data. It can connect to NETCONF servers, and also talk to sysrepo locally.

Installation

For building, one needs:

Use an exact commit of any dependencies as specified in submodules/dependencies/*.

The build process uses CMake. A quick-and-dirty build with no fancy options can be as simple as mkdir build && cd build && cmake .. && make && make install.

Bug Reporting

Issue reporting and feature requests are welcome via Taiga.io.

Development

We are using Gerrit for patch submission, code review and Continuous Integration (CI). Development roadmap and planning happens over Taiga.io.

Credits

Copyright © CESNET, https://www.cesnet.cz/ . Portions copyright © Faculty of Information Technology, Czech Technical University in Prague, https://fit.cvut.cz/ . Most of the code was written by Václav Kubernát (CESNET, formerly FIT ČVUT) and Jan Kundrát (CESNET). The project is distributed under the terms of the Apache 2.0 license.