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

network mode #589

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
e08cc4f
network mode
mishaschwartz Sep 14, 2023
758b15f
review comment updates
mishaschwartz Oct 12, 2023
75ccf61
Merge branch 'master' into network-mode
mishaschwartz Oct 18, 2023
799ad23
network mode v2, code only
mishaschwartz Nov 1, 2023
5d22688
Merge branch 'master' into network-mode
mishaschwartz Nov 1, 2023
4c79d8a
add cron job
mishaschwartz Nov 2, 2023
2c2fd34
documentation updates
mishaschwartz Nov 2, 2023
35090da
docstring updates
mishaschwartz Nov 2, 2023
79714b2
general cleanup and schema updates
mishaschwartz Nov 6, 2023
18ccc4c
deal with pyjwt's python versions support
mishaschwartz Nov 6, 2023
7ec1c9b
deal with jwcrypto's python versions support
mishaschwartz Nov 6, 2023
50aa4e5
fix accidental infinite recursion
mishaschwartz Nov 6, 2023
3e266c7
clean up planning comments and fix route loading with network mode is…
mishaschwartz Nov 6, 2023
38410de
remove unused imports
mishaschwartz Nov 7, 2023
4a6ed0d
ok fine, we'll try to support end-of-life pythons
mishaschwartz Nov 7, 2023
d690c41
ok let's try this version again
mishaschwartz Nov 7, 2023
5f4087d
checks updates
mishaschwartz Nov 7, 2023
18ee9dd
fix css
mishaschwartz Nov 7, 2023
a3aa357
review suggestions
mishaschwartz Dec 18, 2023
1bf5584
style fixes
mishaschwartz Dec 18, 2023
3e94161
route name fix
mishaschwartz Dec 18, 2023
5ec26f9
Merge branch 'master' into network-mode
mishaschwartz Jan 19, 2024
c632d08
added documentation about skipping a check and added a cache to regex…
mishaschwartz Jan 19, 2024
50a86b7
make lru_cache compatible with older pythons
mishaschwartz Jan 19, 2024
c32501b
make all arguments hashable for lru_cache functions
mishaschwartz Jan 19, 2024
521af09
spacing fix
mishaschwartz Jan 26, 2024
1029847
Merge branch 'master' into network-mode
mishaschwartz Feb 16, 2024
9be6121
add timeout to requests (CWE-400)
mishaschwartz Feb 16, 2024
aa1e9e4
initial tests and test setup
mishaschwartz Feb 25, 2024
ef2ebd1
Merge branch 'master' into network-mode
mishaschwartz Apr 1, 2024
b337464
bug fixes and testing helper methods
mishaschwartz Apr 2, 2024
f5de462
some more tests and bugfixes
mishaschwartz Apr 5, 2024
72d2bb3
ensure network mode is configured properly at startup
mishaschwartz Apr 9, 2024
93d177f
add option to create private key at startup
mishaschwartz Apr 10, 2024
fedc5ed
finish up tests for network views
mishaschwartz Apr 16, 2024
7f6a8a0
most of the tests for network nodes
mishaschwartz Apr 17, 2024
249f4a1
use check functions instead of plain assert
mishaschwartz Apr 19, 2024
df90ba2
finish remote user tests and fix issue where multiple remote users co…
mishaschwartz Apr 22, 2024
9de7fee
don't allow explicit assign to anonymous users so that we don't get m…
mishaschwartz Apr 22, 2024
e56504e
add cli and constants tests
mishaschwartz Apr 23, 2024
aa8f43d
add ui tests
mishaschwartz Apr 24, 2024
d4b01b1
style fixes
mishaschwartz Apr 24, 2024
cd9c048
fix dependency versions
mishaschwartz Apr 24, 2024
8107ebb
fix requirements file: old range not parsed properly by pip?
mishaschwartz Apr 24, 2024
18bc104
test fixes
mishaschwartz Apr 24, 2024
add132e
support for python 3.5
mishaschwartz Apr 24, 2024
a140783
add option to create private key through makefile
mishaschwartz Apr 24, 2024
34a1dd0
style fixes
mishaschwartz Apr 24, 2024
7002b2d
style fixes
mishaschwartz Apr 24, 2024
336e5c3
try to ignore some test code
mishaschwartz Apr 24, 2024
704f2bc
give up and just do something different
mishaschwartz Apr 24, 2024
5f587de
try to fix gitleaks again
mishaschwartz Apr 24, 2024
76944c4
fix test exception when python < 3.7
mishaschwartz Apr 25, 2024
8c03aab
don't mess with required test names
mishaschwartz Apr 25, 2024
a34a060
ooops
mishaschwartz Apr 25, 2024
ae9caf6
run the tests that I want. Env variable is overridden by command line…
mishaschwartz Apr 25, 2024
37b9f62
try this again with the proper name since it adds a suffix I guess
mishaschwartz Apr 25, 2024
c8385c9
Merge branch 'master' into network-mode
mishaschwartz Apr 26, 2024
bd2da76
remove code to support python versions < 3.8
mishaschwartz Apr 26, 2024
c5057cb
remove unused import
mishaschwartz Apr 26, 2024
9a839b7
another one
mishaschwartz Apr 26, 2024
64894e3
Merge branch 'master' into network-mode
mishaschwartz Jun 11, 2024
3e903fd
Merge branch 'master' into network-mode
mishaschwartz Sep 17, 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
3 changes: 3 additions & 0 deletions .github/.gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ title = "gitleaks config"
description = "Asymmetric Private Key"
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
tags = ["key", "AsymmetricPrivateKey"]
[rules.allowlist]
description = "test for presence of private keys"
paths = ['''tests/test_magpie_cli.py''']
[[rules]]
description = "Generic Credential"
regex = '''(?i)(api_key|apikey|secret)(.{0,20})?['|"][0-9a-zA-Z]{16,45}['|"]'''
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ jobs:
python-version: "3.10"
allow-failure: false
test-case: check
# remote test
# remote test (note that network tests are skipped since the remote server won't have network mode enabled)
- os: ubuntu-latest
python-version: "3.11"
allow-failure: true
test-case: start test-remote
# remote network tests using a remote server with network mode enabled
- os: ubuntu-latest
python-version: "3.12"
allow-failure: true
test-case: start test # the tests that are run are limited by the PYTEST_ADDOPTS in test-option below
test-option: >-
PYTEST_ADDOPTS='-m "remote and network"' MAGPIE_NETWORK_CREATE_MISSING_PEM_FILE=True MAGPIE_NETWORK_ENABLED=on MAGPIE_NETWORK_INSTANCE_NAME=example
# coverage test
- os: ubuntu-latest
python-version: "3.11"
Expand Down Expand Up @@ -105,6 +112,9 @@ jobs:
run: |
hash -r
env | sort
- name: Create private key for network testing
if: ${{ matrix.test-case == 'test-local' }}
run: ${{ matrix.test-option }} make create-private-key
# run '-only' test variations since dependencies are preinstalled, skip some resolution time
- name: Run Tests
run: ${{ matrix.test-option }} make stop ${{ matrix.test-case }}-only
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ magpie_delete_users*.txt
requirements-all.txt
gunicorn.app.wsgiapp
error_log.txt

