api

package
v0.0.0-...-91f739d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API holds the server API. Use api.New() to construct.

func New

func New(db database.Database) API

New creates a new API struct with the given database and the proper unexported fields.

func (API) CheckConnection

func (api API) CheckConnection() error

CheckConnection tests if we can connect the database.

func (API) DebugAllStates

func (api API) DebugAllStates(w http.ResponseWriter, r *http.Request)

DebugAllStates allows preloading a domain without any checks. This should only be exposed for test servers.

func (API) DebugSetPreloaded

func (api API) DebugSetPreloaded(w http.ResponseWriter, r *http.Request)

DebugSetPreloaded allows preloading a domain without any checks. This should only be exposed for test servers.

func (API) DebugSetRejected

func (api API) DebugSetRejected(w http.ResponseWriter, r *http.Request)

DebugSetRejected allows rejecting a domain without any checks. This should only be exposed for test servers.

func (API) Pending

func (api API) Pending(w http.ResponseWriter, r *http.Request)

Pending returns a list of domains with status "pending".

Example: GET /pending

func (API) PendingAutomatedRemoval

func (api API) PendingAutomatedRemoval(w http.ResponseWriter, r *http.Request)

PendingAutomatedRemoval returns a lsit of domain with status "pending-automated-removal"

Example: Get /pending-automated-removal

func (API) PendingRemoval

func (api API) PendingRemoval(w http.ResponseWriter, r *http.Request)

PendingRemoval returns a list of domains with status "pending-removal".

Example: GET /pending-removal

func (API) Preloadable

func (api API) Preloadable(w http.ResponseWriter, r *http.Request)

Preloadable takes a single domain and returns if it is preloadable.

Example: GET /preloadable?domain=garron.net

func (API) Removable

func (api API) Removable(w http.ResponseWriter, r *http.Request)

Removable takes a single domain and returns if it is removable.

Example: GET /removable?domain=garron.net

func (API) Remove

func (api API) Remove(w http.ResponseWriter, r *http.Request)

Remove takes a single domain and attempts to submit it to the removal queue for the HSTS preload list.

Although the method is POST, we currently use a URL parameter so that it's easy to use in the same way as the other domain endpoints.

Example: POST /remove?domain=garron.net

func (API) RemoveIneligibleDomains

func (api API) RemoveIneligibleDomains(w http.ResponseWriter, r *http.Request)

Example: GET /remove-ineligible-domains

func (API) Status

func (api API) Status(w http.ResponseWriter, r *http.Request)

Status takes a single domain and returns its preload status.

Example: GET /status?domain=garron.net

func (API) Submit

func (api API) Submit(w http.ResponseWriter, r *http.Request)

Submit takes a single domain and attempts to submit it to the pending queue for the HSTS preload list.

Although the method is POST, we currently use a URL parameter so that it's easy to use in the same way as the other domain endpoints.

Example: POST /submit?domain=garron.net

func (API) Update

func (api API) Update(w http.ResponseWriter, r *http.Request)

Update tells the server to update pending/removed entries based on the HSTS preload list source.

Example: GET /update

type DomainStateWithBulk

type DomainStateWithBulk struct {
	*database.DomainState
	Bulk            bool   `json:"bulk"`
	PreloadedDomain string `json:"preloadedDomain"`
}

DomainStateWithBulk is a DomainState that also includes information about the bulk status of the domain.

type DomainStateWithIssues

type DomainStateWithIssues struct {
	DomainState database.DomainState
	Issues      hstspreload.Issues
}

Jump to

Keyboard shortcuts

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