apiroot

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package apiroot implements the TAXII 2.1 API Root resource.

The following information comes directly from the TAXII 2.1 specification.

API Roots are logical groupings of TAXII Collections, Channels, and related functionality. A TAXII server instance can support one or more API Roots. API Roots can be thought of as instances of the TAXII API available at different URLs, where each API Root is the "root" URL of that particular instance of the TAXII API. Organizing the Collections and Channels into API Roots allows for a division of content and access control by trust group or any other logical grouping. For example, a single TAXII Server could host multiple API Roots - one API Root for Collections and Channels used by Sharing Group A and another API Root for Collections and Channels used by Sharing Group B.

Each API Root contains a set of Endpoints that a TAXII Client contacts in order to interact with the TAXII Server. This interaction can take several forms:

  • Server Discovery, as described above, can be used to learn about the API Roots

hosted by a TAXII Server.

  • Each API Root might support zero or more Collections. Interactions with

Collections include discovering the type of CTI contained in that Collection, pushing new CTI to that Collection, and/or retrieving CTI from that Collection. Each piece of CTI content in a Collection is referred to as an Object.

  • Each API Root might host zero or more Channels.

  • Each API Root also allows TAXII Clients to check on the Status of certain types

of requests to the TAXII Server. For example, if a TAXII Client submitted new CTI, a Status request can allow the Client to check on whether the new CTI was accepted.

This Endpoint provides general information about an API Root, which can be used to help users and clients decide whether and how they want to interact with it. Multiple API Roots MAY be hosted on a single TAXII Server. Often, an API Root represents a single trust group.

  • Each API Root MUST have a unique URL.

  • Each API Root MAY have different authentication and authorization schemes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRoot

type APIRoot struct {
	properties.TitleProperty
	properties.DescriptionProperty
	Versions         []string `json:"versions"`
	MaxContentLength int      `json:"max_content_length"`
}
APIRoot - This type implements the TAXII 2 API Root and defines all of the

properties and methods needed to create and work with this resource. All of the methods not defined local to this type are inherited from the individual properties.

The following information comes directly from the TAXII 2.1 specification.

The API Root resource contains general information about the API Root, such as a human-readable title and description, the TAXII versions it supports, and the maximum size (max_content_length) of the content body it will accept in a PUT or POST request.

func Decode

func Decode(data []byte) (*APIRoot, error)
Decode - This function is a simple wrapper for decoding JSON data. It will

decode a slice of bytes into an actual struct and return a pointer to that object along with any errors.

func New

func New() *APIRoot
New - This function will create a new TAXII API Root resource and return

it as a pointer.

func (*APIRoot) AddVersions

func (o *APIRoot) AddVersions(values interface{}) error
AddVersions - This method takes in a string value, a comma separated list of

string values, or a slice of string values that represents a version of the TaXII API that is supported and adds it to the versions property.

func (*APIRoot) Encode

func (o *APIRoot) Encode() ([]byte, error)

Encode - This method is a simple wrapper for encoding an object into JSON

func (*APIRoot) EncodeToString

func (o *APIRoot) EncodeToString() (string, error)
EncodeToString - This method is a simple wrapper for encoding an object into

JSON

func (*APIRoot) GetMaxContentLength

func (o *APIRoot) GetMaxContentLength() int
GetMaxContentLength - This method returns the max content length as an

integer.

func (*APIRoot) SetMaxContentLength

func (o *APIRoot) SetMaxContentLength(i int) error
SetMaxContentLength - This method takes in an integer value representing the

max content length that the server can support and updates the max content length property.

Jump to

Keyboard shortcuts

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