# Secrets
*.pem
*.key
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ Features / Changes
------------------------------------------------------------------------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~

* Introduce "Network Mode" which allows other Magpie instances to act as external authentication providers using access
tokens. This allows users registered across multiple Magpie instances in a network to more easily gain access to the
resources within the network, without requiring the duplication of user credentials across the network.
* Add CLI helper ``batch_update_permissions`` that allows registering one or more `Permission` configuration files
against a running `Magpie` instance.
* Security fix: bump Docker base ``python:3.11-alpine3.19``.
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,7 @@ conda-env: conda-base ## create conda environment if missing and required
echo "Creating conda environment at '$(CONDA_ENV_PATH)'..." && \
"$(CONDA_BIN)" create -y -n "$(CONDA_ENV_NAME)" python=$(PYTHON_VERSION)) \
)

.PHONY: create-private-key
create-private-key: ## create a private key file according to the MAGPIE_NETWORK_PEM_FILES and MAGPIE_NETWORK_PEM_PASSWORDS settings
@bash -c '$(CONDA_CMD) magpie_create_private_key --config "$(APP_INI)"'
3 changes: 3 additions & 0 deletions ci/magpie.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ MAGPIE_ADMIN_PASSWORD=qwerty-ci-tests
MAGPIE_LOG_LEVEL=INFO
MAGPIE_LOG_REQUEST=false
MAGPIE_LOG_EXCEPTION=false
MAGPIE_NETWORK_INSTANCE_NAME=node1
MAGPIE_TEST_VERSION=latest
MAGPIE_TEST_REMOTE_SERVER_URL=http://localhost:2001
MAGPIE_TEST_REMOTE_NODE_SERVER_HOST=localhost
MAGPIE_TEST_REMOTE_NODE_SERVER_PORT=2002
MAGPIE_TEST_ADMIN_USERNAME=unittest-admin
# auto-generate password
MAGPIE_TEST_ADMIN_PASSWORD=
Expand Down
6 changes: 6 additions & 0 deletions config/magpie.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ pyramid.includes =
magpie.port = 2001
magpie.url = http://localhost:2001

