# WP-DSO-Publish
## Operation
[Pyforms-based](https://pyforms-gui.readthedocs.io/en/v4/index.html) GUI that publishes to safe two workflow policies (one for Research and Infrastructure Approval, respectively) and a dataset policy that requires that both are satisfied prior to granting access (via [Presidio](https://github.com/RENCI-NRIG/impact-presidio)). This is consistent with SAFE ImPACT [MVP example](https://github.com/RENCI-NRIG/impact-docker-images/tree/master/safe-server/1.0.1).
Requires Python3 and pip3. Install the package into a virtualenvironment (it should pull in all the dependencies): `bash $ mkvirtualenv wpdso (wpdso) $ pip install wp-dso-publish `
Running it as as simple as (it should be on the PATH by now) `bash (wpdso) $ wp-dso-publish.py `
The GUI presents two tabs - one with identifiers for the two workflows and the dataset, one with SAFE parameters. Identifiers can either be filled in or auto-generated (GUIDs) using the ‘Generate button’. SAFE server base URL is automatically filled in. SAFE public key name for the dataset owner principal must also be specified (typically has the .pub extension) via file browser.
Warning: the public key pointed to must be one of the keys accessible to the SAFE server you are communicating with (i.e. in its -kd key directory), otherwise you will get a Selfie error as follows: `bash Error: POST failed due to error: Query failed with msg: safe.safelog.UnSafeException: cannot sign since principal (Selfie) not defined Set(StrLit(Self)) `
Once all parameters are filled in, press the ‘Push Combined Policy to SAFE’ button and inspect the outcome.
If everything went according to plan, cut-and-paste the workflow identifiers when registering the workflows with the Notary Service. Similarly cut-and-paste the dataset identifier when registering the dataset.
## Saving settings
The app relies on confapp module to restore settings in the form of Python code from a file named ‘saved-settings.py’, if it exists. Any filled in settings are saved when ‘Saved Settings’ button is pressed and then automatically restored when the program is restarted next time. The file can be edited by hand if needed. The following parameters (as strings) need to be defined (example): ` RESEARCH_APPROVAL_ID = '53f8e808-5d91-4eff-8ecf-ab7d2dcda4d3' INFRASTRUCTURE_APPROVAL_ID = 'cf6d4ef7-d07a-4a7f-8ff5-1ec925f8df9b' DATASET_ID = '05b88841-d14b-471d-8e0f-5da29bf8da68' PUBLIC_KEY_PATH = '/path/to/public/key/key.pub' SAFE_URL = 'http://localhost:7777/' `
## Tweaking
The layout is partially hard-wired in the code (see the last line of __main__.py): ` if __name__ == "__main__": pyforms.start_app(AppGUI, geometry=[100, 100, 500, 700]) ` which specifies the geometry of the main window. Couldn’t find a more elegant way to do it.
The rest of the layout is contained in [style.css](wp_dso_publish/style.css) file in the same directory.
## Building and posting to PyPi
Make sure you have twine installed. Edit setup.py to up the version number, then (making sure you are in the right Python virtual environment)
`bash $ rm -rf dist/ build/ wp_dso_publish.egg-info/; ./setup.py sdist; ./setup.py bdist_wheel --universal $ twine upload dist/* `
The proper PyPi location is https://pypi.org/project/wp-dso-publish/.
Follow the install steps at the top, however remember there is a delay between pushing and the artifact being available (you can force the install version with pip install wp-dso-publish==<version>.
Metadata
Release files for wp-dso-publish 0.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wp_dso_publish-0.30.tar.gz | 8.9 kB | Without provenance | Details for wp_dso_publish-0.30.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wp_dso_publish-0.30-py3-none-any.whl | Python 3 | none | any | Details for wp_dso_publish-0.30-py3-none-any.whl |
Total release size: 17.6 kB
Release files / wp_dso_publish-0.30.tar.gz
| Download URL | wp_dso_publish-0.30.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
399752bb3027f58ecc737f30d42f0e6b25ac8e0b8e539056084166a4439de066
|
|
BLAKE2b-256 checksum How to use checksums |
81622bdc159073ec2ee2432ccdaf9d89338f4752a11342cde53ea990754f62f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
|
Release files / wp_dso_publish-0.30-py3-none-any.whl
| Download URL | wp_dso_publish-0.30-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7250b58edc8ab0540413671c23c2b9badb251e874fbeead0fc9f32f51903aa2
|
|
BLAKE2b-256 checksum How to use checksums |
0aea414f602dd4c2e2b55512fe0ccca9709c09a945927590226f1a043ee6d9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.2
|
Security for wp-dso-publish 0.30
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.