gojs-cvss

command module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 2 Imported by: 0

README

GoJS-CVSS

Transpilation of github.com/pandatix/go-cvss into JS using gopherjs

reference go report Coverage Status
License CI CodeQL
OpenSSF Scoreboard

It currently supports :

How to use

API

The API provides multiple ways to handle CVSS v4.0:

  • as an in-browser global script: <script src="gojs-cvss.js"></script>
  • as a Node module: m = require("./gojs-cvss.js")

From the global/module import, you have:

  • the CVSS40 type that you can create either with vec = new CVSS40() or vec = m.cvss40.New()
  • the Rating method that cou can call with Rating(...) or m.Rating(...), takes a Number and returns a 2-objects slice composed of the rating (String or null) and an error message (String or null) if the value is out of bounds

The CVSS40 object has multiple methods:

  • Parse(vector): takes a CVSS v4.0 string representation to parse it and returns an error message (String or null)
  • Vector(): returns the string representation (String) of the CVSS v4.0 object.
  • Get(metric): takes the metric (String) to get and returns a 2-objects slice composed of the metric value (String or null) and an error message (String or null)
  • Set(metric, value): takes the metric and the value (String) to set it to, and returns an error message (String or null)
  • Score(): returns the score of the CVSS v4.0 object (Number)
  • Nomenclature(): returns the nomenclature of the CVSS v4.0 object (String)

The examples are equivalent and shows how to parse a CVSS v4.0 string representation, change a metric value, compute its score+nomenclature and print the new vector.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL