mirror of
https://github.com/mainflux/mainflux.git
synced 2025-05-01 13:48:56 +08:00

* Add authorization HTTP API to things service Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Add new tests and update existing ones Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update swagger documentation Update swagger documentation for auth endpoints. Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update README docs for things service Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Update docker-compose and fix endpoint typo Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com> * Remove commented code Signed-off-by: Aleksandar Novakovic <anovakovic01@gmail.com>
27 lines
382 B
Go
27 lines
382 B
Go
//
|
|
// Copyright (c) 2018
|
|
// Mainflux
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package grpc
|
|
|
|
import "github.com/mainflux/mainflux/things"
|
|
|
|
type accessReq struct {
|
|
thingKey string
|
|
chanID string
|
|
}
|
|
|
|
func (req accessReq) validate() error {
|
|
if req.chanID == "" || req.thingKey == "" {
|
|
return things.ErrMalformedEntity
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type identifyReq struct {
|
|
key string
|
|
}
|