CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-safety

Scan dependencies for known vulnerabilities and licenses.

Overall
score

61%

Overview
Eval results
Files

task.mdevals/scenario-9/

Security Scan Automation Tool

A CLI utility that automates security scanning workflows with proper authentication handling.

Overview

Build a command-line tool that helps developers check their authentication status with a security scanning service and provides clear feedback about whether they can run scans. The tool should handle different authentication states gracefully.

Requirements

Authentication Status Checker

The tool must implement a command that checks if a user is authenticated with the security scanning service. The status checker should:

  • Verify the current authentication state
  • Display clear, user-friendly output about the authentication status
  • Exit with appropriate status codes (0 for success, non-zero for errors)
  • Handle cases where authentication has not been configured

Error Handling

The tool must handle authentication errors gracefully:

  • Detect when authentication credentials are missing or invalid
  • Provide helpful error messages guiding users on how to authenticate
  • Distinguish between "not authenticated" and "authentication check failed" scenarios

Test Cases

  • When the user is authenticated, running the status check displays the authentication state and exits successfully @test
  • When the user is not authenticated, running the status check indicates the unauthenticated state @test
  • The tool handles authentication check failures with appropriate error messages @test

Implementation

@generates

API

"""
Authentication status checker for security scanning service.

This module provides functionality to check and display authentication status.
"""

def check_authentication_status():
    """
    Check if the user is authenticated with the security scanning service.

    Verifies the current authentication state and displays appropriate
    status information to the user.

    Returns:
        int: Exit code (0 for success, non-zero for errors)
    """
    pass

def display_status(is_authenticated, user_info=None):
    """
    Display authentication status to the user.

    Args:
        is_authenticated (bool): Whether the user is currently authenticated
        user_info (dict, optional): Additional user information if authenticated
    """
    pass

if __name__ == "__main__":
    import sys
    sys.exit(check_authentication_status())

Dependencies { .dependencies }

safety { .dependency }

Provides security vulnerability scanning and authentication capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-safety

tile.json