prismor 0.1.1__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prismor
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A CLI tool for scanning GitHub repositories for vulnerabilities, secrets, and generating SBOMs
5
5
  Home-page: https://github.com/PrismorSec/prismor-cli
6
6
  Author: Prismor
@@ -1,6 +1,6 @@
1
1
  """Prismor CLI - Security scanning tool for GitHub repositories."""
2
2
 
3
- __version__ = "0.1.1"
3
+ __version__ = "0.1.2"
4
4
  __author__ = "Prismor"
5
5
  __description__ = "A CLI tool for scanning GitHub repositories for vulnerabilities, secrets, and generating SBOMs"
6
6
 
@@ -194,4 +194,49 @@ class PrismorClient:
194
194
  "name": user_info.get("name")
195
195
  }
196
196
  }
197
+
198
+ def get_repository_by_name(self, repo_name: str) -> Dict[str, Any]:
199
+ """Get repository ID by repository name.
200
+
201
+ Args:
202
+ repo_name: Repository name (e.g., "username/repo")
203
+
204
+ Returns:
205
+ Dictionary containing repository information including ID
206
+
207
+ Raises:
208
+ PrismorAPIError: If request fails
209
+ """
210
+ try:
211
+ response = requests.post(
212
+ f"{self.base_url}/api/repositories/by-name",
213
+ json={
214
+ "apiKey": self.api_key,
215
+ "repoName": repo_name
216
+ },
217
+ headers={"Content-Type": "application/json"},
218
+ timeout=30
219
+ )
220
+
221
+ if response.status_code == 401:
222
+ raise PrismorAPIError("Invalid API key. Please check your PRISMOR_API_KEY.")
223
+
224
+ if response.status_code == 404:
225
+ raise PrismorAPIError(f"Repository '{repo_name}' not found.")
226
+
227
+ if response.status_code >= 400:
228
+ error_msg = response.json().get("error", "Unknown error")
229
+ raise PrismorAPIError(f"API error: {error_msg}")
230
+
231
+ response.raise_for_status()
232
+ return response.json()
233
+
234
+ except requests.exceptions.Timeout:
235
+ raise PrismorAPIError("Request timed out.")
236
+ except requests.exceptions.ConnectionError:
237
+ raise PrismorAPIError(
238
+ "Failed to connect to Prismor API. Please check your internet connection."
239
+ )
240
+ except requests.exceptions.RequestException as e:
241
+ raise PrismorAPIError(f"Request failed: {str(e)}")
197
242
 
@@ -127,7 +127,7 @@ def format_scan_results(results: dict, scan_type: str):
127
127
  @click.option("--fullscan", is_flag=True, help="Perform all scan types")
128
128
  @click.option("--branch", type=str, help="Specific branch to scan (defaults to main/master)")
129
129
  @click.option("--json", "output_json", is_flag=True, help="Output results in JSON format")
130
- @click.version_option(version="0.1.0", prog_name="prismor")
130
+ @click.version_option(version="0.1.2", prog_name="prismor")
131
131
  @click.pass_context
132
132
  def cli(ctx, scan: Optional[str], vex: bool, sbom: bool, detect_secret: bool,
133
133
  fullscan: bool, branch: Optional[str], output_json: bool):
@@ -189,6 +189,41 @@ def cli(ctx, scan: Optional[str], vex: bool, sbom: bool, detect_secret: bool,
189
189
  else:
190
190
  print_success("Scan completed successfully!")
191
191
  format_scan_results(results, ', '.join(scan_types))
192
+
193
+ # Try to get repository ID and display dashboard link
194
+ try:
195
+ # Extract repo name from scan input
196
+ repo_name = scan
197
+ if scan.startswith("http://") or scan.startswith("https://"):
198
+ # Extract from GitHub URL
199
+ if "github.com/" in scan:
200
+ repo_name = scan.split("github.com/")[1].rstrip("/")
201
+
202
+ # Get repository ID
203
+ repo_info = client.get_repository_by_name(repo_name)
204
+ if repo_info.get("success") and "repository" in repo_info:
205
+ repo_id = repo_info["repository"]["id"]
206
+ dashboard_url = f"https://prismor.dev/repositories/{repo_id}"
207
+
208
+ click.echo("\n" + "=" * 60)
209
+ click.secho(" 📊 Dashboard Analysis", fg="cyan", bold=True)
210
+ click.echo("=" * 60)
211
+ click.secho(f"🔗 View detailed analysis and insights:", fg="blue")
212
+ click.secho(f" {dashboard_url}", fg="green", bold=True)
213
+ click.echo("\n💡 The dashboard provides:")
214
+ click.echo(" • Interactive visualizations and charts")
215
+ click.echo(" • Historical vulnerability trends")
216
+ click.echo(" • Detailed security reports")
217
+ click.echo(" • Team collaboration features")
218
+ click.echo(" • Export capabilities")
219
+ click.echo("=" * 60 + "\n")
220
+
221
+ except PrismorAPIError as e:
222
+ # Repository might not be found, continue without dashboard link
223
+ print_warning(f"Could not generate dashboard link: {str(e)}")
224
+ except Exception as e:
225
+ # Any other error, continue without dashboard link
226
+ print_warning(f"Could not generate dashboard link: {str(e)}")
192
227
 
193
228
  except PrismorAPIError as e:
194
229
  print_error(str(e))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prismor
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A CLI tool for scanning GitHub repositories for vulnerabilities, secrets, and generating SBOMs
5
5
  Home-page: https://github.com/PrismorSec/prismor-cli
6
6
  Author: Prismor
@@ -17,7 +17,7 @@ if os.path.exists("README.md"):
17
17
 
18
18
  setup(
19
19
  name="prismor",
20
- version="0.1.1",
20
+ version="0.1.2",
21
21
  author="Prismor",
22
22
  author_email="support@prismor.dev",
23
23
  description="A CLI tool for scanning GitHub repositories for vulnerabilities, secrets, and generating SBOMs",
File without changes
File without changes
File without changes
File without changes
File without changes