Mainflux.mainflux/things/policies/auth.proto

39 lines
876 B
Protocol Buffer

// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package mainflux.things.policies;
option go_package = "./policies";
// AuthService is a service that provides authentication and authorization
// functionalities for the things service.
service AuthService {
// Authorize checks if the subject is authorized to perform
// the action on the object.
rpc Authorize(AuthorizeReq) returns (AuthorizeRes) {}
// Identify returns the ID of the thing has the given secret.
rpc Identify(IdentifyReq) returns (IdentifyRes) {}
}
message AuthorizeReq {
string subject = 1;
string object = 2;
string action = 3;
string entityType = 4;
}
message AuthorizeRes {
string thingID = 1;
bool authorized = 2;
}
message IdentifyReq {
string secret = 1;
}
message IdentifyRes {
string id = 1;
}