http

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: BSD-3-Clause Imports: 32 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIHandler added in v0.8.5

func APIHandler(ctx context.Context, accountManager s.AccountManager, LocationManager *geolocation.Geolocation, jwtValidator jwtclaims.JWTValidator, appMetrics telemetry.AppMetrics, authCfg AuthCfg, integratedValidator integrated_validator.IntegratedValidator) (http.Handler, error)

APIHandler creates the Management service HTTP API handler registering all the available endpoints.

Types

type AccountsHandler added in v0.14.2

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

AccountsHandler is a handler that handles the server.Account HTTP endpoints

func NewAccountsHandler added in v0.14.2

func NewAccountsHandler(accountManager server.AccountManager, authCfg AuthCfg) *AccountsHandler

NewAccountsHandler creates a new AccountsHandler HTTP handler

func (*AccountsHandler) DeleteAccount added in v0.24.4

func (h *AccountsHandler) DeleteAccount(w http.ResponseWriter, r *http.Request)

DeleteAccount is a HTTP DELETE handler to delete an account

func (*AccountsHandler) GetAllAccounts added in v0.14.2

func (h *AccountsHandler) GetAllAccounts(w http.ResponseWriter, r *http.Request)

GetAllAccounts is HTTP GET handler that returns a list of accounts. Effectively returns just a single account.

func (*AccountsHandler) UpdateAccount added in v0.14.2

func (h *AccountsHandler) UpdateAccount(w http.ResponseWriter, r *http.Request)

UpdateAccount is HTTP PUT handler that updates the provided account. Updates only account settings (server.Settings)

type AuthCfg added in v0.13.0

type AuthCfg struct {
	Issuer       string
	Audience     string
	UserIDClaim  string
	KeysLocation string
}

AuthCfg contains parameters for authentication middleware

type DNSSettingsHandler added in v0.14.2

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

DNSSettingsHandler is a handler that returns the DNS settings of the account

func NewDNSSettingsHandler added in v0.14.2

func NewDNSSettingsHandler(accountManager server.AccountManager, authCfg AuthCfg) *DNSSettingsHandler

NewDNSSettingsHandler returns a new instance of DNSSettingsHandler handler

func (*DNSSettingsHandler) GetDNSSettings added in v0.14.2

func (h *DNSSettingsHandler) GetDNSSettings(w http.ResponseWriter, r *http.Request)

GetDNSSettings returns the DNS settings for the account

func (*DNSSettingsHandler) UpdateDNSSettings added in v0.14.2

func (h *DNSSettingsHandler) UpdateDNSSettings(w http.ResponseWriter, r *http.Request)

UpdateDNSSettings handles update to DNS settings of an account

type EventsHandler added in v0.14.2

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

EventsHandler HTTP handler

func NewEventsHandler added in v0.14.2

func NewEventsHandler(accountManager server.AccountManager, authCfg AuthCfg) *EventsHandler

NewEventsHandler creates a new EventsHandler HTTP handler

func (*EventsHandler) GetAllEvents added in v0.14.2

func (h *EventsHandler) GetAllEvents(w http.ResponseWriter, r *http.Request)

GetAllEvents list of the given account

type GeolocationsHandler added in v0.26.0

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

GeolocationsHandler is a handler that returns locations.

func NewGeolocationsHandlerHandler added in v0.26.0

func NewGeolocationsHandlerHandler(accountManager server.AccountManager, geolocationManager *geolocation.Geolocation, authCfg AuthCfg) *GeolocationsHandler

NewGeolocationsHandlerHandler creates a new Geolocations handler

func (*GeolocationsHandler) GetAllCountries added in v0.26.0

func (l *GeolocationsHandler) GetAllCountries(w http.ResponseWriter, r *http.Request)

GetAllCountries retrieves a list of all countries

func (*GeolocationsHandler) GetCitiesByCountry added in v0.26.0

func (l *GeolocationsHandler) GetCitiesByCountry(w http.ResponseWriter, r *http.Request)

