http

package
v0.0.0-...-2e0ac8a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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 2018 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")

	DevStatuses = []string{model.DevStatusPending, model.DevStatusRejected, model.DevStatusAccepted, model.DevStatusPreauth}
)

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
	GetApp() (rest.App, 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) DeleteDeviceAuthSetHandler

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

func (*DevAuthApiHandlers) DeleteDeviceAuthSetV1Handler

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

func (*DevAuthApiHandlers) DeleteDeviceHandler

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

func (*DevAuthApiHandlers) DeleteDeviceV1Handler

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

func (*DevAuthApiHandlers) DeleteTokenHandler

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

func (*DevAuthApiHandlers) DeleteTokenV1Handler

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

func (*DevAuthApiHandlers) DeleteTokensHandler

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

func (*DevAuthApiHandlers) DevAdmDeleteDeviceAuthSetHandler

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

func (*DevAuthApiHandlers) DevAdmGetAuthSetStatusHandler

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

func (*DevAuthApiHandlers) DevAdmGetDeviceHandler

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

func (*DevAuthApiHandlers) DevAdmGetDevicesHandler

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

func (*DevAuthApiHandlers) DevAdmUpdateAuthSetStatusHandler

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

func (*DevAuthApiHandlers) GetApp

func (d *DevAuthApiHandlers) GetApp() (rest.App, error)

func (*DevAuthApiHandlers) GetAuthSetStatusHandler

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

func (*DevAuthApiHandlers) GetDeviceHandler

func (d *DevAuthApiHandlers) GetDeviceHandler(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) GetDevicesCountV1Handler

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

func (*DevAuthApiHandlers) GetDevicesHandler

func (d *DevAuthApiHandlers) GetDevicesHandler(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) GetLimitV1Handler

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

func (*DevAuthApiHandlers) GetTenantDeviceStatus

func (d *DevAuthApiHandlers) GetTenantDeviceStatus(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) PostDevicesHandler

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

func (*DevAuthApiHandlers) PostDevicesV2Handler

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

func (*DevAuthApiHandlers) PreauthDeviceHandler

func (d *DevAuthApiHandlers) PreauthDeviceHandler(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) 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) UpdateDeviceStatusV1Handler

func (d *DevAuthApiHandlers) UpdateDeviceStatusV1Handler(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