Giter Site home page Giter Site logo

dsp-appsec-codedx-api-client-python's Introduction

codedx-api-client-python

This is an python client for the CodeDx API. See the CodeDx API Guide for reference.

Download

Install the library using pip3

pip3 install git+https://github.com/broadinstitute/dsp-appsec-codedx-api-client-python.git

You can then make API calls using the library. See below for an example.

from codedx_api import CodeDxAPI

cdx = CodeDxAPI.CodeDx([YOUR-CODEDX-URL], [CODEDX-API-KEY])

cdx.create_project('WebGoat')

The methods return data according to the schema seen in the CodeDx API Guide. For example, the create_projects call returns:

{
  "id": 1,
  "name": "WebGoat"
}

Docker Usage

The docker image includes the preinstalled library and includes example scripts for common tasks.

Pull Image from GCR

First, make sure you have permissions to access the project on GCR and that you can push and pull images.

docker pull gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest

Interactive Python Session

docker run -it --name codedx-tasks gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest
>>> from codedx_api import CodeDxAPI
>>> cdx = CodeDxAPI.CodeDx([YOUR-CODEDX-URL], [CODEDX-API-KEY])
>>> cdx.get_projects()
{YOUR-PROJECTS-JSON}

Run sample scripts

Get Project ID or Create Project if given does not exist

docker run --name create-project gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest create_project.py [API-KEY] [YOUR-PROJECT-NAME]

Upload security scan report to CodeDX

docker run -v $(pwd):/app/scripts/reports --name upload-report gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest upload_analysis.py [API-KEY] [PROJECT] [PATH-TO-REPORT]

Questions

Please contact [email protected] with any questions.

dsp-appsec-codedx-api-client-python's People

Contributors

adrazhi avatar ssyms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.