GetCitiesByCountry retrieves a list of cities based on the given country code

type GroupsHandler added in v0.14.2

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

GroupsHandler is a handler that returns groups of the account

func NewGroupsHandler added in v0.14.2

func NewGroupsHandler(accountManager server.AccountManager, authCfg AuthCfg) *GroupsHandler

NewGroupsHandler creates a new GroupsHandler HTTP handler

func (*GroupsHandler) CreateGroup added in v0.14.2

func (h *GroupsHandler) CreateGroup(w http.ResponseWriter, r *http.Request)

CreateGroup handles group creation request

func (*GroupsHandler) DeleteGroup added in v0.14.2

func (h *GroupsHandler) DeleteGroup(w http.ResponseWriter, r *http.Request)

DeleteGroup handles group deletion request

func (*GroupsHandler) GetAllGroups added in v0.14.2

func (h *GroupsHandler) GetAllGroups(w http.ResponseWriter, r *http.Request)

GetAllGroups list for the account

func (*GroupsHandler) GetGroup added in v0.14.2

func (h *GroupsHandler) GetGroup(w http.ResponseWriter, r *http.Request)

GetGroup returns a group

func (*GroupsHandler) UpdateGroup added in v0.14.2

func (h *GroupsHandler) UpdateGroup(w http.ResponseWriter, r *http.Request)

UpdateGroup handles update to a group identified by a given ID

type NameserversHandler added in v0.14.2

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

NameserversHandler is the nameserver group handler of the account

func NewNameserversHandler added in v0.14.2

func NewNameserversHandler(accountManager server.AccountManager, authCfg AuthCfg) *NameserversHandler

NewNameserversHandler returns a new instance of NameserversHandler handler

func (*NameserversHandler) CreateNameserverGroup added in v0.14.2

func (h *NameserversHandler) CreateNameserverGroup(w http.ResponseWriter, r *http.Request)

CreateNameserverGroup handles nameserver group creation request

func (*NameserversHandler) DeleteNameserverGroup added in v0.14.2

func (h *NameserversHandler) DeleteNameserverGroup(w http.ResponseWriter, r *http.Request)

DeleteNameserverGroup handles nameserver group deletion request

func (*NameserversHandler) GetAllNameservers added in v0.14.2

func (h *NameserversHandler) GetAllNameservers(w http.ResponseWriter, r *http.Request)

GetAllNameservers returns the list of nameserver groups for the account

func (*NameserversHandler) GetNameserverGroup added in v0.14.2

func (h *NameserversHandler) GetNameserverGroup(w http.ResponseWriter, r *http.Request)

GetNameserverGroup handles a nameserver group Get request identified by ID

func (*NameserversHandler) UpdateNameserverGroup added in v0.14.2

func (h *NameserversHandler) UpdateNameserverGroup(w http.ResponseWriter, r *http.Request)

UpdateNameserverGroup handles update to a nameserver group identified by a given ID

type PATHandler added in v0.14.6

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

PATHandler is the nameserver group handler of the account

func NewPATsHandler added in v0.14.6

func NewPATsHandler(accountManager server.AccountManager, authCfg AuthCfg) *PATHandler

NewPATsHandler creates a new PATHandler HTTP handler

func (*PATHandler) CreateToken added in v0.14.6

func (h *PATHandler) CreateToken(w http.ResponseWriter, r *http.Request)

CreateToken is HTTP POST handler that creates a personal access token for the given user

func (*PATHandler) DeleteToken added in v0.14.6

func (h *PATHandler) DeleteToken(w http.ResponseWriter, r *http.Request)

DeleteToken is HTTP DELETE handler that deletes a personal access token for the given user

func (*PATHandler) GetAllTokens added in v0.14.6

func (h *PATHandler) GetAllTokens(w http.ResponseWriter, r *http.Request)

GetAllTokens is HTTP GET handler that returns a list of all personal access tokens for the given user

func (*PATHandler) GetToken added in v0.14.6

func (h *PATHandler) GetToken(w http.ResponseWriter, r *http.Request)

GetToken is HTTP GET handler that returns a personal access token for the given user

type PeersHandler added in v0.14.2

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

PeersHandler is a handler that returns peers of the account

func NewPeersHandler added in v0.14.2

func NewPeersHandler(accountManager server.AccountManager, authCfg AuthCfg) *PeersHandler

NewPeersHandler creates a new PeersHandler HTTP handler

func (*PeersHandler) GetAccessiblePeers added in v0.29.2

func (h *PeersHandler) GetAccessiblePeers(w http.ResponseWriter, r *http.Request)

GetAccessiblePeers returns a list of all peers that the specified peer can connect to within the network.

func (*PeersHandler) GetAllPeers added in v0.14.2

func (h *PeersHandler) GetAllPeers(w http.ResponseWriter, r *http.Request)

GetAllPeers returns a list of all peers associated with a provided account

func (*PeersHandler) HandlePeer added in v0.14.2

func (h *PeersHandler) HandlePeer(w http.ResponseWriter, r *http.Request)

HandlePeer handles all peer requests for GET, PUT and DELETE operations

type Policies added in v0.14.5

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

Policies is a handler that returns policy of the account

func NewPoliciesHandler added in v0.14.5

func NewPoliciesHandler(accountManager server.AccountManager, authCfg AuthCfg) *Policies

NewPoliciesHandler creates a new Policies handler

func (*Policies) CreatePolicy added in v0.14.5

func (h *Policies) CreatePolicy(w http.ResponseWriter, r *http.Request)

CreatePolicy handles policy creation request

func (*Policies) DeletePolicy added in v0.14.5

func (h *Policies) DeletePolicy(w http.ResponseWriter, r *http.Request)

DeletePolicy handles policy deletion request

func (*Policies) GetAllPolicies added in v0.14.5

func (h *Policies) GetAllPolicies(w http.ResponseWriter, r *http.Request)

GetAllPolicies list for the account

func (*Policies) GetPolicy added in v0.14.5

func (h *Policies) GetPolicy(w http.ResponseWriter, r *http.Request)

GetPolicy handles a group Get request identified by ID

func (*Policies) UpdatePolicy added in v0.14.5

func (h *Policies) UpdatePolicy(w http.ResponseWriter, r *http.Request)

UpdatePolicy handles update to a policy identified by a given ID

type PostureChecksHandler added in v0.26.0

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

PostureChecksHandler is a handler that returns posture checks of the account.

func NewPostureChecksHandler added in v0.26.0

func NewPostureChecksHandler(accountManager server.AccountManager, geolocationManager *geolocation.Geolocation, authCfg AuthCfg) *PostureChecksHandler

NewPostureChecksHandler creates a new PostureChecks handler

func (*PostureChecksHandler) CreatePostureCheck added in v0.26.0

func (p *PostureChecksHandler) CreatePostureCheck(w http.ResponseWriter, r *http.Request)

CreatePostureCheck handles posture check creation request

func (*PostureChecksHandler) DeletePostureCheck added in v0.26.0

func (p *PostureChecksHandler) DeletePostureCheck(w http.ResponseWriter, r *http.Request)

DeletePostureCheck handles posture check deletion request

func (*PostureChecksHandler) GetAllPostureChecks added in v0.26.0

func (p *PostureChecksHandler) GetAllPostureChecks(w http.ResponseWriter, r *http.Request)

GetAllPostureChecks list for the account

func (*PostureChecksHandler) GetPostureCheck added in v0.26.0

func (p *PostureChecksHandler) GetPostureCheck(w http.ResponseWriter, r *http.Request)

GetPostureCheck handles a posture check Get request identified by ID

func (*PostureChecksHandler) UpdatePostureCheck added in v0.26.0

func (p *PostureChecksHandler) UpdatePostureCheck(w http.ResponseWriter, r *http.Request)

UpdatePostureCheck handles update to a posture check identified by a given ID

type RoutesHandler added in v0.14.2

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

RoutesHandler is the routes handler of the account

func NewRoutesHandler added in v0.14.2

