Files
teleport/api/client/proto/certs.pb.go
T
Alan Parra 0b76b44973 Use to Buf to lint, format and generate api/ protos (#15856)
Change the proto layout of `api/` to a more standard setup, allowing the use of
modern tools (like Buf) to format/lint (and maybe, one day, generate sources).

The new layout looks like this:

``` api/ proto/       <- root of protos and proto imports teleport/  <- base
package for Teleport protos (akin to "google/" or "gogoproto/") legacy/  <- root
of "legacy" protos (most linters disabled) client/ proto/ types/ events/
webauthn/ wrappers/ ```

Non-legacy `api/` protos are expected to follow this layout:

``` api/ proto/ teleport/ mynewpackage/  <- package name v1/          <- protos
explicitly versioned gen/      proto/  <- root for generated sources
(multi-language possible, separate from hand-written code) go/ mynewpackage/ v1
<- generate Go sources go here. ```

Some outstanding issues, like lack of `go_package` declarations and non-standard
import paths (`import "github.com/gravitational/teleport/.../some.proto"`) are
fixed.

Legacy protos still have irregular package declarations. It's possible to fix
that, but it's a bit harder to reason about, as generated sources change in
possibly-meaningful ways.

Future iterations could change legacy packages to match the directory structure
and apply a similar change to protos within lib/ packages, but this seems
sufficient for a first step.

* Add Buf to buildbox
* Unify API protos under Buf
* Fix proto generation
* Reformat protos
* Update generated protos
* Generate protos using Buf
* Appease linter
* Review: make sure gogo protobuf versions are in sync
* Clean leftovers from previous attempts
* Fix operator/Makefile
* Rename internal make gRPC targets to `*/host`
* Sort `make fix-license` targets (nit)
2022-08-26 18:11:38 +00:00

477 lines
12 KiB
Go

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: teleport/legacy/client/proto/certs.proto
package proto
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Set of certificates corresponding to a single public key.
type Certs struct {
// SSH X509 cert (PEM-encoded).
SSH []byte `protobuf:"bytes,1,opt,name=SSH,proto3" json:"ssh,omitempty"`
// TLS X509 cert (PEM-encoded).
TLS []byte `protobuf:"bytes,2,opt,name=TLS,proto3" json:"tls,omitempty"`
// TLSCACerts is a list of TLS certificate authorities.
TLSCACerts [][]byte `protobuf:"bytes,3,rep,name=TLSCACerts,proto3" json:"tls_ca_certs,omitempty"`
// SSHCACerts is a list of SSH certificate authorities.
SSHCACerts [][]byte `protobuf:"bytes,4,rep,name=SSHCACerts,proto3" json:"ssh_ca_certs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Certs) Reset() { *m = Certs{} }
func (m *Certs) String() string { return proto.CompactTextString(m) }
func (*Certs) ProtoMessage() {}
func (*Certs) Descriptor() ([]byte, []int) {
return fileDescriptor_9c4dbdba9a1559ee, []int{0}
}
func (m *Certs) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Certs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Certs.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Certs) XXX_Merge(src proto.Message) {
xxx_messageInfo_Certs.Merge(m, src)
}
func (m *Certs) XXX_Size() int {
return m.Size()
}
func (m *Certs) XXX_DiscardUnknown() {
xxx_messageInfo_Certs.DiscardUnknown(m)
}
var xxx_messageInfo_Certs proto.InternalMessageInfo
func init() {
proto.RegisterType((*Certs)(nil), "proto.Certs")
}
func init() {
proto.RegisterFile("teleport/legacy/client/proto/certs.proto", fileDescriptor_9c4dbdba9a1559ee)
}
var fileDescriptor_9c4dbdba9a1559ee = []byte{
// 251 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00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x24,
0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72,
0x7e, 0xae, 0x7e, 0x7a, 0x51, 0x62, 0x59, 0x66, 0x49, 0x62, 0x49, 0x66, 0x7e, 0x5e, 0x62, 0x8e,
0x3e, 0x3c, 0xf4, 0x12, 0x0b, 0x32, 0x51, 0x82, 0x2e, 0x89, 0x0d, 0x4c, 0x19, 0x03, 0x02, 0x00,
0x00, 0xff, 0xff, 0x86, 0x6e, 0xe8, 0x40, 0x61, 0x01, 0x00, 0x00,
}
func (m *Certs) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Certs) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Certs) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.SSHCACerts) > 0 {
for iNdEx := len(m.SSHCACerts) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.SSHCACerts[iNdEx])
copy(dAtA[i:], m.SSHCACerts[iNdEx])
i = encodeVarintCerts(dAtA, i, uint64(len(m.SSHCACerts[iNdEx])))
i--
dAtA[i] = 0x22
}
}
if len(m.TLSCACerts) > 0 {
for iNdEx := len(m.TLSCACerts) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.TLSCACerts[iNdEx])
copy(dAtA[i:], m.TLSCACerts[iNdEx])
i = encodeVarintCerts(dAtA, i, uint64(len(m.TLSCACerts[iNdEx])))
i--
dAtA[i] = 0x1a
}
}
if len(m.TLS) > 0 {
i -= len(m.TLS)
copy(dAtA[i:], m.TLS)
i = encodeVarintCerts(dAtA, i, uint64(len(m.TLS)))
i--
dAtA[i] = 0x12
}
if len(m.SSH) > 0 {
i -= len(m.SSH)
copy(dAtA[i:], m.SSH)
i = encodeVarintCerts(dAtA, i, uint64(len(m.SSH)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintCerts(dAtA []byte, offset int, v uint64) int {
offset -= sovCerts(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func (m *Certs) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.SSH)
if l > 0 {
n += 1 + l + sovCerts(uint64(l))
}
l = len(m.TLS)
if l > 0 {
n += 1 + l + sovCerts(uint64(l))
}
if len(m.TLSCACerts) > 0 {
for _, b := range m.TLSCACerts {
l = len(b)
n += 1 + l + sovCerts(uint64(l))
}
}
if len(m.SSHCACerts) > 0 {
for _, b := range m.SSHCACerts {
l = len(b)
n += 1 + l + sovCerts(uint64(l))
}
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovCerts(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozCerts(x uint64) (n int) {
return sovCerts(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Certs) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCerts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Certs: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Certs: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SSH", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCerts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCerts
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCerts
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SSH = append(m.SSH[:0], dAtA[iNdEx:postIndex]...)
if m.SSH == nil {
m.SSH = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TLS", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCerts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCerts
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCerts
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TLS = append(m.TLS[:0], dAtA[iNdEx:postIndex]...)
if m.TLS == nil {
m.TLS = []byte{}
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TLSCACerts", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCerts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCerts
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCerts
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TLSCACerts = append(m.TLSCACerts, make([]byte, postIndex-iNdEx))
copy(m.TLSCACerts[len(m.TLSCACerts)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field SSHCACerts", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowCerts
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthCerts
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthCerts
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.SSHCACerts = append(m.SSHCACerts, make([]byte, postIndex-iNdEx))
copy(m.SSHCACerts[len(m.SSHCACerts)-1], dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipCerts(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthCerts
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipCerts(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCerts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCerts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowCerts
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthCerts
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupCerts
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthCerts
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthCerts = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowCerts = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupCerts = fmt.Errorf("proto: unexpected end of group")
)