Skip to main content

NuActionGUI (legacy)

NuActionGUI compiles a data model (.dtm), a security model (.stm) and a privacy model (.ptm) — with OCL constraints — into a Flask web application whose every attribute read, update, association change, creation and deletion is checked against those models at run time.

This is the legacy toolchain, kept so that projects written against its model syntax keep building.

  • PyPI: nuactiongui-legacy · command line: nag-legacy · language server: nag-legacy-langserver
  • VSCode: NuActionGUI (legacy) (infsec.vscode-nag), see tooling/vscode-nag

Installation

python3 -m venv .venv && source .venv/bin/activate
pip install "nuactiongui-legacy[apps]"

The apps extra is the Flask stack the generated applications run on. It needs Python 3.10–3.13: Flask-User 1.0.2.2 / Werkzeug 2.2.2 call ast.Str, which 3.14 removed. The compilers, nag-legacy and the language server themselves run on 3.14 too (pip install nuactiongui-legacy without the extra) — nag-legacy --run says so if the interpreter is too new.

No Java is needed: the wheels ship the generated ANTLR parsers.

Usage

nag-legacy --new shop                 # scaffold models/shop/project.{dtm,stm,ptm}
nag-legacy -p shop -o output          # compile the models, generate output/shop
nag-legacy --run shop -o output       # run it (Flask dev server, http://127.0.0.1:5002)
nag-legacy -p shop -o output -re      # regenerate the model-derived files only,
                                      # keeping project.py, project_aux.py, templates, static

-p takes the folder holding the three model files, or a bare name looked up under ./models/<name>. All paths are relative to the current directory. -dm/-sm/-pm override the model file names (project.dtm etc.).

The distribution contains the toolchain only; no example models are bundled.

Errors, and what they mean for older models

Constraints are type-checked against the data model. A type error is fatal, is reported at the constraint, and says what to write instead. Three rules from the successor's OCL dialect are enforced here too — they are what changed for models written against the original toolchain:

Rule Rejected Write instead Message
-> is only for the collection operations self.replies.isEmpty() self.replies->isEmpty() 'isEmpty' is a collection operation: use '->'
. calls an operation, :: qualifies a name Person::allInstances() Person.allInstances() '::' cannot be used for method calls
Enum literals are qualified names Role.ADMIN Role::ADMIN '.' cannot be used for enum literals
Enum values have no attributes value.oclIsTypeOf(Role) and value.name <> 'VISITOR' value <> Role::VISITOR oclIsTypeOf() argument must be a class name; 'Role' is an enum …

The 41 collection operations reachable through -> are: any append asBag asOrderedSet asSequence asSet at collect collectNested count excludes excludesAll excluding exists first flatten forAll includes includesAll including indexOf insertAt intersection isEmpty isUnique iterate last notEmpty oclAsSet one prepend product reject select size sortedBy subOrderedSet subSequence sum symmetricDifference union. size and oclAsSet also work with . on a String / an object respectively.

Two things changed meaning rather than spelling — see the CHANGELOG: operator precedence now follows the OCL specification (a and b or c and d groups as (a and b) or (c and d)), and objects compare by identity, not by attribute values.

Repository layout

nuactiongui_legacy/        the package: cli, pipeline, dtm/stm/ptm compilers,
                           langserver, templates (package data), grammars
tests/                     compiler suites, golden generation tests, language server tests
tooling/vscode-nag/        the VSCode extension

Only nuactiongui_legacy/ is part of the PyPI distribution.

Development

pip install -e ".[apps,dev]"
export JAVA_HOME=$(/usr/libexec/java_home -v 26)   # the ANTLR tool needs a JDK >= 11
make grammars                                       # regenerate the parsers (guarded, see below)
make test                                           # everything
make dist check-dist test-dist                      # build, verify, install-and-boot per interpreter (3.10-3.14 installed; see RELEASING.md)

