check

package
v0.0.0-...-29191c4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const LCPProfileBasic = "http://readium.org/lcp/basic-profile"

Variables

This section is empty.

Functions

func CheckResource

func CheckResource(href string) error

CheckResource verifies that the target of a link can be accessed

func Checker

func Checker(bytes []byte, passphrase string, level uint) error

Checker verifies a license, its license status and the fresh license. Parameters: bytes is a set of bytes representing the license passphrase is the license passphrase, which may be empty level is a level of tests. Access to the status document requires level 2 or upper. Modifications of the license require level 3 or upper.

Types

type ErrResponse

type ErrResponse struct {
	Type   string `json:"type"` // url
	Title  string `json:"title"`
	Status int    `json:"status"` // http status code
}

ErrResponse is the expected structure fetched from the LCP Server in cas of an error.

type LicenseChecker

type LicenseChecker struct {
	// contains filtered or unexported fields
}

LicenseChecker is the structure passed to every checker method

func (c *LicenseChecker) CheckActionableLinks() error

Verifies actionable links

func (*LicenseChecker) CheckCertificateChain

func (c *LicenseChecker) CheckCertificateChain() (*time.Time, error)

Verifies the certificate chain

func (c *LicenseChecker) CheckHintPageLink() error

Verifies the hint page link

func (*LicenseChecker) CheckLastUpdate

func (c *LicenseChecker) CheckLastUpdate(endCertificate *time.Time) error

Verifies that the date of last update predates the expiration of the provider certificate note: there is no issue if the creation of a certificate happens after the last update of a license; this happens when the certificate is updated.

func (*LicenseChecker) CheckLicense

func (c *LicenseChecker) CheckLicense(passphrase string) error

CheckLicense perfoms multiple tests on a license

func (c *LicenseChecker) CheckLicenseLink() error

Verifies the link to the fresh license

func (*LicenseChecker) CheckLicenseProfile

func (c *LicenseChecker) CheckLicenseProfile() error

Verifies the profile of the license

func (*LicenseChecker) CheckLicenseRights

func (c *LicenseChecker) CheckLicenseRights() error

Verifies license rights

func (*LicenseChecker) CheckPassphrase

func (c *LicenseChecker) CheckPassphrase(passphrase string) error

Check the passphrase

func (c *LicenseChecker) CheckPublicationLink() error

Verifies the publication link

func (*LicenseChecker) CheckRegister

func (c *LicenseChecker) CheckRegister() error

CheckRegister verifies register features

func (*LicenseChecker) CheckRenew

func (c *LicenseChecker) CheckRenew() error

CheckRenew verifies renew features

func (*LicenseChecker) CheckReturn

func (c *LicenseChecker) CheckReturn() error

CheckReturn verifies return features

func (*LicenseChecker) CheckSignature

func (c *LicenseChecker) CheckSignature() error

Verifies the signature

func (*LicenseChecker) CheckStatusDoc

func (c *LicenseChecker) CheckStatusDoc() error

Check the license status document

func (c *LicenseChecker) CheckStatusDocLink() error

Verifies the status document link

func (*LicenseChecker) CheckUserInfo

func (c *LicenseChecker) CheckUserInfo() error

Verifies user info

func (*LicenseChecker) GetFreshLicense

func (c *LicenseChecker) GetFreshLicense() error

Get a fresh license from the provider system

func (*LicenseChecker) GetStatusDoc

func (c *LicenseChecker) GetStatusDoc() error

GetStatusDoc gets a license status from the URL passed in parameter

func (c *LicenseChecker) GetStatusLink(linkRel string) *lic.Link

get a link by its name

func (*LicenseChecker) ProcessResponse

func (c *LicenseChecker) ProcessResponse(r *http.Response) error

ProcessResponse processes the response to a register, renew or return request

func (*LicenseChecker) ShowLicenseInfo

func (c *LicenseChecker) ShowLicenseInfo() error

ShowLicenseInfo displays information about the license

func (*LicenseChecker) UpdateLicense

func (c *LicenseChecker) UpdateLicense() error

Update a license using register / renew / return features

func (*LicenseChecker) ValidateStatusDoc

func (c *LicenseChecker) ValidateStatusDoc() error

Check the validity of the status doc using the JSON schema

Jump to

Keyboard shortcuts

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