Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,9 @@ ADDLICENSE_ARGS := -c 'Gravitational, Inc' -l apache \
-ignore 'api/version.go' \
-ignore 'docs/pages/includes/**/*.go' \
-ignore 'e/**' \
-ignore 'gen/**' \
-ignore 'gitref.go' \
-ignore 'lib/srv/desktop/rdp/rdpclient/target/**' \
-ignore 'lib/teleterm/api/protogen/**' \
-ignore 'lib/web/build/**' \
-ignore 'version.go' \
-ignore 'webassets/**' \
Expand Down
13 changes: 13 additions & 0 deletions api/proto/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lint:
use:
- DEFAULT
- PACKAGE_NO_IMPORT_CYCLE
- UNARY_RPC
# Top-level types require comments.
- COMMENT_ENUM
- COMMENT_MESSAGE
Expand All @@ -31,6 +32,18 @@ lint:
PACKAGE_VERSION_SUFFIX:
- teleport/legacy/client/proto/joinservice.proto
- teleport/legacy/types/webauthn/webauthn.proto
# Allow only certain services to use streaming RPCs.
#
# We should avoid streaming RPCs until we have a compelling reason to use them (e.g. the
# implementation needs 1-N messages or the server cannot dial directly to the client).
#
# Check out the links below. If you still have questions or doubts, reach out to @codingllama.
#
# https://docs.buf.build/lint/rules#unary_rpc
# https://github.com/gravitational/teleport/pull/16043#issuecomment-1235728212
# https://github.com/twitchtv/twirp/issues/70#issuecomment-470367807
UNARY_RPC:
- teleport/legacy/client/proto/joinservice.proto
breaking:
use:
- FILE
12 changes: 12 additions & 0 deletions buf-go.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This buf-go.gen.yaml is based on how lib/teleterm's buf.gen.yaml looked like, not on v12 equivalent.
version: v1
plugins:
# Generated using an old version of protoc-gen-go - we can't use the latest
# plugins because Teleport itself depends on an old google.golang.org/grpc
# version.
# protoc itself may be the latest one.
# $ go install github.com/golang/protobuf/protoc-gen-go@v1.4.3
- name: go
out: .
opt:
- plugins=grpc
File renamed without changes.
18 changes: 18 additions & 0 deletions buf-js.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: v1
plugins:
# https://github.com/protocolbuffers/protobuf/tree/v3.20.1/js
- name: js
out: gen/proto/js
opt:
- import_style=commonjs,binary

# https://github.com/grpc/grpc-node/tree/grpc-tools%401.11.2/packages/grpc-tools/
- name: grpc
out: gen/proto/js
opt: grpc_js
path: grpc_tools_node_protoc_plugin

# https://github.com/agreatfool/grpc_tools_node_protoc_ts/tree/v5.0.1
- name: ts
out: gen/proto/js
opt: "service=grpc-node"
1 change: 0 additions & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: v1
directories:
- api/proto
- lib/teleterm/api/proto
- proto
16 changes: 12 additions & 4 deletions build.assets/genproto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ main() {
# <teleport-root>/github.com/gravitational/teleport/..., so we copy them to
# the correct relative path.
trap 'rm -fr github.com' EXIT # don't leave github.com/ behind
rm -fr api/gen/proto gen/proto lib/teleterm/api/protogen # cleanup gen/proto folders
buf generate api/proto
buf generate proto
rm -fr api/gen/proto gen/proto # cleanup gen/proto folders

buf generate --template=lib/teleterm/buf.gen.yaml lib/teleterm/api/proto
# Generate Gogo protos.
buf generate --template=buf-gogo.gen.yaml api/proto
buf generate --template=buf-gogo.gen.yaml proto

# Generate protoc-gen-go protos.
buf generate --template=buf-go.gen.yaml \
--path=proto/teleport/lib/teleterm/

# Generate JS protos.
buf generate --template=buf-js.gen.yaml \
--path=proto/teleport/lib/teleterm/

cp -r github.com/gravitational/teleport/* .
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading