Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

name: Python Quality Control

on: [push, pull_request]
on: [pull_request]

jobs:
build:
Expand All @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10" ]

steps:
- uses: actions/checkout@v2
Expand All @@ -22,6 +22,14 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get upgrade -y --no-install-recommends
sudo apt-get install -y libenchant-2-2
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-dev.txt
python3 -m pip install wheel
Expand All @@ -31,6 +39,7 @@ jobs:
pycodestyle --format=pylint setup.py archivist examples functests unittests
python3 -m pylint --rcfile=pylintrc setup.py archivist examples functests unittests
black archivist examples unittests functests
(cd docs && make clean && make html)
modified=$(git status -s | wc -l)
if [ $modified -gt 0 ]
then
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
build/
dist/
*egg-info/
.config/
.coverage
*,cover
htmlcov/
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile-builder
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
ARG VERSION=3.7
FROM python:${VERSION}-bullseye

# Note that any deps installed here must also be installed in the
# github actions workflow .github/workflows/python-package.yml
#
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install -y libenchant-2-2 \
&& apt-get autoremove \
&& apt-get autoclean \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt requirements-dev.txt /tmp/

RUN python3 -m pip install --upgrade pip \
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If your version of python3 is too old an error of this type or similar will be e
.. note::

ERROR: Could not find a version that satisfies the requirement jitsuin-archivist (from versions: none)
ERROR: No matching distribution found for jitsuiin-archivist
ERROR: No matching distribution found for jitsuin-archivist

Example
=============
Expand Down Expand Up @@ -233,7 +233,7 @@ Example Yaml Snippet
--------------------

This is an example of creating an asset and creating an event for that asset. The
yaml file consiste of a list of steps.
yaml file consists of a list of steps.

Each step consists of control parameters (specified in the 'step' dictionary) and
the yaml representation of the request body for an asset or event.
Expand All @@ -246,7 +246,7 @@ asset or event is confirmed before returning.
The name of the asset is important. The value of the name is carried forward for
every operation - in this case the name of the asset is 'radiation bag 1'.

Arguments to the archivist are ususally strings - in this example radioactive is
Arguments to the archivist are usually strings - in this example radioactive is
'true' which archivist will treat as a boolean.


Expand Down Expand Up @@ -340,4 +340,4 @@ A recommended minimum configuration would be:
Development
===========

For instructions on contributing to the RKVST SDK see DEVELOPMENT.md.
For instructions on contributing to the RKVST SDK see DEVELOPMENT.md.
2 changes: 1 addition & 1 deletion archivist/archivist.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def post_file(
path (str): e.g. v2/assets
fd : iterable representing the contents of a file.
mtype (str): mime type e.g. image/jpg
params (dict): dictiuonary of optional path params
params (dict): dictionary of optional path params

Returns:
dict representing the response body (entity).
Expand Down
2 changes: 1 addition & 1 deletion archivist/compliance_policy_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CompliancePolicyType(Enum):
COMPLIANCE_TYPE_UNDEFINED = 0
#: Time since specific event for specified period
COMPLIANCE_SINCE = 1
#: Unresolved event currently on asset (eg. vulnerability)
#: Unresolved event currently on asset (e.g. vulnerability)
COMPLIANCE_CURRENT_OUTSTANDING = 2
#: No unresolved events for longer than specified period
COMPLIANCE_PERIOD_OUTSTANDING = 3
Expand Down
2 changes: 1 addition & 1 deletion archivist/sboms.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __str__(self) -> str:
@staticmethod
def parse(data: Dict) -> Dict: # pragma: no cover
"""
parse the sbom and extract pertinent informtion
parse the sbom and extract pertinent information

Args:
data (dict): dictionary
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?= -W -b spelling
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
Expand Down
8 changes: 7 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
# ones.
extensions = [
"sphinx_rtd_theme",
"sphinxcontrib.spelling",
"sphinx.ext.autodoc",
"sphinx.ext.autosectionlabel",
"sphinx.ext.githubpages",
Expand Down Expand Up @@ -67,6 +68,11 @@
html_show_sphinx = False


spelling_lang='en_US'
spelling_word_list_filename='spelling_wordlist.txt'
spelling_show_suggestions=True
spelling_verbose=True

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand All @@ -77,4 +83,4 @@

html_css_files = [
'css/rkvst_theme.css',
]
]
2 changes: 1 addition & 1 deletion docs/create_asset.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _create_assetref:

Create Asset Eaxmple
Create Asset Example
.....................

.. literalinclude:: ../examples/create_asset.py
Expand Down
4 changes: 2 additions & 2 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ REST api (in any language):
creating the asset or event and a sophisticated retry and exponential backoff
algorithm will take care of everything.
* **list()** method: one can easily get an iterable of assets or events that
correspond to a particular signature. The list method is optimised for use in
loop (for a in srch.assets.list():...) but can easily be converted to a list
correspond to a particular signature. The list method is optimized for use in
loop (for a in arch.assets.list():...) but can easily be converted to a list
using the python list() function.
* simple **count()** method: one can easily get a count of assets or events that
correspond to a particular signature.
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Make changes in both places
sphinx~=4.4
sphinx-rtd-theme~=1.0
sphinxcontrib-spelling~=7.3

# Duplicate of stanza in ~/requirements.txt.
# Make changes in both places
Expand Down
2 changes: 1 addition & 1 deletion docs/runner/events_count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Events Count Story Runner YAML

:code:`asset_label` must match the :code:`asset_label` field of a previous creation step
(:code:`ASSETS_CREATE` or :code:`ASSETS_CREATE_IF_NOT_EXISTS`)
for which the authorised credentials have Event write access.
for which the authorized credentials have Event write access.

:code:`props`, :code:`attrs` and :code:`asset_attrs` are optional.

Expand Down
2 changes: 1 addition & 1 deletion docs/runner/events_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Events List Story Runner YAML

:code:`asset_label` must match the :code:`asset_label` field of a previous creation step
(:code:`ASSETS_CREATE` or :code:`ASSETS_CREATE_IF_NOT_EXISTS`)
for which the authorised Application Registration has Event write access
for which the authorized Application Registration has Event write access

If :code:`asset_label` is not set, data for all assets is output.

Expand Down
50 changes: 50 additions & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
api
appidp
args
boolean
comparator
config
cyclonedx
dataclass
dataclasses
dicts
ef
fd
fda
formatters
https
iam
instantiation
iterable
jinja
jitsuin
jpg
json
Khipus
kwargs
macclesfield
mimetype
onwards
params
sbom
sboms
sbomType
stdout
sublogger
subloggers
submodule
synsation
templated
templating
tessera
unittested
url
xml
xxxxxxx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
yaml
yyyyyyy
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
2 changes: 1 addition & 1 deletion functests/test_resources/door_entry_story.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ steps:
email: courts.paris.wavestonedas@iot.wavestone.com
display_name: Courts of Justice Paris Front Door machine credential
event_attributes:
arc_description: Door opened by authorised key card Access Card 2
arc_description: Door opened by authorized key card Access Card 2
arc_display_type: Door Open
arc_evidence: ARQC 0x12345678
arc_correlation_value: be5c8061-236d-4400-a625-b74a34e5801b
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ twine~=3.8
# must be kept in sync with this file.
sphinx~=4.4
sphinx-rtd-theme~=1.0
sphinxcontrib-spelling~=7.3

# analyze dependencies
pipdeptree~=2.2