Skip to content

Scrub MCWS user ID of invalid namespace characters #391

Open
mudinthewater wants to merge 2 commits intorelease/5.3.2from
387-scrub-invalid-id-chars
Open

Scrub MCWS user ID of invalid namespace characters #391
mudinthewater wants to merge 2 commits intorelease/5.3.2from
387-scrub-invalid-id-chars

Conversation

@mudinthewater
Copy link
Copy Markdown
Collaborator

Adds support for #387 in v5.3.2.

This can't be tested with development storage, so you'll need something to emulate the MCWS persistence storage, as well as send a poorly-formatted name.

  1. clone https://github.jpl.nasa.gov/IEMS/iems-gds-fast-mcws-persistence
  2. cd into iems-gds-fast-mcws-persistence
  3. edit the following file: fastmio/fastMIOServer.py line 165
  4. replace remote_user='unknown' with remote_user='Unknown, User (999A)'
  5. edit the following file: fastmio/config/fastmio.cfg
    Line 26:
    import_mcws_namespaces = true -> import_mcws_namespaces = false
    Line 40:
    import_fastmio_namespaces=false -> import_fastmio_namespaces=true

Lines 44-48:

ns_map= {
"/shared":"/home/user/shared",
"/systems":"/home/user/systems",
"/users":"/home/user/users"
}

becomes

ns_map= {
"/shared":"/your/path/here/shared",
"/users":"/your/path/here/users"
}

  1. Create a python3 virtual environment and install fastmio's required packeges.

python3 -m venv fastmioenv
source fastmioenv/bin/activate
pip install -e .

Fastmio is now configured to send your development server a MCWS namespace with an invalid ID.

Run fast mio with python fastmio/fastMIOServer.py and leave the terminal up for your testing purposes.

Note that you may need to delete the contents of while you test - fastmio will automatically pick up any changes to the and does not need to be restarted if you do.

Next, configure the webpack dev environment and config.js to use the fastmio environment you just set up.

Webpack dev:
set your API_URL environment variable to localhost:8093

config.js

  1. set the mcwsUrl to:
    mcwsUrl: 'http://localhost:8093/mcws',
  2. Set the URLs for the development namespaces like so:

namespaces: [
{
key: 'r50-dev',
name: 'R5.0 Shared',
url: '/fastmio/shared'
},
{
userNamespace: true,
key: 'r50-dev',
name: 'R5.0 Users',
url: '/fastmio/users'
}
],

uncomment the proxyUrl line, but do not uncomment the useDeveloperStorage line, as we're going to use fastmio in this scenario as our test storage provider. Don't forget to remove the comma after useDeveloperStorage if it is now the last item in the config file.

running npm start should now run MCT as a developer server but with fastmio providing a fully qualified mcws-like name, allowing this functionality to be tested .

Verify that the user folder is automatically created with the full user name and that the logged in user in the MCT status bar is the correct user name.
Verify that if you create an object in the user's folder, the namespace and location parameters do not contain spaces, commas, or other invalid characters.
Verify that you can create objects in the shared folder with no issues as well.

Peter Di Pasquale and others added 2 commits February 4, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant