client

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2023 WeFuzz Research and Development B.V.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckServerReachable

func CheckServerReachable(server string) bool

Check if the server is reachable

func FetchReportByIndex

func FetchReportByIndex(server string, index int) error

Fetch a vulnerability report from the server by index

func FetchReportByRecord

func FetchReportByRecord(server string, record string) error

Fetch a vulnerability report from the server by record id

func SaveEntry

func SaveEntry(homedir string, entry Entry) error

Save Entry to home directory on Client with logID as filename

func UploadReport

func UploadReport(homedir string, server string, report string, saveToIPFS bool) error

Upload a vulnerability report to the server

func VerifyReportByIndex

func VerifyReportByIndex(server string, index int64) error

Verify report by index

Types

type Data

type Data struct {
	Entry Entry  `json:"entry"`
	Error string `json:"error"`
}

type Entry

type Entry struct {
	ETag     string            `json:"ETag"`
	Location string            `json:"Location"`
	Payload  map[string]Record `json:"Payload"`
	Cid      string            `json:"cid"`
}

func (*Entry) Bytes

func (e *Entry) Bytes() []byte

type InclusionProof

type InclusionProof struct {
	Checkpoint interface{} `json:"checkpoint"`
	Hashes     []string    `json:"hashes"`
	LogIndex   int64       `json:"logIndex"`
	RootHash   string      `json:"rootHash"`
	TreeSize   int64       `json:"treeSize"`
}

type Record

type Record struct {
	Body string `json:"body"`
	// Version        string       `json:"version"`
	// Description    string       `json:"description"`
	// Attributes     string       `json:"attributes"`
	// Author         string       `json:"author"`
	// Platform       string       `json:"platform"`
	// Service        string       `json:"service"`
	// Severity       string       `json:"severity"`
	// Attachments    string       `json:"attachments"`
	// PubKey         string       `json:"pubKey"`
	// Signature      string       `json:"signature"`
	IntegratedTime int64        `json:"integratedTime"`
	LogID          string       `json:"logID"`
	LogIndex       int64        `json:"logIndex"`
	Verification   Verification `json:"verification"`
}

type RecordEntryResponse

type RecordEntryResponse struct {
	Data    Data `json:"data"`
	Success bool `json:"success"`
}

func (*RecordEntryResponse) PrettyPrint

func (r *RecordEntryResponse) PrettyPrint()

type Verification

type Verification struct {
	InclusionProof *InclusionProof `json:"inclusionProof"`

	SignedEntryTimestamp string `json:"signedEntryTimestamp"`
}

Jump to

Keyboard shortcuts

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