# Enable network mode which allows different instances of Magpie to authenticate users for each other.
# magpie.network_enabled = true
# magpie.network_default_token_expiry = 86400
# magpie.network_instance_name =
# magpie.network_pem_files = key.pem

# magpie.config_path =

# --- cookie definition --- (defaults below if omitted)
Expand Down
113 changes: 113 additions & 0 deletions docs/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,116 @@ Furthermore, as described in the `procedure`_, :envvar:`MAGPIE_USER_REGISTRATION
specify whether administrator approval is required or not. This additional step is purely up to the developers and
server managers that use `Magpie` to decide if they desire more control over which individuals can join and access
their services.

.. _Network Mode:

Network Mode
------------

If the :envvar:`MAGPIE_NETWORK_ENABLED` is enabled, `Magpie` instances can be linked in a network which allows them to
associate user accounts across the network and provide limited resource access to users who have accounts on other
`Magpie` instances in the network. Each `Magpie` instance is considered a node in the network.

Users who have an account on one `Magpie` instance can request an access token from another instance in the network
which the user can use to access resources protected by the other `Magpie` instance.

Users with accounts on multiple instances in the network can also choose to link their accounts. This allows users who
use access tokens to ensure that they have the same access to resources that they would have if they logged in to
`Magpie` using any other method.


Managing the Network
~~~~~~~~~~~~~~~~~~~~

Each `Magpie` instance must be made aware of the existence of the other instances in the network so that they know where
to send token requests and account linking requests.

In order to register another `Magpie` instance as part of the same network, an admin user can create a
:term:`Network Node` with a request to ``POST /network/nodes``. The parameters given to that request includes

* ``name``:
* the name of that other `Magpie` instance in the network and should correspond to the same value as the
:envvar:`MAGPIE_NETWORK_INSTANCE_NAME` value set by the other `Magpie` instance.
* ``jwks_url``:
* URL that provides the instance's public key in the form of a JSON Web Key Set.
* This is usually ``https://{hostname}/network/jwks`` where ``{hostname}`` is the hostname of the other instance
* ``authorization_url``
* URL that provides the instance's Oauth authorize endpoint.
* This is usually ``https://{hostname}/ui/network/authorize`` where ``{hostname}`` is the hostname of the other
instance.
* ``token_url``
* URL that provides the instances Oauth token endpoint.
* This is usually ``https://{hostname}/network/token`` where ``{hostname}`` is the hostname of the other instance.
* ``redirect_uris``
* JSON array of valid redirect URIs for the instance. These are used by the instance's Oauth authorize
endpoint to safely redirect the user back once they have authorized `Magpie` to link their accounts on two
different instances.
* This is usually ``https://{hostname}/network/link`` where ``{hostname}`` is the hostname of the other
instance.


Once a :term:`Network Node` is registered, `Magpie` can treat the other instance as if they are in the same network as
long as:

* Both instances have :envvar:`MAGPIE_NETWORK_ENABLED` enabled
* Both instances have :envvar:`MAGPIE_NETWORK_INSTANCE_NAME` set
* Both instances have :envvar:`MAGPIE_NETWORK_PEM_FILES` set in order to verify communication between nodes using an
asymmetric public/private key-pair.


Managing Personal Access Tokens
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A :term:`User` can request a new access token from another node with a request to the
``GET /network/nodes/{node_name}/token`` route.

Every time a :term:`User` makes a request to this route, `Magpie` send a request to the other instance, and provides it
to the user. A new token is generated every time. This effectively cancels all previously created tokens for that user.

To cancel an existing token without generating a new one. A :term:`User` can make a request to the
``DELETE /network/nodes/{node_name}/token`` route.

Authentication
~~~~~~~~~~~~~~

Once a :term:`User` gets an access token, they can use that token to authenticate with the instance that issued that
token.

When a user makes a request, they should set the ``provider_name`` parameter to the value of
:envvar:`MAGPIE_NETWORK_PROVIDER` and provide the network token in the Authorization header in the following format:

.. code-block:: http

Authorization: Bearer <network_token>

When using the :ref:`Magpie Adapter <utilities_adapter>`, the token can also be passed as a parameter to the request,
where the parameter name set by :envvar:`MAGPIE_NETWORK_TOKEN_NAME` and the value is the personal network token.

Authorization
~~~~~~~~~~~~~

Managing authorization for :term:`Users` who authenticate using access tokens is complicated by the fact that
a :term:`User` is not required to have a full account on both `Magpie` instances in order to using this authentication
mechanism. This means that a :term:`User` may be logged in as a node-specific "anonymous" user.

When another `Magpie` instance is registered as a :term:`Network Node`, a few additional entities are created:

#. a group used to manage the permissions of all users who authenticate using the new :term:`Network Node`.
* this group's name will be the :envvar:`MAGPIE_NETWORK_NAME_PREFIX` followed by the :term:`Network Node` name
#. a group used to manage the permissions of all users who authenticate using *any* other instance in the network
* this group's name will be the :envvar:`MAGPIE_NETWORK_GROUP_NAME`
* this group will only be created once, when the first :term:`Network Node` is registered
#. an anonymous user that belongs to the two groups that were just created.
* this user name will be the :envvar:`MAGPIE_NETWORK_NAME_PREFIX` followed by the :term:`Network Node` name
Comment on lines +524 to +525
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a valid user name (eg: pavics) was created on a node that had MAGPIE_NETWORK_NAME_PREFIX=pavics, another Magpie instance (eg: daccs) using network mode will not be able to distinguish that user pavics from that network node's anonymous user.

Or maybe this is just an impression? But it looks like it could be possible to inject the "right values" to cause side effects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the MAGPIE_NETWORK_NAME_PREFIX=pavics then you shouldn't be able to create any new users whose name starts with pavics. Even so, the anonymous user for the daccs node would be pavicsdaccs (the prefix followed by the network name).

Now, if you already had a user in the system named pavicsdaccs that could be a bit confusing but they should still be able to differentiate them because one would belong to the pavicsdaccs group and the original user would not.

If this is easier though, I'm happy to split these users out into different tables as you suggest (#589 (review)) if that will keep things cleaner.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would make it easier conceptually. The API endpoints however would still need to consider these conditions to allow user names or not. I think you mostly already did it with the regexes, but tests must be done to make sure it works everywhere (trying to purposely cause conflict, edge cases and such).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I have some tests on the way but they're still in progress :)


Here is an example to illustrate this point:

* There are 3 `Magpie` instances in the network named A, B, and C
* There is a :term:`User` named ``"toto"`` registered on instance A
* There is no :term:`User` named ``"toto"`` who belongs to the ``"anonymous_network_A"`` group registered on instance B
* There is a :term:`User` named ``"toto"`` who belongs to the ``"anonymous_network_A"`` group registered on instance C
* Instance A is registered as a :term:`Network Node` on instances B and C
* when ``"toto"`` gets a personal network token from instance A and uses it to log in on instance B they log in as the
the temporary ``"anonymous_network_A"`` user.
* when ``"toto"`` gets a personal network token from instance A and uses it to log in on instance C they log in as the
``"toto"`` user on instance C.
Comment on lines +536 to +537
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if user toto already existed on instance C but is not the same person toto from A? Is it actually toto user on instance C, or some kind of toto_network_A user on instance C?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are logged in at the toto user who belongs to the toto_network_A group

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Will need to investigate more how conflicting user names are handled. Basically, we shouldn't assume that a name would necessarily be exactly the same on other Magpie instances. Preferably, alternative/remote Magpie instances should allow to "link" users of different names, similarly to how you can have 2 distinct user names on distinct social media platforms, but link accounts together. Retrieving the "resolved user_name" from another Magpie in the network could use similar approach to the userinfo of OAuth.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I see what you mean. I'm feeling strongly from this review that we should be handling these remote users by storing them separately in another db table. That would resolve a lot of the issues that you raise here about conflicting names as well

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remote users are now stored in a different table: network_remote_users

128 changes: 128 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,134 @@ remain available as described at the start of the :ref:`Configuration` section.
Name of the :term:`Provider` used for login. This represents the identifier that is set to define how to
differentiate between a local sign-in procedure and a dispatched one some known :ref:`authn_providers`.

Network Mode Settings
~~~~~~~~~~~~~~~~~~~~~

The following configuration parameters are related to Magpie's "Network Mode" which allows networked instances of Magpie
to authenticate users for each other. All variables defined in this section are only used if
:envvar:`MAGPIE_NETWORK_ENABLED` is enabled.

.. envvar:: MAGPIE_NETWORK_ENABLED

[:class:`bool`]
(Default: ``False``)

.. versionadded:: 3.38

Enable "Network Mode" which enables all functionality to authenticate users using other Magpie instances as
external authentication providers.

.. envvar:: MAGPIE_NETWORK_INSTANCE_NAME

[:class:`str`]

.. versionadded:: 3.38

The name of this Magpie instance in the network. This variable is used to determine if an authentication token was
issued by this instance of Magpie, or another instance in the network.

This variable is required if :envvar:`MAGPIE_NETWORK_ENABLED` is ``True``.

.. envvar:: MAGPIE_NETWORK_DEFAULT_TOKEN_EXPIRY

[:class:`int`]
(Default: ``86400``)

.. versionadded:: 3.38

The default expiry time (in seconds) for an access token issued for the purpose of network authentication.

.. envvar:: MAGPIE_NETWORK_INTERNAL_TOKEN_EXPIRY

[:class:`int`]
(Default: ``30``)

.. versionadded:: 3.38

The default expiry time (in seconds) for an JSON Web Token issued for the purpose of communication between nodes in
the network.

.. envvar:: MAGPIE_NETWORK_TOKEN_NAME

[|constant|_]
(Value: ``"magpie_token"``)

.. versionadded:: 3.38

The name of the request parameter key whose value is the authentication token issued for the purpose of network
authentication.

.. envvar:: MAGPIE_NETWORK_PROVIDER

[|constant|_]
(Value: ``"magpie_network"``)

.. versionadded:: 3.38

The name of the external provider that authenticates users using other Magpie instances as external authentication
providers.

.. envvar:: MAGPIE_NETWORK_NAME_PREFIX

[|constant|_]
(Value: ``"anonymous_network_"``)

.. versionadded:: 3.38

A prefix added to the anonymous network user and network group names. These names are constructed by prepending the
remote Magpie instance name with this prefix. For example, a Magpie instance named ``"example123"`` will have a
corresponding user and group named ``"anonymous_network_example123"``.

.. envvar:: MAGPIE_NETWORK_GROUP_NAME

[|constant|_]
(Value: ``"magpie_network"``)

.. versionadded:: 3.38

The name of the group created to manage permissions for all users authenticated using Magpie instances as external
authentication providers.

.. envvar:: MAGPIE_NETWORK_PEM_FILES

[:class:`str`]
(Default: ``${MAGPIE_ROOT}/key.pem``)

.. versionadded:: 3.38

Path to a PEM file containing a public/private key-pair. This is used to sign and verify communication sent between
nodes in the network.

Multiple PEM files can be specified if key rotation is desired. To specify multiple PEM files, separate each file
path with a ``:`` character. The first file in the list will contain the primary key and will be used to sign all
outgoing communication.

.. envvar:: MAGPIE_NETWORK_PEM_PASSWORDS

[:class:`str`]
(Default: ``None``)

.. versionadded:: 3.38

Password used to encrypt the PEM files in :envvar:`MAGPIE_NETWORK_PEM_FILES`.

If multiple files require passwords, they can be listed as a JSON array. An empty string will be treated the same as
no password.

For example, if you have four files specified in :envvar:`MAGPIE_NETWORK_PEM_FILES` and only the first and third
file require a password, set this variable to ``["pass1", "" ,"pass2", ""]`` where ``pass1`` and ``pass2`` are the
passwords.

.. envvar:: MAGPIE_NETWORK_CREATE_MISSING_PEM_FILE

[:class:`bool`]
(Default: ``False``)

.. versionadded:: 3.38

If enabled *and* there is a single file specified in :envvar:`MAGPIE_NETWORK_PEM_FILES` *and* that file is missing,
`Magpie` will generate a new private key file when starting up. If a password is specified for that file in
:envvar:`MAGPIE_NETWORK_PEM_PASSWORDS` then the private key file will be encrypted with that password as well.

.. _config_phoenix:

Expand Down
10 changes: 10 additions & 0 deletions docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ Glossary
:py:data:`magpie.constants.MAGPIE_ANONYMOUS_USER`. Otherwise, it is whoever the
:term:`Authentication` mechanism identifies with token extracted from request :term:`Cookies`.

Network Node
A reference to an instance of the Magpie software within a network of Magpie instances. Each Magpie instance
within the network is registered in the database as a row in the ``network_nodes`` table. Each node is
represented by a name that is unique across all nodes in the network, and a url that is used to send http
requests to that specific node.

Network Token
A unique random string that can be used to authenticate a user as part of the :ref:`Network Mode` authentication
procedure.

OpenAPI
OAS
The |OpenAPI-spec|_ (`OAS`) defines a standard, programming language-agnostic interface description for
Expand Down
3 changes: 3 additions & 0 deletions env/magpie.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ MAGPIE_TEST_VERSION=latest
# this means you must have a separately running Magpie instance reachable at that endpoint to run 'remote' tests
# to ignore this, consider setting an empty value or running 'make test-local' instead
MAGPIE_TEST_REMOTE_SERVER_URL=http://localhost:2001
# below URL specifies a host and port for a fake network node (used for network tests)
MAGPIE_TEST_REMOTE_NODE_SERVER_HOST=localhost
MAGPIE_TEST_REMOTE_NODE_SERVER_PORT=2002
# below are the credentials employed to run tests (especially if running on non-default remote server)
MAGPIE_TEST_ADMIN_USERNAME=admin
MAGPIE_TEST_ADMIN_PASSWORD=qwerty
Expand Down
1 change: 1 addition & 0 deletions magpie-cron
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0 * * * * /bin/bash -c "set -a ; source <($MAGPIE_ENV_DIR/*.env) ; set +a ; magpie_sync_resources"
1 0 * * * /bin/bash -c "set -a ; source <($MAGPIE_ENV_DIR/*.env) ; set +a ; magpie_purge_expired_network_tokens"
Loading
Loading