mirror of
https://github.com/zitadel/zitadel.git
synced 2025-06-02 17:28:21 +00:00
feat: add proto files
This commit is contained in:
parent
f6801200a9
commit
3c819e561a
1
go.sum
1
go.sum
@ -298,6 +298,7 @@ github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OK
|
|||||||
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
|
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
|
||||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
|
||||||
|
github.com/sethvargo/go-password v0.1.3 h1:18KkbGDkw8SuzeohAbWqBLNSfRQblVwEHOLbPa0PvWM=
|
||||||
github.com/sethvargo/go-password v0.1.3/go.mod h1:2tyaaoHK/AlXwh5WWQDYjqQbHcq4cjPj5qb/ciYvu/Q=
|
github.com/sethvargo/go-password v0.1.3/go.mod h1:2tyaaoHK/AlXwh5WWQDYjqQbHcq4cjPj5qb/ciYvu/Q=
|
||||||
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
|
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
|
||||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
//go:generate protoc -I$GOPATH/src -I../proto -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate --go_out=plugins=grpc:$GOPATH/src ../proto/org.proto
|
|
||||||
//go:generate protoc -I$GOPATH/src -I../proto -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate -I${GOPATH}/src/github.com/caos/citadel/utils/protoc/protoc-gen-authoption --go_out=plugins=grpc:${GOPATH}/src --grpc-gateway_out=logtostderr=true:${GOPATH}/src --swagger_out=logtostderr=true:. --authoption_out=. ../proto/admin.proto
|
//go:generate protoc -I$GOPATH/src -I../proto -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate -I${GOPATH}/src/github.com/caos/citadel/utils/protoc/protoc-gen-authoption --go_out=plugins=grpc:${GOPATH}/src --grpc-gateway_out=logtostderr=true:${GOPATH}/src --swagger_out=logtostderr=true:. --authoption_out=. ../proto/admin.proto
|
||||||
//go:generate mockgen -package api -destination ./mock/admin.proto.mock.go github.com/caos/citadel/admin/api/grpc AdminServiceClient
|
//go:generate mockgen -package api -destination ./mock/admin.proto.mock.go github.com/caos/citadel/admin/api/grpc AdminServiceClient
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@ syntax = "proto3";
|
|||||||
|
|
||||||
import "google/api/annotations.proto";
|
import "google/api/annotations.proto";
|
||||||
import "google/protobuf/empty.proto";
|
import "google/protobuf/empty.proto";
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
import "google/protobuf/struct.proto";
|
import "google/protobuf/struct.proto";
|
||||||
import "protoc-gen-swagger/options/annotations.proto";
|
import "protoc-gen-swagger/options/annotations.proto";
|
||||||
import "authoption/options.proto";
|
import "authoption/options.proto";
|
||||||
import "github.com/caos/zitadel/pkg/admin/api/proto/org.proto";
|
|
||||||
|
|
||||||
package zitadel.admin.api.v1;
|
package zitadel.admin.api.v1;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ service AdminService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//ORG
|
//ORG
|
||||||
rpc IsOrgUnique(zitadel.admin.v1.UniqueOrgRequest) returns (zitadel.admin.v1.UniqueOrgResponse) {
|
rpc IsOrgUnique(UniqueOrgRequest) returns (UniqueOrgResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/orgs/_isunique"
|
get: "/orgs/_isunique"
|
||||||
};
|
};
|
||||||
@ -66,7 +66,7 @@ service AdminService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc GetOrgByID(zitadel.admin.v1.OrgID) returns (zitadel.admin.v1.Org) {
|
rpc GetOrgByID(OrgID) returns (Org) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/orgs/{id}"
|
get: "/orgs/{id}"
|
||||||
};
|
};
|
||||||
@ -76,7 +76,7 @@ service AdminService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc SearchOrgs(zitadel.admin.v1.OrgSearchRequest) returns (zitadel.admin.v1.OrgSearchResponse) {
|
rpc SearchOrgs(OrgSearchRequest) returns (OrgSearchResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/orgs/_search"
|
post: "/orgs/_search"
|
||||||
body: "*"
|
body: "*"
|
||||||
@ -87,7 +87,7 @@ service AdminService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
rpc SetUpOrg(zitadel.admin.v1.OrgSetUpRequest) returns (zitadel.admin.v1.OrgSetUpResponse) {
|
rpc SetUpOrg(OrgSetUpRequest) returns (OrgSetUpResponse) {
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/orgs/_setup"
|
post: "/orgs/_setup"
|
||||||
body: "*"
|
body: "*"
|
||||||
@ -98,3 +98,132 @@ service AdminService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message OrgID {
|
||||||
|
string id = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message UniqueOrgRequest {
|
||||||
|
string name = 1 [(validate.rules).string.min_len = 1];
|
||||||
|
string domain = 2 [(validate.rules).string.min_len = 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
message UniqueOrgResponse {
|
||||||
|
bool is_unique = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Org {
|
||||||
|
string id = 1;
|
||||||
|
OrgState state = 2;
|
||||||
|
google.protobuf.Timestamp creation_date = 3;
|
||||||
|
google.protobuf.Timestamp change_date = 4;
|
||||||
|
string name = 5;
|
||||||
|
string domain = 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OrgState {
|
||||||
|
ORGSTATE_UNSPECIFIED = 0;
|
||||||
|
ORGSTATE_ACTIVE = 1;
|
||||||
|
ORGSTATE_INACTIVE = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OrgSearchRequest {
|
||||||
|
uint64 offset = 1;
|
||||||
|
uint64 limit = 2;
|
||||||
|
OrgSearchKey sorting_column = 3 [(validate.rules).enum = {not_in: [0]}];;
|
||||||
|
bool asc = 4;
|
||||||
|
repeated OrgSearchQuery queries = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OrgSearchQuery {
|
||||||
|
OrgSearchKey key = 1 [(validate.rules).enum = {not_in: [0]}];;
|
||||||
|
OrgSearchMethod method = 2;
|
||||||
|
string value = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OrgSearchKey {
|
||||||
|
ORGSEARCHKEY_UNSPECIFIED = 0;
|
||||||
|
ORGSEARCHKEY_ORG_NAME = 1;
|
||||||
|
ORGSEARCHKEY_DOMAIN = 2;
|
||||||
|
ORGSEARCHKEY_STATE = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OrgSearchResponse {
|
||||||
|
uint64 offset = 1;
|
||||||
|
uint64 limit = 2;
|
||||||
|
uint64 total_result = 3;
|
||||||
|
repeated Org result = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum OrgSearchMethod {
|
||||||
|
ORGSEARCHMETHOD_EQUALS = 0;
|
||||||
|
ORGSEARCHMETHOD_STARTS_WITH = 1;
|
||||||
|
ORGSEARCHMETHOD_CONTAINS = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OrgSetUpRequest {
|
||||||
|
CreateOrgRequest org = 1;
|
||||||
|
RegisterUserRequest user = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message OrgSetUpResponse {
|
||||||
|
Org org = 1;
|
||||||
|
User user = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterUserRequest {
|
||||||
|
string email = 1 [(validate.rules).string.email = true];
|
||||||
|
string first_name = 2 [(validate.rules).string.min_len = 1];
|
||||||
|
string last_name = 3 [(validate.rules).string.min_len = 1];
|
||||||
|
string nick_name = 4;
|
||||||
|
string display_name = 5;
|
||||||
|
string preferred_language = 6;
|
||||||
|
Gender gender = 7;
|
||||||
|
string password = 8 [(validate.rules).string.min_len = 1];
|
||||||
|
string org_id = 9 [(validate.rules).string.min_len = 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
message User {
|
||||||
|
string id = 1;
|
||||||
|
UserState state = 2;
|
||||||
|
google.protobuf.Timestamp creation_date = 3;
|
||||||
|
google.protobuf.Timestamp change_date = 4;
|
||||||
|
string user_name = 5;
|
||||||
|
string first_name = 6;
|
||||||
|
string last_name = 7;
|
||||||
|
string nick_name = 8;
|
||||||
|
string display_name = 9;
|
||||||
|
string preferred_language = 10;
|
||||||
|
Gender gender = 11;
|
||||||
|
string email = 12;
|
||||||
|
bool isEmailVerified = 13;
|
||||||
|
string phone = 14;
|
||||||
|
bool isPhoneVerified = 15;
|
||||||
|
string country = 16;
|
||||||
|
string locality = 17;
|
||||||
|
string postal_code = 18;
|
||||||
|
string region = 19;
|
||||||
|
string street_address = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum UserState {
|
||||||
|
USERSTATE_UNSPECIFIED = 0;
|
||||||
|
USERSTATE_ACTIVE = 1;
|
||||||
|
USERSTATE_INACTIVE = 2;
|
||||||
|
USERSTATE_DELETED = 3;
|
||||||
|
USERSTATE_LOCKED = 4;
|
||||||
|
USERSTATE_SUSPEND = 5;
|
||||||
|
USERSTATE_INITIAL= 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Gender {
|
||||||
|
GENDER_UNSPECIFIED = 0;
|
||||||
|
GENDER_FEMALE = 1;
|
||||||
|
GENDER_MALE = 2;
|
||||||
|
GENDER_DIVERSE = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message CreateOrgRequest {
|
||||||
|
string name = 1 [(validate.rules).string.min_len = 1];
|
||||||
|
string domain = 2 [(validate.rules).string.min_len = 1];
|
||||||
|
}
|
||||||
|
@ -1,137 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
import "google/protobuf/timestamp.proto";
|
|
||||||
import "validate/validate.proto";
|
|
||||||
|
|
||||||
package zitadel.admin.v1;
|
|
||||||
|
|
||||||
option go_package = "github.com/caos/zitadel/pkg/admin/api/grpc";
|
|
||||||
|
|
||||||
message OrgID {
|
|
||||||
string id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message UniqueOrgRequest {
|
|
||||||
string name = 1 [(validate.rules).string.min_len = 1];
|
|
||||||
string domain = 2 [(validate.rules).string.min_len = 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
message UniqueOrgResponse {
|
|
||||||
bool is_unique = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Org {
|
|
||||||
string id = 1;
|
|
||||||
OrgState state = 2;
|
|
||||||
google.protobuf.Timestamp creation_date = 3;
|
|
||||||
google.protobuf.Timestamp change_date = 4;
|
|
||||||
string name = 5;
|
|
||||||
string domain = 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum OrgState {
|
|
||||||
ORGSTATE_UNSPECIFIED = 0;
|
|
||||||
ORGSTATE_ACTIVE = 1;
|
|
||||||
ORGSTATE_INACTIVE = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OrgSearchRequest {
|
|
||||||
uint64 offset = 1;
|
|
||||||
uint64 limit = 2;
|
|
||||||
OrgSearchKey sorting_column = 3 [(validate.rules).enum = {not_in: [0]}];;
|
|
||||||
bool asc = 4;
|
|
||||||
repeated OrgSearchQuery queries = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OrgSearchQuery {
|
|
||||||
OrgSearchKey key = 1 [(validate.rules).enum = {not_in: [0]}];;
|
|
||||||
OrgSearchMethod method = 2;
|
|
||||||
string value = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum OrgSearchKey {
|
|
||||||
ORGSEARCHKEY_UNSPECIFIED = 0;
|
|
||||||
ORGSEARCHKEY_ORG_NAME = 1;
|
|
||||||
ORGSEARCHKEY_DOMAIN = 2;
|
|
||||||
ORGSEARCHKEY_STATE = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OrgSearchResponse {
|
|
||||||
uint64 offset = 1;
|
|
||||||
uint64 limit = 2;
|
|
||||||
uint64 total_result = 3;
|
|
||||||
repeated Org result = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum OrgSearchMethod {
|
|
||||||
ORGSEARCHMETHOD_EQUALS = 0;
|
|
||||||
ORGSEARCHMETHOD_STARTS_WITH = 1;
|
|
||||||
ORGSEARCHMETHOD_CONTAINS = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OrgSetUpRequest {
|
|
||||||
CreateOrgRequest org = 1;
|
|
||||||
RegisterUserRequest user = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message OrgSetUpResponse {
|
|
||||||
Org org = 1;
|
|
||||||
User user = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RegisterUserRequest {
|
|
||||||
string email = 1 [(validate.rules).string.email = true];
|
|
||||||
string first_name = 2 [(validate.rules).string.min_len = 1];
|
|
||||||
string last_name = 3 [(validate.rules).string.min_len = 1];
|
|
||||||
string nick_name = 4;
|
|
||||||
string display_name = 5;
|
|
||||||
string preferred_language = 6;
|
|
||||||
Gender gender = 7;
|
|
||||||
string password = 8 [(validate.rules).string.min_len = 1];
|
|
||||||
string org_id = 9 [(validate.rules).string.min_len = 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
message User {
|
|
||||||
string id = 1;
|
|
||||||
UserState state = 2;
|
|
||||||
google.protobuf.Timestamp creation_date = 3;
|
|
||||||
google.protobuf.Timestamp change_date = 4;
|
|
||||||
string user_name = 5;
|
|
||||||
string first_name = 6;
|
|
||||||
string last_name = 7;
|
|
||||||
string nick_name = 8;
|
|
||||||
string display_name = 9;
|
|
||||||
string preferred_language = 10;
|
|
||||||
Gender gender = 11;
|
|
||||||
string email = 12;
|
|
||||||
bool isEmailVerified = 13;
|
|
||||||
string phone = 14;
|
|
||||||
bool isPhoneVerified = 15;
|
|
||||||
string country = 16;
|
|
||||||
string locality = 17;
|
|
||||||
string postal_code = 18;
|
|
||||||
string region = 19;
|
|
||||||
string street_address = 20;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum UserState {
|
|
||||||
USERSTATE_UNSPPECIFIED = 0;
|
|
||||||
USERSTATE_ACTIVE = 1;
|
|
||||||
USERSTATE_INACTIVE = 2;
|
|
||||||
USERSTATE_DELETED = 3;
|
|
||||||
USERSTATE_LOCKED = 4;
|
|
||||||
USERSTATE_SUSPEND = 5;
|
|
||||||
USERSTATE_INITIAL= 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum Gender {
|
|
||||||
GENDER_UNSPECIFIED = 0;
|
|
||||||
GENDER_FEMALE = 1;
|
|
||||||
GENDER_MALE = 2;
|
|
||||||
GENDER_DIVERSE = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message CreateOrgRequest {
|
|
||||||
string name = 1 [(validate.rules).string.min_len = 1];
|
|
||||||
string domain = 2 [(validate.rules).string.min_len = 1];
|
|
||||||
}
|
|
5
pkg/auth/api/grpc/generate.go
Normal file
5
pkg/auth/api/grpc/generate.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package grpc
|
||||||
|
|
||||||
|
//go:generate protoc -I$GOPATH/src -I../proto -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate -I${GOPATH}/src/github.com/caos/citadel/utils/protoc/protoc-gen-authoption --go_out=plugins=grpc:$GOPATH/src --grpc-gateway_out=logtostderr=true:$GOPATH/src --swagger_out=logtostderr=true:. --authoption_out=. ../proto/auth.proto
|
||||||
|
//go:generate mockgen -package api -destination ./mock/auth.proto.mock.go github.com/caos/citadel/auth/api/grpc AuthServiceClient
|
||||||
|
//go:generate ../../../console/etc/generate-grpc.sh
|
1169
pkg/auth/api/proto/auth.proto
Normal file
1169
pkg/auth/api/proto/auth.proto
Normal file
File diff suppressed because it is too large
Load Diff
6
pkg/management/api/grpc/generate.go
Normal file
6
pkg/management/api/grpc/generate.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package grpc
|
||||||
|
|
||||||
|
//go:generate protoc -I$GOPATH/src -I../proto -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I${GOPATH}/src/github.com/envoyproxy/protoc-gen-validate -I${GOPATH}/src/github.com/caos/citadel/utils/protoc/protoc-gen-authoption --go_out=plugins=grpc:$GOPATH/src --grpc-gateway_out=logtostderr=true:$GOPATH/src --swagger_out=logtostderr=true:. --authoption_out=. ../proto/management.proto
|
||||||
|
//go:generate mockgen -package api -destination ./mock/management.proto.mock.go github.com/caos/citadel/management/api/grpc ManagementServiceClient
|
||||||
|
|
||||||
|
//go:generate ../../../console/etc/generate-grpc.sh
|
2164
pkg/management/api/proto/management.proto
Normal file
2164
pkg/management/api/proto/management.proto
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user