-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathauth.proto
95 lines (86 loc) · 2.35 KB
/
auth.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
syntax = "proto3";
option go_package = "github.com/clyso/ceph-api/api/ceph;pb";
package ceph;
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
service Auth {
rpc Login(LoginReq) returns (LoginResp);
rpc Logout(google.protobuf.Empty) returns(google.protobuf.Empty);
rpc Check(TokenCheckReq)returns(TokenCheckResp);
}
message LoginReq{
string username=1;
string password=2;
}
message LoginResp{
string token =1;
string username =2;
bool pwd_update_required =3;
optional google.protobuf.Timestamp pwd_expiration_date =4;
bool sso =5;
map<string,google.protobuf.ListValue> permissions=6 ;
}
message TokenCheckReq{
string token =1;
}
message TokenCheckResp{
string username =1;
bool pwd_update_required =2;
optional google.protobuf.Timestamp pwd_expiration_date =3;
bool sso =4;
map<string,google.protobuf.ListValue> permissions=5 ;
}
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Ceph management API";
// version: "1.0";
contact: {
name: "Ceph API";
url: "https://github.com/clyso/ceph-api";
// email: "[email protected]";
};
license: {
name: "GPL-3.0 license";
url: "https://github.com/clyso/ceph-api/blob/main/LICENSE";
};
// extensions: {
// key: "x-something-something";
// value {string_value: "yadda"}
// }
};
// Overwriting host entry breaks tests, so this is not done here.
// external_docs: {
// url: "https://github.com/grpc-ecosystem/grpc-gateway";
// description: "More about gRPC-Gateway";
// }
schemes: HTTP;
schemes: HTTPS;
consumes: "application/json";
produces: "application/json";
security_definitions: {
security: {
key: "OAuth2";
value: {
type: TYPE_OAUTH2;
flow: FLOW_PASSWORD;
token_url: "http://localhost:9969/api/oauth/token";
scopes: {
scope: {
key: "openid";
value: "default scope"
}
}
}
}
}
security: {
security_requirement: {
key: "OAuth2";
value: {
scope: "openid";
}
}
}
};