Skip to content

Discussion: Demo models only save to local filesystem #1433

@Ajith-Penmatsa-GGL

Description

@Ajith-Penmatsa-GGL

Demo models fail to route correctly when selected from git providers (GitHub/GitLab/Bitbucket). The demo selection currently hardcodes routing to localThreatModel, which bypasses the repository and branch selection workflow required for git providers.

When a user authenticated with a git provider selects a demo model, they are routed directly to a local threat model view instead of being prompted to:

  1. Select a repository
  2. Select a branch
  3. Save the demo model to their git repository

This prevents users from properly creating threat models from demo templates in their git repositories.

Expected behaviour:

Demo model selection should respect the current provider context:

  • Git providers (GitHub/GitLab/Bitbucket): After selecting a demo model, users should be routed to the repository selection page, then branch selection, and finally the model should be created in their chosen git repository
  • Local/Desktop providers: After selecting a demo model, users should be routed directly to the threat model summary page
  • Google provider: Similar to local/desktop, route directly to model summary.

Environment:

  • Version: 2.5.0
  • Platform: Web App
  • OS: Windows
  • Browser: Chrome

To Reproduce:

  1. Navigate to Threat Dragon web app
  2. Log in with a git provider (GitHub/GitLab/Bitbucket)
  3. From the dashboard, click "Demo Models"
  4. Select any demo model (e.g., "Online Game")
  5. Observe that you are taken directly to a local threat model view
  6. Attempt to save the model - no repository/branch context exists, and since provider type is set to git we will be using git routes when we try save , which would return 404 without that info.

Root Cause:

The SelectDemoModel.vue component hardcodes the route to localThreatModel regardless of the selected provider:

Declaration:

By submitting this issue you have:

Image Image Image

The malformed API request URL /api/threatmodel///Internet%20of%20Things%20(IoT)%20Device/update shows missing {repo} and {branch} parameters (indicated by the three consecutive slashes ///), which should have been set during repository and branch selection a workflow that was incorrectly bypassed.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions