http

package
v0.0.0-...-252f4b7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Overview

Copyright 2023 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2023 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2023 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2023 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copyright 2023 Northern.tech AS

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Index

Constants

View Source
const (
	HdrAuthReqSign = "X-MEN-Signature"
)

Variables

View Source
var (
	ErrIncorrectStatus = errors.New("incorrect device status")
	ErrNoAuthHeader    = errors.New("no authorization header")
)

Functions

func AllowHeaderOptionsGenerator

func AllowHeaderOptionsGenerator(methods []string) rest.HandlerFunc

func AutogenOptionsRoutes

func AutogenOptionsRoutes(routes []*rest.Route, gen HttpOptionsGenerator) []*rest.Route

Automatically add OPTIONS method support for each defined route, only if there's no OPTIONS handler for that route yet

func ContextFromRequest

func ContextFromRequest(r *rest.Request) *api.RequestContext

Types

type ApiHandler

type ApiHandler interface {
	// produce a rest.App with routing setup or an error
	Build() (http.Handler, error)
}

thin API handler interface

func NewDevAuthApiHandlers

func NewDevAuthApiHandlers(devAuth devauth.App, db store.DataStore) ApiHandler

type DevAuthApiHandlers

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

func (*DevAuthApiHandlers) AliveHandler

func (d *DevAuthApiHandlers) AliveHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) Build

func (d *DevAuthApiHandlers) Build() (http.Handler, error)

func (*DevAuthApiHandlers) DecommissionDeviceHandler

func (d *DevAuthApiHandlers) DecommissionDeviceHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) DeleteDeviceAuthSetHandler

func (d *DevAuthApiHandlers) DeleteDeviceAuthSetHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) DeleteDeviceHandler

func (d *DevAuthApiHandlers) DeleteDeviceHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) DeleteTenantLimitHandler

func (d *DevAuthApiHandlers) DeleteTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) DeleteTokenHandler

func (d *DevAuthApiHandlers) DeleteTokenHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) DeleteTokensHandler

func (d *DevAuthApiHandlers) DeleteTokensHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetAuthSetStatusHandler

func (d *DevAuthApiHandlers) GetAuthSetStatusHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetDeviceV2Handler

func (d *DevAuthApiHandlers) GetDeviceV2Handler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetDevicesCountHandler

func (d *DevAuthApiHandlers) GetDevicesCountHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetDevicesV2Handler

func (d *DevAuthApiHandlers) GetDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetLimitHandler

func (d *DevAuthApiHandlers) GetLimitHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetTenantDeviceStatus

func (d *DevAuthApiHandlers) GetTenantDeviceStatus(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetTenantDevicesCountHandler

func (d *DevAuthApiHandlers) GetTenantDevicesCountHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetTenantDevicesHandler

func (d *DevAuthApiHandlers) GetTenantDevicesHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) GetTenantLimitHandler

func (d *DevAuthApiHandlers) GetTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) HealthCheckHandler

func (d *DevAuthApiHandlers) HealthCheckHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) PostDevicesV2Handler

func (d *DevAuthApiHandlers) PostDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) ProvisionTenantHandler

func (d *DevAuthApiHandlers) ProvisionTenantHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) PutTenantLimitHandler

func (d *DevAuthApiHandlers) PutTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) SearchDevicesV2Handler

func (d *DevAuthApiHandlers) SearchDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) SubmitAuthRequestHandler

func (d *DevAuthApiHandlers) SubmitAuthRequestHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) UpdateDeviceStatusHandler

func (d *DevAuthApiHandlers) UpdateDeviceStatusHandler(w rest.ResponseWriter, r *rest.Request)

func (*DevAuthApiHandlers) VerifyTokenHandler

func (d *DevAuthApiHandlers) VerifyTokenHandler(w rest.ResponseWriter, r *rest.Request)

type DevAuthApiStatus

type DevAuthApiStatus struct {
	Status string `json:"status"`
}

type HttpOptionsGenerator

type HttpOptionsGenerator func(methods []string) rest.HandlerFunc

type LimitValue

type LimitValue struct {
	Limit uint64 `json:"limit"`
}

Jump to

Keyboard shortcuts

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