Skip to content

Commit

Permalink
Merge pull request #612 from pyupio/feat/prevent-scan-if-not-authed
Browse files Browse the repository at this point in the history
fix/safety error when scan is run without being authenticated
  • Loading branch information
SafetyQuincyF authored Oct 18, 2024
2 parents 73a265f + 5ec80dd commit 0065432
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions safety/scan/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ def scan(ctx: typer.Context,
"""
Scans a project (defaulted to the current directory) for supply-chain security and configuration issues
"""

if not ctx.obj.metadata.authenticated:
raise SafetyError("Authentication required. Please run 'safety auth login' to authenticate before using this command.")

# Generate update arguments if apply updates option is enabled
fixes_target = []
Expand Down Expand Up @@ -288,14 +291,11 @@ def scan(ctx: typer.Context,
target_ecosystems = ", ".join([member.value for member in ecosystems])
wait_msg = f"Analyzing {target_ecosystems} files and environments for security findings"

import time

files: List[FileModel] = []

config = ctx.obj.config

count = 0
ignored = set()

affected_count = 0
dependency_vuln_detected = False
Expand Down

0 comments on commit 0065432

Please sign in to comment.