func NewRoutesHandler(accountManager server.AccountManager, authCfg AuthCfg) *RoutesHandler

NewRoutesHandler returns a new instance of RoutesHandler handler

func (*RoutesHandler) CreateRoute added in v0.14.2

func (h *RoutesHandler) CreateRoute(w http.ResponseWriter, r *http.Request)

CreateRoute handles route creation request

func (*RoutesHandler) DeleteRoute added in v0.14.2

func (h *RoutesHandler) DeleteRoute(w http.ResponseWriter, r *http.Request)

DeleteRoute handles route deletion request

func (*RoutesHandler) GetAllRoutes added in v0.14.2

func (h *RoutesHandler) GetAllRoutes(w http.ResponseWriter, r *http.Request)

GetAllRoutes returns the list of routes for the account

func (*RoutesHandler) GetRoute added in v0.14.2

func (h *RoutesHandler) GetRoute(w http.ResponseWriter, r *http.Request)

GetRoute handles a route Get request identified by ID

func (*RoutesHandler) UpdateRoute added in v0.14.2

func (h *RoutesHandler) UpdateRoute(w http.ResponseWriter, r *http.Request)

UpdateRoute handles update to a route identified by a given ID

type SetupKeysHandler added in v0.14.2

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

SetupKeysHandler is a handler that returns a list of setup keys of the account

func NewSetupKeysHandler added in v0.8.5

func NewSetupKeysHandler(accountManager server.AccountManager, authCfg AuthCfg) *SetupKeysHandler

NewSetupKeysHandler creates a new SetupKeysHandler HTTP handler

func (*SetupKeysHandler) CreateSetupKey added in v0.14.2

func (h *SetupKeysHandler) CreateSetupKey(w http.ResponseWriter, r *http.Request)

CreateSetupKey is a POST requests that creates a new SetupKey

func (*SetupKeysHandler) GetAllSetupKeys added in v0.14.2

func (h *SetupKeysHandler) GetAllSetupKeys(w http.ResponseWriter, r *http.Request)

GetAllSetupKeys is a GET request that returns a list of SetupKey

func (*SetupKeysHandler) GetSetupKey added in v0.14.2

func (h *SetupKeysHandler) GetSetupKey(w http.ResponseWriter, r *http.Request)

GetSetupKey is a GET request to get a SetupKey by ID

func (*SetupKeysHandler) UpdateSetupKey added in v0.14.2

func (h *SetupKeysHandler) UpdateSetupKey(w http.ResponseWriter, r *http.Request)

UpdateSetupKey is a PUT request to update server.SetupKey

type UsersHandler added in v0.14.2

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

UsersHandler is a handler that returns users of the account

func NewUsersHandler added in v0.14.2

func NewUsersHandler(accountManager server.AccountManager, authCfg AuthCfg) *UsersHandler

NewUsersHandler creates a new UsersHandler HTTP handler

func (*UsersHandler) CreateUser added in v0.14.2

func (h *UsersHandler) CreateUser(w http.ResponseWriter, r *http.Request)

CreateUser creates a User in the system with a status "invited" (effectively this is a user invite).

func (*UsersHandler) DeleteUser added in v0.17.0

func (h *UsersHandler) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser is a DELETE request to delete a user

func (*UsersHandler) GetAllUsers added in v0.14.2

func (h *UsersHandler) GetAllUsers(w http.ResponseWriter, r *http.Request)

GetAllUsers returns a list of users of the account this user belongs to. It also gathers additional user data (like email and name) from the IDP manager.

func (*UsersHandler) InviteUser added in v0.21.9

func (h *UsersHandler) InviteUser(w http.ResponseWriter, r *http.Request)

InviteUser resend invitations to users who haven't activated their accounts, prior to the expiration period.

func (*UsersHandler) UpdateUser added in v0.14.2

func (h *UsersHandler) UpdateUser(w http.ResponseWriter, r *http.Request)

UpdateUser is a PUT requests to update User data

Directories

Path Synopsis
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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