Documentation
¶
Index ¶
- Variables
- type Address
- type Algorithm
- type Condition
- type Conjunction
- type Dependency
- type LargeUploadRequest
- type LargeUploadResponse
- type Module
- type OperationalEnvironment
- type Person
- type Query
- type Relation
- type RequestStatus
- type Server
- func (server *Server) Delete(endPoint string) error
- func (server *Server) Get(out any, endPoint string) error
- func (server *Server) GetBytes(endPoint string) ([]byte, error)
- func (server *Server) GetPaged(out any, endPoint string, condition Query) error
- func (server *Server) Login() error
- func (server *Server) Post(out any, endPoint string, contents []byte) error
- func (server *Server) Put(out any, endPoint string, contents []byte) error
- type SessionResults
- type TestSession
- type ValidationResults
- type Vectors
- type Vendor
Constants ¶
This section is empty.
Variables ¶
var NotFound = errors.New("acvp: HTTP code 404")
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { URL string `json:"url,omitempty"` Street1 string `json:"street1,omitempty"` Street2 string `json:"street2,omitempty"` Street3 string `json:"street3,omitempty"` Locality string `json:"locality,omitempty"` Region string `json:"region,omitempty"` Country string `json:"country,omitempty"` PostalCode string `json:"postalCode,omitempty"` }
https://pages.nist.gov/ACVP/draft-fussell-acvp-spec.html#rfc.section.11.9
type Conjunction ¶
type Conjunction []Condition
type Dependency ¶
type LargeUploadRequest ¶
type LargeUploadResponse ¶
type Module ¶
type Module struct { URL string `json:"url,omitempty"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Type string `json:"type,omitempty"` Website string `json:"website,omitempty"` VendorURL string `json:"vendorUrl,omitempty"` AddressURL string `json:"addressUrl,omitempty"` ContactURLs []string `json:"contactUrls,omitempty"` Description string `json:"description,omitempty"` }
https://pages.nist.gov/ACVP/draft-fussell-acvp-spec.html#rfc.section.11.11
type OperationalEnvironment ¶
type OperationalEnvironment struct { URL string `json:"url,omitempty"` Name string `json:"name,omitempty"` DependencyUrls []string `json:"dependencyUrls,omitempty"` Dependencies []Dependency `json:"dependencies,omitempty"` }
type Person ¶
type Person struct { URL string `json:"url,omitempty"` FullName string `json:"fullName,omitempty"` VendorURL string `json:"vendorUrl,omitempty"` Emails []string `json:"emails,omitempty"` PhoneNumbers []struct { Number string `json:"number,omitempty"` Type string `json:"type,omitempty"` } `json:"phoneNumbers,omitempty"` }
https://pages.nist.gov/ACVP/draft-fussell-acvp-spec.html#rfc.section.11.10
type Query ¶
type Query []Conjunction
type RequestStatus ¶
type Server ¶
type Server struct { // PrefixTokens are access tokens that apply to URLs under a certain prefix. // The keys of this map are strings like "acvp/v1/testSessions/1234" and the // values are JWT access tokens. PrefixTokens map[string]string // SizeLimit is the maximum number of bytes that the server can accept // as an upload before the large endpoint support must be used. Zero // means that there is no limit. SizeLimit uint64 // AccessToken is the top-level access token for the current session. AccessToken string // contains filtered or unexported fields }
Server represents an ACVP server.
func NewServer ¶
func NewServer(prefix string, logFile string, derCertificates [][]byte, privateKey crypto.PrivateKey, totp func() string) *Server
NewServer returns a fresh Server instance representing the ACVP server at prefix (e.g. "https://acvp.example.com/"). A copy of all bytes exchanged will be written to logFile, if not empty.
func (*Server) GetPaged ¶
GetPaged returns an array of records of some type using one or more requests to the server. See https://pages.nist.gov/ACVP/draft-fussell-acvp-spec.html#paging_response
func (*Server) Login ¶
Login sends a login request and stores the returned access tokens for use with future requests. The login process isn't specifically documented in draft-fussell-acvp-spec and the best reference is https://github.com/usnistgov/ACVP/wiki#credentials-for-accessing-the-demo-server
type SessionResults ¶
type TestSession ¶
type TestSession struct { URL string `json:"url,omitempty"` ACVPVersion string `json:"acvpVersion,omitempty"` Created string `json:"createdOn,omitempty"` Expires string `json:"expiresOn,omitempty"` VectorSetURLs []string `json:"vectorSetUrls,omitempty"` AccessToken string `json:"accessToken,omitempty"` Algorithms []map[string]any `json:"algorithms,omitempty"` EncryptAtRest bool `json:"encryptAtRest,omitempty"` IsSample bool `json:"isSample,omitempty"` Publishable bool `json:"publishable,omitempty"` Passed bool `json:"passed,omitempty"` }
type ValidationResults ¶
type ValidationResults struct { Retry uint64 `json:"retry,omitempty"` ID uint64 `json:"vsId"` Disposition string `json:"disposition"` Tests []struct { ID uint64 `json:"tcId"` Result string `json:"result"` Reason string `json:"reason"` Expected map[string]any `json:"expected,omitempty"` Provided map[string]any `json:"provided,omitempty"` } `json:"tests"` }
type Vendor ¶
type Vendor struct { URL string `json:"url,omitempty"` Name string `json:"name,omitempty"` ParentURL string `json:"parentUrl,omitempty"` Website string `json:"website,omitempty"` Emails []string `json:"emails,omitempty"` ContactsURL string `json:"contactsUrl,omitempty"` Addresses []Address `json:"addresses,omitempty"` }
https://pages.nist.gov/ACVP/draft-fussell-acvp-spec.html#rfc.section.11.8.3.1