2019-10-07 22:14:47 +08:00
|
|
|
// Copyright (c) Mainflux
|
2018-08-26 19:15:48 +08:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2018-05-11 05:53:25 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package mainflux;
|
|
|
|
|
2019-07-16 00:28:15 +08:00
|
|
|
import "google/protobuf/empty.proto";
|
|
|
|
|
2018-05-15 23:13:09 +08:00
|
|
|
service ThingsService {
|
2019-10-22 05:24:45 +08:00
|
|
|
rpc CanAccessByKey(AccessByKeyReq) returns (ThingID) {}
|
2019-07-16 00:28:15 +08:00
|
|
|
rpc CanAccessByID(AccessByIDReq) returns (google.protobuf.Empty) {}
|
2018-05-21 18:51:46 +08:00
|
|
|
rpc Identify(Token) returns (ThingID) {}
|
2018-05-11 05:53:25 +08:00
|
|
|
}
|
|
|
|
|
2019-12-16 23:22:09 +08:00
|
|
|
service AuthNService {
|
|
|
|
rpc Issue(IssueReq) returns (Token) {}
|
2018-05-21 18:51:46 +08:00
|
|
|
rpc Identify(Token) returns (UserID) {}
|
2018-05-11 05:53:25 +08:00
|
|
|
}
|
|
|
|
|
2019-10-22 05:24:45 +08:00
|
|
|
message AccessByKeyReq {
|
2019-12-16 23:22:09 +08:00
|
|
|
string token = 1;
|
2018-12-05 20:09:25 +08:00
|
|
|
string chanID = 2;
|
2018-05-21 18:51:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
message ThingID {
|
2018-12-05 20:09:25 +08:00
|
|
|
string value = 1;
|
2018-05-11 05:53:25 +08:00
|
|
|
}
|
|
|
|
|
2019-07-16 00:28:15 +08:00
|
|
|
message AccessByIDReq {
|
|
|
|
string thingID = 1;
|
2019-12-16 23:22:09 +08:00
|
|
|
string chanID = 2;
|
2019-07-16 00:28:15 +08:00
|
|
|
}
|
|
|
|
|
2019-12-16 23:22:09 +08:00
|
|
|
// If a token is not carrying any information itself, the type
|
|
|
|
// field can be used to determine how to validate the token.
|
|
|
|
// Also, different tokens can be encoded in different ways.
|
2018-05-11 05:53:25 +08:00
|
|
|
message Token {
|
|
|
|
string value = 1;
|
|
|
|
}
|
|
|
|
|
2018-05-21 18:51:46 +08:00
|
|
|
message UserID {
|
2018-05-11 05:53:25 +08:00
|
|
|
string value = 1;
|
|
|
|
}
|
2019-12-16 23:22:09 +08:00
|
|
|
|
|
|
|
message IssueReq {
|
|
|
|
string issuer = 1;
|
|
|
|
uint32 type = 2;
|
|
|
|
}
|