Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce authentication for zmq communications #56

Merged
merged 48 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
caa36c2
Refactor zmq pub and sub into a zmq backend
mraspaud Nov 29, 2023
49b74d3
Fix style
mraspaud Nov 29, 2023
f15cda3
Use python >= 3.10 for ci
mraspaud Nov 29, 2023
ae3c70b
Fix test
mraspaud Nov 29, 2023
66bd3e9
Fix NS tests
mraspaud Nov 29, 2023
268b78d
Fix style
mraspaud Dec 4, 2023
1b242fe
Merge branch 'main' into add-authentication
mraspaud Dec 6, 2023
acde61a
Merge branch 'main' into add-authentication
mraspaud Dec 6, 2023
b2e3df1
Fix style
mraspaud Dec 6, 2023
6a56d2d
Move everything zmq related to it's own backend
mraspaud Dec 6, 2023
a49f615
Fix style
mraspaud Dec 6, 2023
3af5719
Remove import of python 2 library
mraspaud Dec 6, 2023
d90341b
Allow passing interface to multicast on
mraspaud Dec 7, 2023
0c8141c
Add some docstrings
mraspaud Dec 7, 2023
38ed263
Improve documentation and style
mraspaud Dec 7, 2023
558166b
Refactor bbmcast a tad
mraspaud Dec 7, 2023
927277a
Switch one class to pytest
mraspaud Dec 7, 2023
2d0eb0d
Speed up some tests
mraspaud Dec 7, 2023
2afc51f
Refactor for adding secure implementations of pub and sub
mraspaud Feb 2, 2024
f3b0b3a
Add some tests
mraspaud Feb 19, 2024
435e2fa
Merge branch 'main' into add-authentication
mraspaud Apr 23, 2024
7a1f08d
Switch to pyproject.toml only
mraspaud Apr 23, 2024
ce0f72e
Update documentation
mraspaud Apr 23, 2024
8351a86
Refactor bbmcast tests
mraspaud Apr 23, 2024
3536cd0
Fix pyproject.toml
mraspaud Apr 23, 2024
ba3189c
Fix quotes
mraspaud Apr 23, 2024
87d73bd
Timeout in multicast test when not working
mraspaud Apr 23, 2024
59a620e
Make public and secret keys positional arguments
mraspaud Apr 24, 2024
01f7d91
Fix test
mraspaud Apr 24, 2024
8e47d1a
Improve tests
mraspaud Apr 25, 2024
720511f
Allow multicast-dependent tests to be skipped
mraspaud Apr 25, 2024
8295484
Fix linting issues
mraspaud Apr 25, 2024
a942d54
Refactor shared parts between secure and unsecure zmq
mraspaud Apr 25, 2024
10ee5cc
Fix subscriber settings dropping
mraspaud Apr 25, 2024
7f6eb9d
Fix tests
mraspaud Apr 25, 2024
c43ff9e
Fix backwards compatibility
mraspaud Apr 25, 2024
24b2c9a
Do not skip too much
mraspaud Apr 26, 2024
fb30354
Fix wait time
mraspaud Apr 26, 2024
7bc00e6
Refactor
mraspaud May 3, 2024
19fb35d
Clean up
mraspaud May 3, 2024
93c78e5
Rename
mraspaud May 14, 2024
c7b23ed
Rename
mraspaud May 14, 2024
6364282
Improve tests
mraspaud May 21, 2024
96dea2f
Add script for generating keys and documentation
mraspaud May 22, 2024
97b2f94
Fix style
mraspaud May 22, 2024
7a2633e
Change sphinx theme
mraspaud May 22, 2024
ca576b5
Fix sphinx theme
mraspaud May 22, 2024
c657b1c
Fix tests
mraspaud Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U pytest pytest-cov pyzmq netifaces donfig
pip install -U pytest pytest-cov pyzmq netifaces-plus donfig pytest-reraise
- name: Install posttroll
run: |
pip install --no-deps -e .
Expand Down
16 changes: 7 additions & 9 deletions bin/nameserver
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""The nameserver. Port 5555 (hardcoded) is used for communications.
"""
"""The nameserver. Port 5555 (hardcoded) is used for communications."""

# TODO: make port configurable.

from posttroll.ns import NameServer

import logging
import _strptime

from posttroll.ns import NameServer

logger = logging.getLogger(__name__)

if __name__ == '__main__':
if __name__ == "__main__":

import argparse

Expand All @@ -58,14 +56,14 @@ if __name__ == '__main__':
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter("[%(levelname)s: %(asctime)s :"
" %(name)s] %(message)s",
'%Y-%m-%d %H:%M:%S'))
"%Y-%m-%d %H:%M:%S"))
if opts.verbose:
loglevel = logging.DEBUG
else:
loglevel = logging.INFO
handler.setLevel(loglevel)
logging.getLogger('').setLevel(loglevel)
logging.getLogger('').addHandler(handler)
logging.getLogger("").setLevel(loglevel)
logging.getLogger("").addHandler(handler)
logger = logging.getLogger("nameserver")

multicast_enabled = (opts.no_multicast == False)
Expand Down
136 changes: 13 additions & 123 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,130 +1,20 @@
# Makefile for Sphinx documentation
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

# Put it first so that "make" without argument is like "make help".
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PostTroll.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PostTroll.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/PostTroll"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PostTroll"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: help Makefile

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading
Loading