nuactiongui_legacy/grammars/OclExpression.g4 is a verbatim copy of the grammar of the pinned ocl-py release, and make grammars refuses to run unless the installed ocl-py and the grammar's digest match. This is not bookkeeping: the security and privacy grammars import that grammar, and a stm parser built from a mismatched one groups and/or differently from the OCL runtime — a silently wrong authorization decision. Bumping ocl-py is documented in RELEASING.md.

make test-generation pins every byte of the generated apps for the test models and the structure of every compiled constraint; a reviewed generator change is accepted with UPDATE_GOLDEN=1 make test-generation.

License

MIT — see LICENSE.

Metadata

Release files for nuactiongui-legacy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for nuactiongui-legacy 0.1.1
File
nuactiongui_legacy-0.1.1-cp314-none-any.whl CPython 3.14 none any Details
nuactiongui_legacy-0.1.1-cp313-none-any.whl CPython 3.13 none any Details
nuactiongui_legacy-0.1.1-cp312-none-any.whl CPython 3.12 none any Details
nuactiongui_legacy-0.1.1-cp311-none-any.whl CPython 3.11 none any Details
nuactiongui_legacy-0.1.1-cp310-none-any.whl CPython 3.10 none any Details

Total release size: 1.4 MB

Release files / nuactiongui_legacy-0.1.1-cp314-none-any.whl

Download URL nuactiongui_legacy-0.1.1-cp314-none-any.whl
Size 366.6 kB
Tags CPython 3.14
SHA-256 checksum
How to use checksums
9e89c6f9f92bc5c87b819cacace6a99252ab54a80b0f099bab3373ebebe2b4aa
BLAKE2b-256 checksum
How to use checksums
cbb16f98efac97c7802b7e04b814d1d2ac6bad9c864635899415baf19ca346d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / nuactiongui_legacy-0.1.1-cp313-none-any.whl

Download URL nuactiongui_legacy-0.1.1-cp313-none-any.whl
Size 279.3 kB
Tags CPython 3.13
SHA-256 checksum
How to use checksums
9914655b9f2ac838bbb1cdef2d92ee8478b1e4f6b24913d8f4324234bdd069b2
BLAKE2b-256 checksum
How to use checksums
2f980d5f7b4954b42e9412a2a661854106b5709797bebdfd90427e972999ac4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / nuactiongui_legacy-0.1.1-cp312-none-any.whl

Download URL nuactiongui_legacy-0.1.1-cp312-none-any.whl
Size 276.2 kB
Tags CPython 3.12
SHA-256 checksum
How to use checksums
c7f617a7b77e06ceb03ca231d9f2fa56b88c3b33e563118b736772fcc0fb459b
BLAKE2b-256 checksum
How to use checksums
aa5077d06148b8ffde1dff3cd2ca756bb6121943f7123332c9fa0c3974de8cc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / nuactiongui_legacy-0.1.1-cp311-none-any.whl

Download URL nuactiongui_legacy-0.1.1-cp311-none-any.whl
Size 285.5 kB
Tags CPython 3.11
SHA-256 checksum
How to use checksums
076311be971f777a9b203f15b5aacb0706b4c5c69c4f028f0376a335a4915571
BLAKE2b-256 checksum
How to use checksums
5d1b7f42db30d37f3ac9af18ba6056bb2b307711b5755938b90e44b77dba2b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / nuactiongui_legacy-0.1.1-cp310-none-any.whl

Download URL nuactiongui_legacy-0.1.1-cp310-none-any.whl
Size 219.1 kB
Tags CPython 3.10
SHA-256 checksum
How to use checksums
80b9a5bfe125c2317e712698a1fae9e1f8aa4670b16e9eca252a557e6c2c4396
BLAKE2b-256 checksum
How to use checksums
0cfa1dcd5607ef2eafdf2680dfe05b600b29f95411477f810859b66a4ba7480f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page