Skip to content

[BUG] Misleading error messages #664

@jackmtpt

Description

@jackmtpt

Describe the bug

The code here: https://github.com/Checkmarx/ast-azure-plugin/blob/a071e9b9ac36d28aca175f98e5d8ca38fa2ecccc/cxAstScan/services/Utils.ts#L27C1-L38C10 first tries to extract OAuth credentials from the service connection, and then API Key credentials. These are mutually-exclusive options, so no matter which one you have configured in your service connection you will get an error printed into the log saying that the other one is missing, despite everything actually working.

Expected behavior

The task should only print an error message if it failed to obtain credentials from both sources.

Steps to reproduce

  1. Create a service connection using OAuth credentials.
  2. Run a pipeline task that uses it
  3. Observe No API Key configured message in the logs.

Environment

  • AZURE PLUGIN 2.0.39
  • Platform - Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions