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
- Variables
- func AllowHeaderOptionsGenerator(methods []string) rest.HandlerFunc
- func AutogenOptionsRoutes(routes []*rest.Route, gen HttpOptionsGenerator) []*rest.Route
- func ContextFromRequest(r *rest.Request) *api.RequestContext
- type ApiHandler
- type DevAuthApiHandlers
- func (d *DevAuthApiHandlers) AliveHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) Build() (http.Handler, error)
- func (d *DevAuthApiHandlers) DecommissionDeviceHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) DeleteDeviceAuthSetHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) DeleteDeviceHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) DeleteTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) DeleteTokenHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) DeleteTokensHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetAuthSetStatusHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetDeviceV2Handler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetDevicesCountHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetLimitHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetTenantDeviceStatus(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetTenantDevicesCountHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetTenantDevicesHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) GetTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) HealthCheckHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) PostDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) ProvisionTenantHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) PutTenantLimitHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) SearchDevicesV2Handler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) SubmitAuthRequestHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) UpdateDeviceStatusHandler(w rest.ResponseWriter, r *rest.Request)
- func (d *DevAuthApiHandlers) VerifyTokenHandler(w rest.ResponseWriter, r *rest.Request)
- type DevAuthApiStatus
- type HttpOptionsGenerator
- type LimitValue
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) 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"`
}
Click to show internal directories.
Click to hide internal directories.