mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
ac8dadefc6
Continuous Delivery / lint-and-build (push) Has been cancelled
Continuous Delivery / Build and Push Docker Images (push) Has been cancelled
Deploy GitHub Pages / swagger-ui (push) Has been cancelled
CI Pipeline / Lint Proto (push) Has been cancelled
CI Pipeline / lint-and-build (push) Has been cancelled
CI Pipeline / Detect Changes (push) Has been cancelled
CI Pipeline / Test ${{ matrix.module }} (push) Has been cancelled
CI Pipeline / Upload Coverage (push) Has been cancelled
Property Based Tests / api-test (push) Has been cancelled
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
59 lines
1.1 KiB
Protocol Buffer
59 lines
1.1 KiB
Protocol Buffer
// Copyright (c) Abstract Machines
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
syntax = "proto3";
|
|
|
|
package auth.v1;
|
|
option go_package = "github.com/absmach/magistrala/api/grpc/auth/v1";
|
|
|
|
// AuthService is a service that provides authentication
|
|
// and authorization functionalities for Magistrala services.
|
|
service AuthService {
|
|
rpc Authorize(AuthZReq) returns (AuthZRes) {}
|
|
rpc Authenticate(AuthNReq) returns (AuthNRes) {}
|
|
}
|
|
|
|
|
|
message AuthNReq {
|
|
string token = 1;
|
|
}
|
|
|
|
message AuthNRes {
|
|
string id = 1;
|
|
string user_id = 2;
|
|
uint32 user_role = 3;
|
|
bool verified = 4;
|
|
uint32 token_type = 5;
|
|
}
|
|
|
|
message PolicyReq {
|
|
string domain = 1;
|
|
string subject_type = 2;
|
|
string subject_kind = 3;
|
|
string subject_relation = 4;
|
|
string subject = 5;
|
|
string relation = 6;
|
|
string permission = 7;
|
|
string object = 8;
|
|
string object_type = 9;
|
|
}
|
|
|
|
message PATReq {
|
|
string pat_id = 1;
|
|
string domain = 2;
|
|
string operation = 3;
|
|
string user_id = 4;
|
|
string entity_id = 5;
|
|
string entity_type = 6;
|
|
}
|
|
|
|
message AuthZReq {
|
|
PolicyReq policy_req = 1;
|
|
optional PATReq pat_req = 2;
|
|
}
|
|
|
|
message AuthZRes {
|
|
bool authorized = 1;
|
|
string id = 2;
|
|
}
|