Skip to content

Commit

Permalink
fix/safety error when scan is run without being authed
Browse files Browse the repository at this point in the history
  • Loading branch information
SafetyQuincyF committed Oct 18, 2024
1 parent 73a265f commit 19391d4
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 ctx.obj.metadata.authenticated != True:
raise SafetyError("You need to authenticate to use this command. Run 'safety auth login' to authenticate.")

# 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 19391d4

Please sign in to comment.