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), seetooling/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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| nuactiongui_legacy-0.1.0-cp314-none-any.whl | CPython 3.14 | none | any | Details |
| nuactiongui_legacy-0.1.0-cp313-none-any.whl | CPython 3.13 | none | any | Details |
| nuactiongui_legacy-0.1.0-cp312-none-any.whl | CPython 3.12 | none | any | Details |
| nuactiongui_legacy-0.1.0-cp311-none-any.whl | CPython 3.11 | none | any | Details |
| nuactiongui_legacy-0.1.0-cp310-none-any.whl | CPython 3.10 | none | any | Details |
Total release size: 1.4 MB
Release files / nuactiongui_legacy-0.1.0-cp314-none-any.whl
| Download URL | nuactiongui_legacy-0.1.0-cp314-none-any.whl |
|---|---|
| Size | 366.6 kB |
| Tags | CPython 3.14 |
|
SHA-256 checksum How to use checksums |
186e093e46d3200366136191466ad1f25a85b1289c99639d7f20c727c2907ec5
|
|
BLAKE2b-256 checksum How to use checksums |
92c8d05a0bec2fb656002e0f5f725f3d111b1b521ebf9588cd7478f0de6a5bc8
|
| 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.0-cp313-none-any.whl
| Download URL | nuactiongui_legacy-0.1.0-cp313-none-any.whl |
|---|---|
| Size | 279.3 kB |
| Tags | CPython 3.13 |
|
SHA-256 checksum How to use checksums |
e535ba5d7b0991a25f3d710a469142c1b666c0815ae665f3375ffec4a4f25abc
|
|
BLAKE2b-256 checksum How to use checksums |
4bb2b3d68f443e46a0fe5c66186c553d59d912e508a26bbfd24aa4812e3b82fd
|
| 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.0-cp312-none-any.whl
| Download URL | nuactiongui_legacy-0.1.0-cp312-none-any.whl |
|---|---|
| Size | 276.1 kB |
| Tags | CPython 3.12 |
|
SHA-256 checksum How to use checksums |
7b64ff0db9d291c9bb3ed11d7105dc1dd7969a667f512335b560dc66179e74f9
|
|
BLAKE2b-256 checksum How to use checksums |
925ec6322dfe4c9b35e2ab8475c96ad0ef3d05de60b87420ec45c4147d72c1fd
|
| 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.0-cp311-none-any.whl
| Download URL | nuactiongui_legacy-0.1.0-cp311-none-any.whl |
|---|---|
| Size | 285.4 kB |
| Tags | CPython 3.11 |
|
SHA-256 checksum How to use checksums |
e79d6cb870858955c26973f10b7b376998d5591d7809a3e17482b898b95eae8c
|
|
BLAKE2b-256 checksum How to use checksums |
bcb489d30d70d456d00e54028865c903f9c6857b2f6e39e04c391315a73e5e48
|
| 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.0-cp310-none-any.whl
| Download URL | nuactiongui_legacy-0.1.0-cp310-none-any.whl |
|---|---|
| Size | 219.1 kB |
| Tags | CPython 3.10 |
|
SHA-256 checksum How to use checksums |
9b1ee6130ec13e4e866ed4f4a1e8604212464321fb0442695f899b5198dc946b
|
|
BLAKE2b-256 checksum How to use checksums |
fa38bf2be16d26b97dd35ed4306a5d12fd249d043fa62224adffa5ebd5d6be71
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|