From db9de6ba2ca4cdf15d4e8fc9cbd4d9ae28ebd36c Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Date: Mon, 5 Apr 2021 17:15:32 +0200 Subject: [PATCH 1/3] Upgrade otel collector to v0.21.0 It requires of pinning a version of cmux, which has conveniently adopted go modules --- go.mod | 18 +- go.sum | 96 +- vendor/github.com/Shopify/sarama/CHANGELOG.md | 16 +- vendor/github.com/Shopify/sarama/README.md | 6 +- .../Shopify/sarama/balance_strategy.go | 102 +- vendor/github.com/Shopify/sarama/client.go | 14 + vendor/github.com/Shopify/sarama/consumer.go | 37 +- vendor/github.com/Shopify/sarama/dev.yml | 2 +- .../Shopify/sarama/docker-compose.yml | 16 +- vendor/github.com/Shopify/sarama/errors.go | 3 + .../Shopify/sarama/fetch_response.go | 2 + vendor/github.com/Shopify/sarama/go.mod | 31 +- vendor/github.com/Shopify/sarama/go.sum | 81 +- .../Shopify/sarama/gssapi_kerberos.go | 16 +- .../Shopify/sarama/kerberos_client.go | 12 +- .../github.com/Shopify/sarama/mockkerberos.go | 10 +- .../Shopify/sarama/offset_manager.go | 10 +- vendor/github.com/Shopify/sarama/utils.go | 4 +- .../gogo/protobuf/proto/text_parser.go | 2 +- .../github.com/gogo/protobuf/types/any.pb.go | 5 +- .../github.com/gogo/protobuf/types/api.pb.go | 15 +- .../gogo/protobuf/types/duration.pb.go | 5 +- .../gogo/protobuf/types/empty.pb.go | 5 +- .../gogo/protobuf/types/field_mask.pb.go | 5 +- .../gogo/protobuf/types/source_context.pb.go | 5 +- .../gogo/protobuf/types/struct.pb.go | 17 +- .../gogo/protobuf/types/timestamp.pb.go | 5 +- .../github.com/gogo/protobuf/types/type.pb.go | 25 +- .../gogo/protobuf/types/wrappers.pb.go | 45 +- vendor/github.com/google/uuid/hash.go | 4 +- vendor/github.com/google/uuid/sql.go | 2 +- vendor/github.com/google/uuid/uuid.go | 10 +- vendor/github.com/google/uuid/version4.go | 8 + .../jcmturner/aescts/v2}/LICENSE | 0 .../jcmturner/aescts/v2}/aescts.go | 12 +- vendor/github.com/jcmturner/aescts/v2/go.mod | 5 + vendor/github.com/jcmturner/aescts/v2/go.sum | 10 + .../jcmturner/dnsutils/v2}/LICENSE | 0 .../github.com/jcmturner/dnsutils/v2/go.mod | 5 + .../github.com/jcmturner/dnsutils/v2/go.sum | 10 + .../jcmturner/dnsutils/v2}/srv.go | 0 .../jcmturner/gokrb5/v8}/LICENSE | 0 .../jcmturner/gokrb5/v8}/asn1tools/tools.go | 0 .../jcmturner/gokrb5/v8}/client/ASExchange.go | 37 +- .../gokrb5/v8}/client/TGSExchange.go | 10 +- .../jcmturner/gokrb5/v8}/client/cache.go | 32 +- .../jcmturner/gokrb5/v8}/client/client.go | 136 +- .../jcmturner/gokrb5/v8}/client/network.go | 170 +- .../jcmturner/gokrb5/v8}/client/passwd.go | 44 +- .../jcmturner/gokrb5/v8}/client/session.go | 48 +- .../jcmturner/gokrb5/v8}/client/settings.go | 28 +- .../jcmturner/gokrb5/v8}/config/error.go | 0 .../jcmturner/gokrb5/v8}/config/hosts.go | 2 +- .../jcmturner/gokrb5/v8}/config/krb5conf.go | 44 +- .../gokrb5/v8}/credentials/ccache.go | 19 +- .../gokrb5/v8}/credentials/credentials.go | 145 +- .../v8}/crypto/aes128-cts-hmac-sha1-96.go | 54 +- .../v8}/crypto/aes128-cts-hmac-sha256-128.go | 15 +- .../v8}/crypto/aes256-cts-hmac-sha1-96.go | 54 +- .../v8}/crypto/aes256-cts-hmac-sha384-192.go | 15 +- .../gokrb5/v8}/crypto/common/common.go | 21 +- .../jcmturner/gokrb5/v8}/crypto/crypto.go | 10 +- .../gokrb5/v8}/crypto/des3-cbc-sha1-kd.go | 43 +- .../jcmturner/gokrb5/v8/crypto/etype/etype.go | 29 + .../jcmturner/gokrb5/v8}/crypto/rc4-hmac.go | 12 +- .../gokrb5/v8}/crypto/rfc3961/encryption.go | 10 +- .../v8}/crypto/rfc3961/keyDerivation.go | 13 +- .../gokrb5/v8}/crypto/rfc3961/nfold.go | 23 +- .../gokrb5/v8}/crypto/rfc3962/encryption.go | 6 +- .../v8}/crypto/rfc3962/keyDerivation.go | 15 +- .../gokrb5/v8}/crypto/rfc4757/checksum.go | 0 .../gokrb5/v8}/crypto/rfc4757/encryption.go | 2 +- .../v8}/crypto/rfc4757/keyDerivation.go | 15 - .../gokrb5/v8}/crypto/rfc4757/msgtype.go | 0 .../gokrb5/v8}/crypto/rfc8009/encryption.go | 15 +- .../v8}/crypto/rfc8009/keyDerivation.go | 17 +- .../jcmturner/gokrb5/v8}/gssapi/MICToken.go | 36 +- .../jcmturner/gokrb5/v8}/gssapi/README.md | 0 .../gokrb5/v8}/gssapi/contextFlags.go | 4 +- .../jcmturner/gokrb5/v8}/gssapi/gssapi.go | 5 +- .../jcmturner/gokrb5/v8}/gssapi/wrapToken.go | 56 +- .../gokrb5/v8}/iana/addrtype/constants.go | 0 .../gokrb5/v8}/iana/adtype/constants.go | 0 .../gokrb5/v8}/iana/asnAppTag/constants.go | 0 .../gokrb5/v8}/iana/chksumtype/constants.go | 0 .../jcmturner/gokrb5/v8}/iana/constants.go | 0 .../gokrb5/v8}/iana/errorcode/constants.go | 0 .../gokrb5/v8}/iana/etypeID/constants.go | 0 .../gokrb5/v8}/iana/flags/constants.go | 0 .../gokrb5/v8}/iana/keyusage/constants.go | 0 .../gokrb5/v8}/iana/msgtype/constants.go | 0 .../gokrb5/v8}/iana/nametype/constants.go | 0 .../gokrb5/v8}/iana/patype/constants.go | 0 .../gokrb5/v8}/kadmin/changepasswddata.go | 2 +- .../jcmturner/gokrb5/v8}/kadmin/message.go | 4 +- .../jcmturner/gokrb5/v8}/kadmin/passwd.go | 8 +- .../jcmturner/gokrb5/v8}/keytab/keytab.go | 102 +- .../jcmturner/gokrb5/v8}/krberror/error.go | 4 +- .../jcmturner/gokrb5/v8}/messages/APRep.go | 23 +- .../jcmturner/gokrb5/v8}/messages/APReq.go | 57 +- .../jcmturner/gokrb5/v8}/messages/KDCRep.go | 120 +- .../jcmturner/gokrb5/v8}/messages/KDCReq.go | 24 +- .../jcmturner/gokrb5/v8}/messages/KRBCred.go | 12 +- .../jcmturner/gokrb5/v8}/messages/KRBError.go | 23 +- .../jcmturner/gokrb5/v8}/messages/KRBPriv.go | 16 +- .../jcmturner/gokrb5/v8}/messages/KRBSafe.go | 26 +- .../jcmturner/gokrb5/v8}/messages/Ticket.go | 41 +- .../jcmturner/gokrb5/v8}/pac/client_claims.go | 5 +- .../jcmturner/gokrb5/v8}/pac/client_info.go | 2 +- .../gokrb5/v8}/pac/credentials_info.go | 18 +- .../jcmturner/gokrb5/v8}/pac/device_claims.go | 5 +- .../jcmturner/gokrb5/v8}/pac/device_info.go | 4 +- .../gokrb5/v8}/pac/kerb_validation_info.go | 9 +- .../jcmturner/gokrb5/v8}/pac/pac_type.go | 8 +- .../gokrb5/v8}/pac/s4u_delegation_info.go | 4 +- .../gokrb5/v8}/pac/signature_data.go | 16 +- .../gokrb5/v8}/pac/supplemental_cred.go | 7 +- .../jcmturner/gokrb5/v8}/pac/upn_dns_info.go | 2 +- .../gokrb5/v8}/types/Authenticator.go | 29 +- .../gokrb5/v8/types/AuthorizationData.go | 55 + .../gokrb5/v8}/types/Cryptosystem.go | 19 +- .../jcmturner/gokrb5/v8}/types/HostAddress.go | 26 +- .../gokrb5/v8/types/KerberosFlags.go | 68 + .../jcmturner/gokrb5/v8}/types/PAData.go | 2 +- .../gokrb5/v8}/types/PrincipalName.go | 5 +- .../jcmturner/gokrb5/v8}/types/TypedData.go | 0 .../jcmturner/rpc/v2}/LICENSE | 0 .../jcmturner/rpc/v2}/mstypes/claims.go | 32 +- .../jcmturner/rpc/v2}/mstypes/common.go | 2 + .../jcmturner/rpc/v2}/mstypes/filetime.go | 0 .../rpc/v2}/mstypes/group_membership.go | 0 .../v2}/mstypes/kerb_sid_and_attributes.go | 0 .../jcmturner/rpc/v2}/mstypes/reader.go | 0 .../rpc/v2}/mstypes/rpc_unicode_string.go | 0 .../jcmturner/rpc/v2}/mstypes/sid.go | 16 +- .../rpc/v2}/mstypes/user_session_key.go | 0 .../jcmturner/rpc/v2}/ndr/arrays.go | 0 .../jcmturner/rpc/v2}/ndr/decoder.go | 0 .../jcmturner/rpc/v2}/ndr/error.go | 0 .../jcmturner/rpc/v2}/ndr/header.go | 0 .../jcmturner/rpc/v2}/ndr/pipe.go | 0 .../jcmturner/rpc/v2}/ndr/primitives.go | 0 .../jcmturner/rpc/v2}/ndr/rawbytes.go | 0 .../jcmturner/rpc/v2}/ndr/strings.go | 0 .../jcmturner/rpc/v2}/ndr/tags.go | 0 .../jcmturner/rpc/v2}/ndr/union.go | 0 vendor/github.com/pierrec/lz4/lz4.go | 13 +- .../github.com/pierrec/lz4/reader_legacy.go | 207 ++ vendor/github.com/pierrec/lz4/writer.go | 7 +- .../prometheus/common/config/http_config.go | 116 +- .../prometheus/common/model/time.go | 12 + .../rcrowley/go-metrics/.travis.yml | 1 + vendor/github.com/soheilhy/cmux/.travis.yml | 2 +- vendor/github.com/soheilhy/cmux/README.md | 2 +- vendor/github.com/soheilhy/cmux/cmux.go | 49 +- vendor/github.com/soheilhy/cmux/go.mod | 5 + vendor/github.com/soheilhy/cmux/go.sum | 12 + vendor/github.com/spf13/cobra/.golangci.yml | 48 + vendor/github.com/spf13/cobra/.travis.yml | 9 +- vendor/github.com/spf13/cobra/CHANGELOG.md | 35 +- vendor/github.com/spf13/cobra/CONDUCT.md | 37 + vendor/github.com/spf13/cobra/Makefile | 18 +- vendor/github.com/spf13/cobra/README.md | 32 +- .../spf13/cobra/bash_completions.go | 133 +- .../spf13/cobra/bash_completions.md | 2 +- vendor/github.com/spf13/cobra/cobra.go | 15 + vendor/github.com/spf13/cobra/command.go | 116 +- .../spf13/cobra/custom_completions.go | 4 +- .../spf13/cobra/fish_completions.go | 6 +- vendor/github.com/spf13/cobra/go.mod | 2 +- vendor/github.com/spf13/cobra/go.sum | 4 +- .../spf13/cobra/powershell_completions.go | 323 +- .../spf13/cobra/powershell_completions.md | 15 +- .../spf13/cobra/projects_using_cobra.md | 3 + .../spf13/cobra/shell_completions.md | 119 +- .../github.com/spf13/cobra/zsh_completions.go | 4 +- .../testify/assert/assertion_compare.go | 172 +- .../testify/assert/assertion_format.go | 97 + .../testify/assert/assertion_forward.go | 194 + .../testify/assert/assertion_order.go | 81 + .../stretchr/testify/assert/assertions.go | 83 +- .../github.com/stretchr/testify/mock/mock.go | 45 +- .../stretchr/testify/require/require.go | 248 ++ .../testify/require/require_forward.go | 194 + vendor/github.com/xdg-go/scram/.gitignore | 0 vendor/github.com/xdg-go/scram/.travis.yml | 11 + vendor/github.com/xdg-go/scram/LICENSE | 175 + vendor/github.com/xdg-go/scram/README.md | 71 + vendor/github.com/xdg-go/scram/client.go | 130 + vendor/github.com/xdg-go/scram/client_conv.go | 149 + vendor/github.com/xdg-go/scram/common.go | 97 + vendor/github.com/xdg-go/scram/doc.go | 24 + vendor/github.com/xdg-go/scram/parse.go | 205 ++ vendor/github.com/xdg-go/scram/scram.go | 66 + vendor/github.com/xdg-go/scram/server.go | 50 + vendor/github.com/xdg-go/scram/server_conv.go | 151 + vendor/github.com/xdg/stringprep/.gitignore | 0 vendor/github.com/xdg/stringprep/.travis.yml | 10 + vendor/github.com/xdg/stringprep/LICENSE | 175 + vendor/github.com/xdg/stringprep/README.md | 27 + vendor/github.com/xdg/stringprep/bidi.go | 73 + vendor/github.com/xdg/stringprep/doc.go | 10 + vendor/github.com/xdg/stringprep/error.go | 14 + vendor/github.com/xdg/stringprep/map.go | 21 + vendor/github.com/xdg/stringprep/profile.go | 75 + vendor/github.com/xdg/stringprep/saslprep.go | 52 + vendor/github.com/xdg/stringprep/set.go | 36 + vendor/github.com/xdg/stringprep/tables.go | 3215 +++++++++++++++++ vendor/go.opencensus.io/.travis.yml | 17 - vendor/go.opencensus.io/go.mod | 15 +- vendor/go.opencensus.io/go.sum | 82 +- .../metric/metricexport/reader.go | 15 +- vendor/go.opencensus.io/trace/basetypes.go | 10 + vendor/go.opencensus.io/trace/spanstore.go | 14 +- vendor/go.opencensus.io/trace/trace.go | 144 +- vendor/go.opencensus.io/trace/trace_api.go | 265 ++ .../collector/component/component.go | 6 +- .../component/componenterror/errors.go | 27 +- .../collector/component/receiver.go | 6 +- .../collector/config/config.go | 43 + .../collector/config/configgrpc/README.md | 6 +- .../collector/config/confighttp/README.md | 10 +- .../collector/config/confighttp/confighttp.go | 10 +- .../collector/config/confignet/README.md | 2 +- .../collector/config/configtls/README.md | 4 +- .../collector/consumer/consumer.go | 2 +- .../consumer/consumererror/combineerrors.go | 47 + .../consumer/consumererror/permanenterror.go | 8 +- .../consumer/consumererror/scrapeerrors.go | 49 + .../collector/consumer/pdata/common.go | 30 +- .../consumer/pdata/generated_common.go | 15 +- .../collector/consumer/pdata/generated_log.go | 61 +- .../consumer/pdata/generated_metrics.go | 350 +- .../consumer/pdata/generated_resource.go | 9 +- .../consumer/pdata/generated_trace.go | 178 +- .../collector/consumer/pdata/log.go | 4 +- .../collector/consumer/pdata/metric.go | 10 +- .../collector/consumer/pdata/spanid.go | 6 +- .../collector/consumer/pdata/trace.go | 60 +- .../collector/consumer/pdata/traceid.go | 6 +- .../exporter/kafkaexporter/README.md | 4 + .../exporter/kafkaexporter/authentication.go | 49 + .../kafkaexporter/jaeger_marshaller.go | 4 +- .../exporter/kafkaexporter/otlp_marshaller.go | 4 +- .../exporter/kafkaexporter/scram_client.go | 47 + .../collector/logs/v1/logs_service.pb.go | 22 +- .../collector/logs/v1/logs_service.pb.gw.go | 6 + .../metrics/v1/metrics_service.pb.go | 24 +- .../metrics/v1/metrics_service.pb.gw.go | 6 + .../collector/trace/v1/trace_config.pb.go | 93 +- .../collector/trace/v1/trace_service.pb.go | 53 +- .../collector/trace/v1/trace_service.pb.gw.go | 6 + .../trace/v1/trace_service_gateway_aliases.go | 0 .../common/v1/common.pb.go | 91 +- .../logs/v1/logs.pb.go | 128 +- .../metrics/v1/metrics.pb.go | 278 +- .../resource/v1/resource.pb.go | 23 +- .../trace/v1/trace.pb.go | 223 +- .../collector/internal/data/spanid.go | 12 +- .../collector/internal/data/traceid.go | 12 +- .../internal/middleware/compression.go | 57 + .../collector/internal/otlp_wrapper.go | 2 +- .../collector/obsreport/doc.go | 5 +- .../collector/obsreport/obsreport_receiver.go | 4 +- .../receiver/jaegerreceiver/README.md | 6 +- .../receiver/jaegerreceiver/trace_receiver.go | 3 +- .../kafkareceiver/otlp_unmarshaller.go | 2 +- .../receiver/opencensusreceiver/README.md | 6 +- .../opencensusreceiver/octrace/opencensus.go | 21 +- .../collector/receiver/otlpreceiver/README.md | 13 +- .../receiver/otlpreceiver/logs/otlp.go | 2 +- .../receiver/otlpreceiver/metrics/otlp.go | 2 +- .../collector/receiver/otlpreceiver/otlp.go | 6 +- .../receiver/otlpreceiver/trace/otlp.go | 32 +- .../receiver/zipkinreceiver/README.md | 6 +- .../receiver/zipkinreceiver/trace_receiver.go | 33 +- .../collector/translator/conventions/aws.go | 36 + .../translator/conventions/opentelemetry.go | 150 +- .../translator/internaldata/oc_to_traces.go | 31 +- .../translator/internaldata/resource_to_oc.go | 11 +- .../translator/internaldata/traces_to_oc.go | 44 +- .../translator/trace/big_endian_converter.go | 81 +- .../translator/trace/grpc_http_mapper.go | 4 +- .../trace/jaeger/jaegerproto_to_traces.go | 7 +- .../trace/jaeger/jaegerthrift_to_traces.go | 10 +- .../trace/jaeger/traces_to_jaegerproto.go | 28 +- .../translator/trace/protospan_translation.go | 29 +- .../consumerdata.go} | 18 +- .../trace/zipkin/traces_to_zipkinv2.go | 20 +- .../zipkin/zipkinv1_thrift_to_protospan.go | 9 +- .../trace/zipkin/zipkinv1_thrift_to_traces.go | 3 +- .../trace/zipkin/zipkinv1_to_protospan.go | 17 +- .../trace/zipkin/zipkinv1_to_traces.go | 2 +- .../trace/zipkin/zipkinv2_to_traces.go | 10 +- vendor/golang.org/x/text/unicode/bidi/bidi.go | 221 +- vendor/golang.org/x/text/unicode/bidi/core.go | 63 +- .../golang.org/x/tools/cmd/goimports/doc.go | 4 + .../golang.org/x/tools/go/ast/astutil/util.go | 4 + .../x/tools/internal/gocommand/version.go | 13 +- .../x/tools/internal/imports/mod.go | 4 + .../x/tools/internal/imports/mod_cache.go | 4 + .../gopkg.in/jcmturner/aescts.v1/.gitignore | 14 - vendor/gopkg.in/jcmturner/aescts.v1/README.md | 16 - .../gopkg.in/jcmturner/dnsutils.v1/.gitignore | 14 - .../jcmturner/dnsutils.v1/.travis.yml | 24 - .../jcmturner/gokrb5.v7/crypto/etype/etype.go | 29 - .../gokrb5.v7/types/AuthorizationData.go | 123 - .../gokrb5.v7/types/KerberosFlags.go | 124 - vendor/gopkg.in/yaml.v3/.travis.yml | 17 - vendor/gopkg.in/yaml.v3/decode.go | 6 +- vendor/gopkg.in/yaml.v3/emitterc.go | 34 +- vendor/gopkg.in/yaml.v3/encode.go | 5 + vendor/gopkg.in/yaml.v3/scannerc.go | 28 +- vendor/gopkg.in/yaml.v3/yaml.go | 5 + vendor/modules.txt | 131 +- 315 files changed, 10342 insertions(+), 3806 deletions(-) rename vendor/{gopkg.in/jcmturner/aescts.v1 => github.com/jcmturner/aescts/v2}/LICENSE (100%) rename vendor/{gopkg.in/jcmturner/aescts.v1 => github.com/jcmturner/aescts/v2}/aescts.go (93%) create mode 100644 vendor/github.com/jcmturner/aescts/v2/go.mod create mode 100644 vendor/github.com/jcmturner/aescts/v2/go.sum rename vendor/{gopkg.in/jcmturner/dnsutils.v1 => github.com/jcmturner/dnsutils/v2}/LICENSE (100%) create mode 100644 vendor/github.com/jcmturner/dnsutils/v2/go.mod create mode 100644 vendor/github.com/jcmturner/dnsutils/v2/go.sum rename vendor/{gopkg.in/jcmturner/dnsutils.v1 => github.com/jcmturner/dnsutils/v2}/srv.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/LICENSE (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/asn1tools/tools.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/ASExchange.go (85%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/TGSExchange.go (95%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/cache.go (79%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/client.go (61%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/network.go (64%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/passwd.go (67%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/session.go (84%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/client/settings.go (73%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/config/error.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/config/hosts.go (98%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/config/krb5conf.go (96%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/credentials/ccache.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/credentials/credentials.go (70%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/aes128-cts-hmac-sha1-96.go (55%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/aes128-cts-hmac-sha256-128.go (89%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/aes256-cts-hmac-sha1-96.go (55%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/aes256-cts-hmac-sha384-192.go (89%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/common/common.go (77%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/crypto.go (95%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/des3-cbc-sha1-kd.go (76%) create mode 100644 vendor/github.com/jcmturner/gokrb5/v8/crypto/etype/etype.go rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rc4-hmac.go (88%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc3961/encryption.go (89%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc3961/keyDerivation.go (91%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc3961/nfold.go (72%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc3962/encryption.go (95%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc3962/keyDerivation.go (75%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc4757/checksum.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc4757/encryption.go (98%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc4757/keyDerivation.go (72%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc4757/msgtype.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc8009/encryption.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/crypto/rfc8009/keyDerivation.go (88%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/gssapi/MICToken.go (79%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/gssapi/README.md (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/gssapi/contextFlags.go (81%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/gssapi/gssapi.go (95%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/gssapi/wrapToken.go (71%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/addrtype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/adtype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/asnAppTag/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/chksumtype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/errorcode/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/etypeID/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/flags/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/keyusage/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/msgtype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/nametype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/iana/patype/constants.go (100%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/kadmin/changepasswddata.go (93%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/kadmin/message.go (96%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/kadmin/passwd.go (91%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/keytab/keytab.go (79%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/krberror/error.go (94%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/APRep.go (72%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/APReq.go (78%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KDCRep.go (83%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KDCReq.go (96%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KRBCred.go (93%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KRBError.go (82%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KRBPriv.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/KRBSafe.go (68%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/messages/Ticket.go (91%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/client_claims.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/client_info.go (96%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/credentials_info.go (76%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/device_claims.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/device_info.go (97%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/kerb_validation_info.go (90%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/pac_type.go (97%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/s4u_delegation_info.go (91%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/signature_data.go (59%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/supplemental_cred.go (89%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/pac/upn_dns_info.go (98%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/Authenticator.go (71%) create mode 100644 vendor/github.com/jcmturner/gokrb5/v8/types/AuthorizationData.go rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/Cryptosystem.go (73%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/HostAddress.go (85%) create mode 100644 vendor/github.com/jcmturner/gokrb5/v8/types/KerberosFlags.go rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/PAData.go (98%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/PrincipalName.go (94%) rename vendor/{gopkg.in/jcmturner/gokrb5.v7 => github.com/jcmturner/gokrb5/v8}/types/TypedData.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/LICENSE (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/claims.go (75%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/common.go (52%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/filetime.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/group_membership.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/kerb_sid_and_attributes.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/reader.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/rpc_unicode_string.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/sid.go (83%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/mstypes/user_session_key.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/arrays.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/decoder.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/error.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/header.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/pipe.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/primitives.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/rawbytes.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/strings.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/tags.go (100%) rename vendor/{gopkg.in/jcmturner/rpc.v1 => github.com/jcmturner/rpc/v2}/ndr/union.go (100%) create mode 100644 vendor/github.com/pierrec/lz4/reader_legacy.go create mode 100644 vendor/github.com/soheilhy/cmux/go.mod create mode 100644 vendor/github.com/soheilhy/cmux/go.sum create mode 100644 vendor/github.com/spf13/cobra/.golangci.yml create mode 100644 vendor/github.com/spf13/cobra/CONDUCT.md create mode 100644 vendor/github.com/stretchr/testify/assert/assertion_order.go create mode 100644 vendor/github.com/xdg-go/scram/.gitignore create mode 100644 vendor/github.com/xdg-go/scram/.travis.yml create mode 100644 vendor/github.com/xdg-go/scram/LICENSE create mode 100644 vendor/github.com/xdg-go/scram/README.md create mode 100644 vendor/github.com/xdg-go/scram/client.go create mode 100644 vendor/github.com/xdg-go/scram/client_conv.go create mode 100644 vendor/github.com/xdg-go/scram/common.go create mode 100644 vendor/github.com/xdg-go/scram/doc.go create mode 100644 vendor/github.com/xdg-go/scram/parse.go create mode 100644 vendor/github.com/xdg-go/scram/scram.go create mode 100644 vendor/github.com/xdg-go/scram/server.go create mode 100644 vendor/github.com/xdg-go/scram/server_conv.go create mode 100644 vendor/github.com/xdg/stringprep/.gitignore create mode 100644 vendor/github.com/xdg/stringprep/.travis.yml create mode 100644 vendor/github.com/xdg/stringprep/LICENSE create mode 100644 vendor/github.com/xdg/stringprep/README.md create mode 100644 vendor/github.com/xdg/stringprep/bidi.go create mode 100644 vendor/github.com/xdg/stringprep/doc.go create mode 100644 vendor/github.com/xdg/stringprep/error.go create mode 100644 vendor/github.com/xdg/stringprep/map.go create mode 100644 vendor/github.com/xdg/stringprep/profile.go create mode 100644 vendor/github.com/xdg/stringprep/saslprep.go create mode 100644 vendor/github.com/xdg/stringprep/set.go create mode 100644 vendor/github.com/xdg/stringprep/tables.go delete mode 100644 vendor/go.opencensus.io/.travis.yml create mode 100644 vendor/go.opencensus.io/trace/trace_api.go create mode 100644 vendor/go.opentelemetry.io/collector/consumer/consumererror/combineerrors.go create mode 100644 vendor/go.opentelemetry.io/collector/consumer/consumererror/scrapeerrors.go create mode 100644 vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/scram_client.go rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/logs/v1/logs_service.pb.go (96%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/logs/v1/logs_service.pb.gw.go (93%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/metrics/v1/metrics_service.pb.go (96%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/metrics/v1/metrics_service.pb.gw.go (93%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/trace/v1/trace_config.pb.go (89%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/trace/v1/trace_service.pb.go (86%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/trace/v1/trace_service.pb.gw.go (93%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/collector/trace/v1/trace_service_gateway_aliases.go (100%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/common/v1/common.pb.go (92%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/logs/v1/logs.pb.go (86%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/metrics/v1/metrics.pb.go (94%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/resource/v1/resource.pb.go (91%) rename vendor/go.opentelemetry.io/collector/internal/data/{opentelemetry-proto-gen => protogen}/trace/v1/trace.pb.go (88%) create mode 100644 vendor/go.opentelemetry.io/collector/translator/conventions/aws.go rename vendor/go.opentelemetry.io/collector/translator/trace/{opencensus_helper.go => zipkin/consumerdata.go} (62%) delete mode 100644 vendor/gopkg.in/jcmturner/aescts.v1/.gitignore delete mode 100644 vendor/gopkg.in/jcmturner/aescts.v1/README.md delete mode 100644 vendor/gopkg.in/jcmturner/dnsutils.v1/.gitignore delete mode 100644 vendor/gopkg.in/jcmturner/dnsutils.v1/.travis.yml delete mode 100644 vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/etype/etype.go delete mode 100644 vendor/gopkg.in/jcmturner/gokrb5.v7/types/AuthorizationData.go delete mode 100644 vendor/gopkg.in/jcmturner/gokrb5.v7/types/KerberosFlags.go delete mode 100644 vendor/gopkg.in/yaml.v3/.travis.yml diff --git a/go.mod b/go.mod index d2c66fa1e47..8f38173859f 100644 --- a/go.mod +++ b/go.mod @@ -11,12 +11,12 @@ require ( github.com/cortexproject/cortex v1.6.1-0.20210205171041-527f9b58b93c github.com/dustin/go-humanize v1.0.0 github.com/go-kit/kit v0.10.0 - github.com/gogo/protobuf v1.3.1 + github.com/gogo/protobuf v1.3.2 github.com/gogo/status v1.0.3 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/protobuf v1.4.3 github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.2.0 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 @@ -32,26 +32,26 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.9.0 github.com/prometheus/client_model v0.2.0 - github.com/prometheus/common v0.15.0 + github.com/prometheus/common v0.17.0 github.com/prometheus/prometheus v1.8.2-0.20210124145330-b5dfa2414b9e github.com/sirupsen/logrus v1.6.0 github.com/spf13/viper v1.7.1 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 github.com/uber-go/atomic v1.4.0 github.com/uber/jaeger-client-go v2.25.0+incompatible github.com/weaveworks/common v0.0.0-20210112142934-23c8d7fa6120 github.com/willf/bitset v1.1.10 // indirect github.com/willf/bloom v2.0.3+incompatible - go.opencensus.io v0.22.5 - go.opentelemetry.io/collector v0.16.0 + go.opencensus.io v0.22.6 + go.opentelemetry.io/collector v0.21.0 go.uber.org/atomic v1.7.0 go.uber.org/goleak v1.1.10 go.uber.org/zap v1.16.0 golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 google.golang.org/api v0.36.0 - google.golang.org/grpc v1.33.2 + google.golang.org/grpc v1.35.0 gopkg.in/yaml.v2 v2.4.0 - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) // All of the below replace directives exist due to @@ -80,3 +80,5 @@ replace ( github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.4 github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.8 ) + +replace github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5 diff --git a/go.sum b/go.sum index 13130b21f2d..a4682055f80 100644 --- a/go.sum +++ b/go.sum @@ -142,8 +142,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.22.2-0.20190604114437-cd910a683f9f/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= -github.com/Shopify/sarama v1.27.2 h1:1EyY1dsxNDUQEv0O/4TsjosHI2CgB1uo9H/v56xzTxc= -github.com/Shopify/sarama v1.27.2/go.mod h1:g5s5osgELxgM+Md9Qni9rzo7Rbt+vvFQI4bt/Mc93II= +github.com/Shopify/sarama v1.28.0 h1:lOi3SfE6OcFlW9Trgtked2aHNZ2BIG/d6Do+PEUAqqM= +github.com/Shopify/sarama v1.28.0/go.mod h1:j/2xTrU39dlzBmsxF1eQ2/DdWrxyBCl6pzz7a81o/ZY= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -392,8 +392,8 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.7.3/go.mod h1:V1d2J5pfxYH6EjBAgSK7YNXcXlTWxUHdE1sVDXkjnig= -github.com/frankban/quicktest v1.10.2 h1:19ARM85nVi4xH7xPXuc5eM/udya5ieh7b/Sv+d844Tk= -github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -531,8 +531,9 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.0.3 h1:WkVBY59mw7qUNTr/bLwO7J2vesJ0rQ2C3tMXrTd3w5M= github.com/gogo/status v1.0.3/go.mod h1:SavQ51ycCLnc7dGyJxp8YAmudx8xqiVrRf+6IXRsugc= github.com/golang-migrate/migrate/v4 v4.7.0 h1:gONcHxHApDTKXDyLH/H97gEHmpu1zcnnbAaq2zgrPrs= @@ -591,6 +592,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -625,8 +627,9 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.2+incompatible h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww= github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -660,6 +663,8 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -798,9 +803,19 @@ github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80s github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jaegertracing/jaeger v1.21.0 h1:Fgre3vTI5E/cmkXKBXK7ksnzul5b/3gXjA3mQzt0+58= github.com/jaegertracing/jaeger v1.21.0/go.mod h1:PCTGGFohQBPQMR4j333V5lt6If7tj8aWJ+pQNgvZ+wU= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= +github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -847,10 +862,10 @@ github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaR github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1018,8 +1033,6 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96d github.com/ncw/swift v1.0.50/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/ncw/swift v1.0.52 h1:ACF3JufDGgeKp/9mrDgQlEgS8kRYC4XKcuzj/8EJjQU= github.com/ncw/swift v1.0.52/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= @@ -1100,8 +1113,8 @@ github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0je github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.3 h1:/dvQpkb0o1pVlSgKNQqfkavlnXaIK+hJ0LXsKRUN9D4= github.com/pierrec/lz4/v4 v4.1.3/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1164,8 +1177,9 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.11.1/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.12.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.17.0 h1:kDIZLI74SS+3tedSvEkykgBkD7txMxaJAPj8DtJUKYA= +github.com/prometheus/common v0.17.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/exporter-toolkit v0.5.1/go.mod h1:OCkM4805mmisBhLmVFw858QYi3v0wKdY6/UxrT0pZVg= github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289 h1:dTUS1vaLWq+Y6XKOTnrFpoVsQKLCbCp1OLj24TDi7oM= github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289/go.mod h1:FGbBv5OPKjch+jNUJmEQpMZytIdyW0NdBtWFcfSKusc= @@ -1205,8 +1219,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rafaeljusto/redigomock v0.0.0-20190202135759-257e089e14a1/go.mod h1:JaY6n2sDr+z2WTsXkOmNRUfDy6FN0L6Nk7x06ndm4tY= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -1243,7 +1257,7 @@ github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfP github.com/sercand/kuberesolver v2.4.0+incompatible h1:WE2OlRf6wjLxHwNkkFLQGaZcVLEXjMjBPjjEU5vksH8= github.com/sercand/kuberesolver v2.4.0+incompatible/go.mod h1:lWF3GL0xptCB/vCiJPl/ZshwPsX/n4Y7u0CW9E7aQIQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.20.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.20.12-0.20201210134652-afe0c04c5d5a+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk= @@ -1268,8 +1282,8 @@ github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUr github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.4.1 h1:oMnRNZXX5j85zso6xCPRNPtmAycat+WcoKbklScLDgQ= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a/go.mod h1:LeFCbQYJ3KJlPs/FvPz2dy1tkpxyeNESVyCNNzRXFR0= @@ -1284,8 +1298,8 @@ github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1313,8 +1327,9 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/thanos-io/thanos v0.8.1-0.20200109203923-552ffa4c1a0d/go.mod h1:usT/TxtJQ7DzinTt+G9kinDQmRS5sxwu0unVKZ9vdcw= @@ -1371,8 +1386,12 @@ github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPy github.com/willf/bloom v2.0.3+incompatible h1:QDacWdqcAUI1MPOwIQZRy9kOR7yxfyEmxX8Wdm2/JPA= github.com/willf/bloom v2.0.3+incompatible/go.mod h1:MmAltL9pDMNTrvUkxdg0k0q5I0suxmuwp3KbyrZLOZ8= github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= +github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c h1:Wm21TPasVdeOUTg1m/uNkRdMuvI+jIeYfTIwq98Z2V0= +github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:FV1RpvYFmF8wnKtr3ArzkC0b+tAySCbw8eP7QSIvLKM= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -1412,10 +1431,11 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/collector v0.16.0 h1:x5WAHVmm4DvaBgN7uiwnt0buj1ae/dyIvxNGLgtlbrg= -go.opentelemetry.io/collector v0.16.0/go.mod h1:xNZjorr8GTcoi4AZ2iFYHGmx+xgE1Ue/oJI+pxKkdjA= +go.opencensus.io v0.22.6 h1:BdkrbWrzDlV9dnbzoP7sfN+dHheJ4J9JOaYxcUDL+ok= +go.opencensus.io v0.22.6/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/collector v0.21.0 h1:M7AaU/6S15gdqqhyX8+XsjT3TUrNIyvsb2ScKxU62HA= +go.opentelemetry.io/collector v0.21.0/go.mod h1:74t/Wj1bGM+L/O/zss6DchCa6ptX1jwrdpVfRuXyd6A= go.opentelemetry.io/otel v0.11.0 h1:IN2tzQa9Gc4ZVKnTaMbPVcHjvzOdg5n9QfnmlqiET7E= go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1468,10 +1488,11 @@ golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 h1:sYNJzB4J8toYPQTM6pAkcmBRgw9SnQKP9oXCHfgy604= +golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1564,8 +1585,10 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1693,8 +1716,9 @@ golang.org/x/text v0.3.1-0.20180805044716-cb6730876b98/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1773,6 +1797,7 @@ golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200603131246-cc40288be839/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200710042808-f1c4188a97a1/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200725200936-102e7d357031/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1789,8 +1814,9 @@ golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201119054027-25dc3e1ccc3c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201228162255-34cd474b9958 h1:8dEW6cGnUF2NIvtKDx8YsMBEw5pUrMEVUrU0jiPgmu8= golang.org/x/tools v0.0.0-20201228162255-34cd474b9958/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1886,7 +1912,6 @@ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e h1:wYR00/Ht+i/79g/ google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc/examples v0.0.0-20200728065043-dfc0c05b2da9 h1:f+/+gfZ/tfaHBXXiv1gWRmCej6wlX3mLY4bnLpI99wk= google.golang.org/grpc/examples v0.0.0-20200728065043-dfc0c05b2da9/go.mod h1:5j1uub0jRGhRiSghIlrThmBUgcgLXOVJQ/l1getT4uo= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1904,8 +1929,8 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1920,16 +1945,10 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0 h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlIrg= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= @@ -1951,8 +1970,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200603094226-e3079894b1e8/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= diff --git a/vendor/github.com/Shopify/sarama/CHANGELOG.md b/vendor/github.com/Shopify/sarama/CHANGELOG.md index db928328f96..59ccd1de581 100644 --- a/vendor/github.com/Shopify/sarama/CHANGELOG.md +++ b/vendor/github.com/Shopify/sarama/CHANGELOG.md @@ -2,6 +2,20 @@ #### Unreleased +#### Version 1.28.0 (2021-02-15) + +**Note that with this release we change `RoundRobinBalancer` strategy to match Java client behavior. See #1788 for details.** + +- #1870 - @kvch - Update Kerberos library to latest major +- #1876 - @bai - Update docs, reference pkg.go.dev +- #1846 - @wclaeys - Do not ignore Consumer.Offsets.AutoCommit.Enable config on Close +- #1747 - @XSAM - fix: mock sync producer does not handle the offset while sending messages +- #1863 - @bai - Add support for Kafka 2.7.0 + update lz4 and klauspost/compress dependencies +- #1788 - @kzinglzy - feat[balance_strategy]: announcing a new round robin balance strategy +- #1862 - @bai - Fix CI setenv permissions issues +- #1832 - @ilyakaznacheev - Update Godoc link to pkg.go.dev +- #1822 - @danp - KIP-392: Allow consumers to fetch from closest replica + #### Version 1.27.2 (2020-10-21) # Improvements @@ -72,7 +86,7 @@ This release has been marked as not ready for production and may be unstable, pl - #1560 - @iyacontrol - add sync pool for gzip 1-9 - #1605 - @dnwe - feat: protocol support for V11 fetch w/ rackID -- #1617 - @sladkoff / @dwi-di / @random-dwi - Add support for alter/list partition reassignements APIs +- #1617 - @sladkoff / @dwi-di / @random-dwi - Add support for alter/list partition reassignements APIs - #1632 - @bai - Add support for Go 1.14 - #1640 - @random-dwi - Feature/fix list partition reassignments - #1646 - @mimaison - Add DescribeLogDirs to admin client diff --git a/vendor/github.com/Shopify/sarama/README.md b/vendor/github.com/Shopify/sarama/README.md index 38d39695b74..c57c3a78a04 100644 --- a/vendor/github.com/Shopify/sarama/README.md +++ b/vendor/github.com/Shopify/sarama/README.md @@ -1,6 +1,6 @@ # sarama -[![GoDoc](https://godoc.org/github.com/Shopify/sarama?status.svg)](https://godoc.org/github.com/Shopify/sarama) +[![Go Reference](https://pkg.go.dev/badge/github.com/Shopify/sarama.svg)](https://pkg.go.dev/github.com/Shopify/sarama) [![Build Status](https://travis-ci.org/Shopify/sarama.svg?branch=master)](https://travis-ci.org/Shopify/sarama) [![Coverage](https://codecov.io/gh/Shopify/sarama/branch/master/graph/badge.svg)](https://codecov.io/gh/Shopify/sarama) @@ -8,7 +8,7 @@ Sarama is an MIT-licensed Go client library for [Apache Kafka](https://kafka.apa ## Getting started -- API documentation and examples are available via [godoc](https://godoc.org/github.com/Shopify/sarama). +- API documentation and examples are available via [pkg.go.dev](https://pkg.go.dev/github.com/Shopify/sarama). - Mocks for testing are available in the [mocks](./mocks) subpackage. - The [examples](./examples) directory contains more elaborate example applications. - The [tools](./tools) directory contains command line tools that can be useful for testing, diagnostics, and instrumentation. @@ -20,7 +20,7 @@ You might also want to look at the [Frequently Asked Questions](https://github.c Sarama provides a "2 releases + 2 months" compatibility guarantee: we support the two latest stable releases of Kafka and Go, and we provide a two month grace period for older releases. This means we currently officially support -Go 1.13 through 1.14, and Kafka 2.4 through 2.6, although older releases are +Go 1.14 through 1.15, and Kafka 2.5 through 2.7, although older releases are still likely to work. Sarama follows semantic versioning and provides API stability via the gopkg.in service. diff --git a/vendor/github.com/Shopify/sarama/balance_strategy.go b/vendor/github.com/Shopify/sarama/balance_strategy.go index 0ce7fea1f61..8f7634f9441 100644 --- a/vendor/github.com/Shopify/sarama/balance_strategy.go +++ b/vendor/github.com/Shopify/sarama/balance_strategy.go @@ -2,6 +2,8 @@ package sarama import ( "container/heap" + "errors" + "fmt" "math" "sort" "strings" @@ -73,20 +75,6 @@ var BalanceStrategyRange = &balanceStrategy{ }, } -// BalanceStrategyRoundRobin assigns partitions to members in alternating order. -// Example with topic T with six partitions (0..5) and two members (M1, M2): -// M1: {T: [0, 2, 4]} -// M2: {T: [1, 3, 5]} -var BalanceStrategyRoundRobin = &balanceStrategy{ - name: RoundRobinBalanceStrategyName, - coreFn: func(plan BalanceStrategyPlan, memberIDs []string, topic string, partitions []int32) { - for i, part := range partitions { - memberID := memberIDs[i%len(memberIDs)] - plan.Add(memberID, topic, part) - } - }, -} - // BalanceStrategySticky assigns partitions to members with an attempt to preserve earlier assignments // while maintain a balanced partition distribution. // Example with topic T with six partitions (0..5) and two members (M1, M2): @@ -353,6 +341,92 @@ func (s *stickyBalanceStrategy) balance(currentAssignment map[string][]topicPart } } +// BalanceStrategyRoundRobin assigns partitions to members in alternating order. +// For example, there are two topics (t0, t1) and two consumer (m0, m1), and each topic has three partitions (p0, p1, p2): +// M0: [t0p0, t0p2, t1p1] +// M1: [t0p1, t1p0, t1p2] +var BalanceStrategyRoundRobin = new(roundRobinBalancer) + +type roundRobinBalancer struct{} + +func (b *roundRobinBalancer) Name() string { + return RoundRobinBalanceStrategyName +} + +func (b *roundRobinBalancer) Plan(memberAndMetadata map[string]ConsumerGroupMemberMetadata, topics map[string][]int32) (BalanceStrategyPlan, error) { + if len(memberAndMetadata) == 0 || len(topics) == 0 { + return nil, errors.New("members and topics are not provided") + } + // sort partitions + var topicPartitions []topicAndPartition + for topic, partitions := range topics { + for _, partition := range partitions { + topicPartitions = append(topicPartitions, topicAndPartition{topic: topic, partition: partition}) + } + } + sort.SliceStable(topicPartitions, func(i, j int) bool { + pi := topicPartitions[i] + pj := topicPartitions[j] + return pi.comparedValue() < pj.comparedValue() + }) + + // sort members + var members []memberAndTopic + for memberID, meta := range memberAndMetadata { + m := memberAndTopic{ + memberID: memberID, + topics: make(map[string]struct{}), + } + for _, t := range meta.Topics { + m.topics[t] = struct{}{} + } + members = append(members, m) + } + sort.SliceStable(members, func(i, j int) bool { + mi := members[i] + mj := members[j] + return mi.memberID < mj.memberID + }) + + // assign partitions + plan := make(BalanceStrategyPlan, len(members)) + i := 0 + n := len(members) + for _, tp := range topicPartitions { + m := members[i%n] + for !m.hasTopic(tp.topic) { + i++ + m = members[i%n] + } + plan.Add(m.memberID, tp.topic, tp.partition) + i++ + } + return plan, nil +} + +func (b *roundRobinBalancer) AssignmentData(memberID string, topics map[string][]int32, generationID int32) ([]byte, error) { + return nil, nil // do nothing for now +} + +type topicAndPartition struct { + topic string + partition int32 +} + +func (tp *topicAndPartition) comparedValue() string { + return fmt.Sprintf("%s-%d", tp.topic, tp.partition) +} + +type memberAndTopic struct { + memberID string + topics map[string]struct{} +} + +func (m *memberAndTopic) hasTopic(topic string) bool { + _, isExist := m.topics[topic] + return isExist +} + // Calculate the balance score of the given assignment, as the sum of assigned partitions size difference of all consumer pairs. // A perfectly balanced assignment (with all consumers getting the same number of partitions) has a balance score of 0. // Lower balance score indicates a more balanced assignment. diff --git a/vendor/github.com/Shopify/sarama/client.go b/vendor/github.com/Shopify/sarama/client.go index f0073382241..6127ed780a0 100644 --- a/vendor/github.com/Shopify/sarama/client.go +++ b/vendor/github.com/Shopify/sarama/client.go @@ -29,6 +29,9 @@ type Client interface { // Brokers returns the current set of active brokers as retrieved from cluster metadata. Brokers() []*Broker + // Broker returns the active Broker if available for the broker ID. + Broker(brokerID int32) (*Broker, error) + // Topics returns the set of available topics as retrieved from cluster metadata. Topics() ([]string, error) @@ -198,6 +201,17 @@ func (client *client) Brokers() []*Broker { return brokers } +func (client *client) Broker(brokerID int32) (*Broker, error) { + client.lock.RLock() + defer client.lock.RUnlock() + broker, ok := client.brokers[brokerID] + if !ok { + return nil, ErrBrokerNotFound + } + _ = broker.Open(client.conf) + return broker, nil +} + func (client *client) InitProducerID() (*InitProducerIDResponse, error) { var err error for broker := client.any(); broker != nil; broker = client.any() { diff --git a/vendor/github.com/Shopify/sarama/consumer.go b/vendor/github.com/Shopify/sarama/consumer.go index fbdbff23ba5..9bd8d1820f0 100644 --- a/vendor/github.com/Shopify/sarama/consumer.go +++ b/vendor/github.com/Shopify/sarama/consumer.go @@ -303,6 +303,8 @@ type partitionConsumer struct { errors chan *ConsumerError feeder chan *FetchResponse + preferredReadReplica int32 + trigger, dying chan none closeOnce sync.Once topic string @@ -363,18 +365,29 @@ func (child *partitionConsumer) dispatcher() { close(child.feeder) } +func (child *partitionConsumer) preferredBroker() (*Broker, error) { + if child.preferredReadReplica >= 0 { + broker, err := child.consumer.client.Broker(child.preferredReadReplica) + if err == nil { + return broker, nil + } + } + + // if prefered replica cannot be found fallback to leader + return child.consumer.client.Leader(child.topic, child.partition) +} + func (child *partitionConsumer) dispatch() error { if err := child.consumer.client.RefreshMetadata(child.topic); err != nil { return err } - var leader *Broker - var err error - if leader, err = child.consumer.client.Leader(child.topic, child.partition); err != nil { + broker, err := child.preferredBroker() + if err != nil { return err } - child.broker = child.consumer.refBrokerConsumer(leader) + child.broker = child.consumer.refBrokerConsumer(broker) child.broker.input <- child @@ -593,6 +606,8 @@ func (child *partitionConsumer) parseResponse(response *FetchResponse) ([]*Consu consumerBatchSizeMetric.Update(int64(nRecs)) + child.preferredReadReplica = block.PreferredReadReplica + if nRecs == 0 { partialTrailingMessage, err := block.isPartial() if err != nil { @@ -823,9 +838,19 @@ func (bc *brokerConsumer) handleResponses() { result := child.responseResult child.responseResult = nil + if result == nil { + if child.preferredReadReplica >= 0 && bc.broker.ID() != child.preferredReadReplica { + // not an error but needs redispatching to consume from prefered replica + child.trigger <- none{} + delete(bc.subscriptions, child) + } + continue + } + + // Discard any replica preference. + child.preferredReadReplica = -1 + switch result { - case nil: - // no-op case errTimedOut: Logger.Printf("consumer/broker/%d abandoned subscription to %s/%d because consuming was taking too long\n", bc.broker.ID(), child.topic, child.partition) diff --git a/vendor/github.com/Shopify/sarama/dev.yml b/vendor/github.com/Shopify/sarama/dev.yml index 5003542d48b..bfd295e91e8 100644 --- a/vendor/github.com/Shopify/sarama/dev.yml +++ b/vendor/github.com/Shopify/sarama/dev.yml @@ -2,7 +2,7 @@ name: sarama up: - go: - version: '1.15.2' + version: '1.15.6' commands: test: diff --git a/vendor/github.com/Shopify/sarama/docker-compose.yml b/vendor/github.com/Shopify/sarama/docker-compose.yml index 25593fd3b71..1a184fbe202 100644 --- a/vendor/github.com/Shopify/sarama/docker-compose.yml +++ b/vendor/github.com/Shopify/sarama/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.7' services: zookeeper-1: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: ZOOKEEPER_SERVER_ID: '1' @@ -13,7 +13,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' zookeeper-2: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: ZOOKEEPER_SERVER_ID: '2' @@ -25,7 +25,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' zookeeper-3: - image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-zookeeper:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: ZOOKEEPER_SERVER_ID: '3' @@ -37,7 +37,7 @@ services: ZOOKEEPER_SYNC_LIMIT: '5' ZOOKEEPER_MAX_CLIENT_CONNS: '0' kafka-1: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -54,7 +54,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-2: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -71,7 +71,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-3: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -88,7 +88,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-4: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' @@ -105,7 +105,7 @@ services: KAFKA_DELETE_TOPIC_ENABLE: 'true' KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'false' kafka-5: - image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-5.5.0}' + image: 'confluentinc/cp-kafka:${CONFLUENT_PLATFORM_VERSION:-6.0.1}' restart: always environment: KAFKA_ZOOKEEPER_CONNECT: 'zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181' diff --git a/vendor/github.com/Shopify/sarama/errors.go b/vendor/github.com/Shopify/sarama/errors.go index ca621b09268..5781c1c0c25 100644 --- a/vendor/github.com/Shopify/sarama/errors.go +++ b/vendor/github.com/Shopify/sarama/errors.go @@ -9,6 +9,9 @@ import ( // or otherwise failed to respond. var ErrOutOfBrokers = errors.New("kafka: client has run out of available brokers to talk to (Is your cluster reachable?)") +// ErrBrokerNotFound is the error returned when there's no broker found for the requested ID. +var ErrBrokerNotFound = errors.New("kafka: broker for ID is not found") + // ErrClosedClient is the error returned when a method is called on a client that has been closed. var ErrClosedClient = errors.New("kafka: tried to use a client that was closed") diff --git a/vendor/github.com/Shopify/sarama/fetch_response.go b/vendor/github.com/Shopify/sarama/fetch_response.go index ca6d78832cf..54b88284ad9 100644 --- a/vendor/github.com/Shopify/sarama/fetch_response.go +++ b/vendor/github.com/Shopify/sarama/fetch_response.go @@ -89,6 +89,8 @@ func (b *FetchResponseBlock) decode(pd packetDecoder, version int16) (err error) if err != nil { return err } + } else { + b.PreferredReadReplica = -1 } recordsSize, err := pd.getInt32() diff --git a/vendor/github.com/Shopify/sarama/go.mod b/vendor/github.com/Shopify/sarama/go.mod index 1392d610d4e..f4cc90c009a 100644 --- a/vendor/github.com/Shopify/sarama/go.mod +++ b/vendor/github.com/Shopify/sarama/go.mod @@ -9,27 +9,20 @@ require ( github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 github.com/eapache/queue v1.1.0 github.com/fortytw2/leaktest v1.3.0 - github.com/frankban/quicktest v1.10.2 // indirect - github.com/golang/snappy v0.0.1 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/jcmturner/gofork v1.0.0 - github.com/klauspost/compress v1.11.0 + github.com/frankban/quicktest v1.11.3 // indirect + github.com/golang/snappy v0.0.2 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.2 + github.com/klauspost/compress v1.11.7 github.com/kr/text v0.2.0 // indirect - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/pierrec/lz4 v2.5.2+incompatible - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 - github.com/stretchr/testify v1.6.1 + github.com/pierrec/lz4 v2.6.0+incompatible + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 + github.com/stretchr/testify v1.7.0 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c github.com/xdg/stringprep v1.0.0 // indirect - golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect - golang.org/x/net v0.0.0-20200904194848-62affa334b73 - golang.org/x/text v0.3.3 // indirect + golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad // indirect + golang.org/x/net v0.0.0-20210119194325-5f4716e94777 + golang.org/x/text v0.3.5 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect - gopkg.in/jcmturner/aescts.v1 v1.0.1 // indirect - gopkg.in/jcmturner/dnsutils.v1 v1.0.1 // indirect - gopkg.in/jcmturner/goidentity.v3 v3.0.0 // indirect - gopkg.in/jcmturner/gokrb5.v7 v7.5.0 - gopkg.in/jcmturner/rpc.v1 v1.1.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/vendor/github.com/Shopify/sarama/go.sum b/vendor/github.com/Shopify/sarama/go.sum index dce6814213c..94afb2ae585 100644 --- a/vendor/github.com/Shopify/sarama/go.sum +++ b/vendor/github.com/Shopify/sarama/go.sum @@ -12,18 +12,32 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.10.2 h1:19ARM85nVi4xH7xPXuc5eM/udya5ieh7b/Sv+d844Tk= -github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= +github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= +github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= +github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= +github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= +github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= +github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= +github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg= -github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= +github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= +github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= +github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= +github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -31,37 +45,43 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= +github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -69,19 +89,10 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1 h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0 h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlIrg= -gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0 h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/Shopify/sarama/gssapi_kerberos.go b/vendor/github.com/Shopify/sarama/gssapi_kerberos.go index 1993fc08fc5..44fd44625cc 100644 --- a/vendor/github.com/Shopify/sarama/gssapi_kerberos.go +++ b/vendor/github.com/Shopify/sarama/gssapi_kerberos.go @@ -1,19 +1,19 @@ package sarama import ( + "encoding/asn1" "encoding/binary" "fmt" "io" "strings" "time" - "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/gssapi" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/gssapi" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) const ( @@ -154,7 +154,7 @@ func (krbAuth *GSSAPIKerberosAuth) createKrb5Token( * */ func (krbAuth *GSSAPIKerberosAuth) appendGSSAPIHeader(payload []byte) ([]byte, error) { - oidBytes, err := asn1.Marshal(gssapi.OID(gssapi.OIDKRB5)) + oidBytes, err := asn1.Marshal(gssapi.OIDKRB5.OID()) if err != nil { return nil, err } diff --git a/vendor/github.com/Shopify/sarama/kerberos_client.go b/vendor/github.com/Shopify/sarama/kerberos_client.go index ebc11417988..01a53193bb9 100644 --- a/vendor/github.com/Shopify/sarama/kerberos_client.go +++ b/vendor/github.com/Shopify/sarama/kerberos_client.go @@ -1,10 +1,10 @@ package sarama import ( - krb5client "gopkg.in/jcmturner/gokrb5.v7/client" - krb5config "gopkg.in/jcmturner/gokrb5.v7/config" - "gopkg.in/jcmturner/gokrb5.v7/keytab" - "gopkg.in/jcmturner/gokrb5.v7/types" + krb5client "github.com/jcmturner/gokrb5/v8/client" + krb5config "github.com/jcmturner/gokrb5/v8/config" + "github.com/jcmturner/gokrb5/v8/keytab" + "github.com/jcmturner/gokrb5/v8/types" ) type KerberosGoKrb5Client struct { @@ -37,9 +37,9 @@ func createClient(config *GSSAPIConfig, cfg *krb5config.Config) (KerberosClient, if err != nil { return nil, err } - client = krb5client.NewClientWithKeytab(config.Username, config.Realm, kt, cfg, krb5client.DisablePAFXFAST(config.DisablePAFXFAST)) + client = krb5client.NewWithKeytab(config.Username, config.Realm, kt, cfg, krb5client.DisablePAFXFAST(config.DisablePAFXFAST)) } else { - client = krb5client.NewClientWithPassword(config.Username, + client = krb5client.NewWithPassword(config.Username, config.Realm, config.Password, cfg, krb5client.DisablePAFXFAST(config.DisablePAFXFAST)) } return &KerberosGoKrb5Client{*client}, nil diff --git a/vendor/github.com/Shopify/sarama/mockkerberos.go b/vendor/github.com/Shopify/sarama/mockkerberos.go index d36649d8ace..beb00e5b53e 100644 --- a/vendor/github.com/Shopify/sarama/mockkerberos.go +++ b/vendor/github.com/Shopify/sarama/mockkerberos.go @@ -4,11 +4,11 @@ import ( "encoding/binary" "encoding/hex" - "gopkg.in/jcmturner/gokrb5.v7/credentials" - "gopkg.in/jcmturner/gokrb5.v7/gssapi" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/credentials" + "github.com/jcmturner/gokrb5/v8/gssapi" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) type KafkaGSSAPIHandler struct { diff --git a/vendor/github.com/Shopify/sarama/offset_manager.go b/vendor/github.com/Shopify/sarama/offset_manager.go index b4fea8226ad..4f480a08b90 100644 --- a/vendor/github.com/Shopify/sarama/offset_manager.go +++ b/vendor/github.com/Shopify/sarama/offset_manager.go @@ -113,10 +113,12 @@ func (om *offsetManager) Close() error { om.asyncClosePOMs() // flush one last time - for attempt := 0; attempt <= om.conf.Consumer.Offsets.Retry.Max; attempt++ { - om.flushToBroker() - if om.releasePOMs(false) == 0 { - break + if om.conf.Consumer.Offsets.AutoCommit.Enable { + for attempt := 0; attempt <= om.conf.Consumer.Offsets.Retry.Max; attempt++ { + om.flushToBroker() + if om.releasePOMs(false) == 0 { + break + } } } diff --git a/vendor/github.com/Shopify/sarama/utils.go b/vendor/github.com/Shopify/sarama/utils.go index 3e9dfd7add7..de4d7a102c7 100644 --- a/vendor/github.com/Shopify/sarama/utils.go +++ b/vendor/github.com/Shopify/sarama/utils.go @@ -162,6 +162,7 @@ var ( V2_4_0_0 = newKafkaVersion(2, 4, 0, 0) V2_5_0_0 = newKafkaVersion(2, 5, 0, 0) V2_6_0_0 = newKafkaVersion(2, 6, 0, 0) + V2_7_0_0 = newKafkaVersion(2, 7, 0, 0) SupportedVersions = []KafkaVersion{ V0_8_2_0, @@ -189,9 +190,10 @@ var ( V2_4_0_0, V2_5_0_0, V2_6_0_0, + V2_7_0_0, } MinVersion = V0_8_2_0 - MaxVersion = V2_6_0_0 + MaxVersion = V2_7_0_0 DefaultVersion = V1_0_0_0 ) diff --git a/vendor/github.com/gogo/protobuf/proto/text_parser.go b/vendor/github.com/gogo/protobuf/proto/text_parser.go index 1ce0be2fa9b..f85c0cc81a7 100644 --- a/vendor/github.com/gogo/protobuf/proto/text_parser.go +++ b/vendor/github.com/gogo/protobuf/proto/text_parser.go @@ -318,7 +318,7 @@ func unescape(s string) (ch string, tail string, err error) { if i > utf8.MaxRune { return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss) } - return string(i), s, nil + return string(rune(i)), s, nil } return "", "", fmt.Errorf(`unknown escape \%c`, r) } diff --git a/vendor/github.com/gogo/protobuf/types/any.pb.go b/vendor/github.com/gogo/protobuf/types/any.pb.go index 98e269d5439..e3d4d9490f5 100644 --- a/vendor/github.com/gogo/protobuf/types/any.pb.go +++ b/vendor/github.com/gogo/protobuf/types/any.pb.go @@ -592,10 +592,7 @@ func (m *Any) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthAny - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthAny } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/api.pb.go b/vendor/github.com/gogo/protobuf/types/api.pb.go index 58bf4b53b32..83e8869206f 100644 --- a/vendor/github.com/gogo/protobuf/types/api.pb.go +++ b/vendor/github.com/gogo/protobuf/types/api.pb.go @@ -1677,10 +1677,7 @@ func (m *Api) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { @@ -1920,10 +1917,7 @@ func (m *Method) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { @@ -2038,10 +2032,7 @@ func (m *Mixin) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/duration.pb.go b/vendor/github.com/gogo/protobuf/types/duration.pb.go index 3959f066909..4deafcb1ce9 100644 --- a/vendor/github.com/gogo/protobuf/types/duration.pb.go +++ b/vendor/github.com/gogo/protobuf/types/duration.pb.go @@ -415,10 +415,7 @@ func (m *Duration) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthDuration - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthDuration } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/empty.pb.go b/vendor/github.com/gogo/protobuf/types/empty.pb.go index 17e3aa55839..9e94748b3a3 100644 --- a/vendor/github.com/gogo/protobuf/types/empty.pb.go +++ b/vendor/github.com/gogo/protobuf/types/empty.pb.go @@ -360,10 +360,7 @@ func (m *Empty) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthEmpty - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthEmpty } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/field_mask.pb.go b/vendor/github.com/gogo/protobuf/types/field_mask.pb.go index 7226b57f735..6ae346d9252 100644 --- a/vendor/github.com/gogo/protobuf/types/field_mask.pb.go +++ b/vendor/github.com/gogo/protobuf/types/field_mask.pb.go @@ -636,10 +636,7 @@ func (m *FieldMask) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthFieldMask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthFieldMask } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/source_context.pb.go b/vendor/github.com/gogo/protobuf/types/source_context.pb.go index 61045ce10d5..8e6ce71b275 100644 --- a/vendor/github.com/gogo/protobuf/types/source_context.pb.go +++ b/vendor/github.com/gogo/protobuf/types/source_context.pb.go @@ -422,10 +422,7 @@ func (m *SourceContext) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthSourceContext - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthSourceContext } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/struct.pb.go b/vendor/github.com/gogo/protobuf/types/struct.pb.go index cea553eef60..c0457312e67 100644 --- a/vendor/github.com/gogo/protobuf/types/struct.pb.go +++ b/vendor/github.com/gogo/protobuf/types/struct.pb.go @@ -1862,7 +1862,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStruct } if (iNdEx + skippy) > postIndex { @@ -1879,10 +1879,7 @@ func (m *Struct) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStruct } if (iNdEx + skippy) > l { @@ -2087,10 +2084,7 @@ func (m *Value) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStruct } if (iNdEx + skippy) > l { @@ -2175,10 +2169,7 @@ func (m *ListValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStruct - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStruct } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/timestamp.pb.go b/vendor/github.com/gogo/protobuf/types/timestamp.pb.go index b818752670c..45db7b3bb1c 100644 --- a/vendor/github.com/gogo/protobuf/types/timestamp.pb.go +++ b/vendor/github.com/gogo/protobuf/types/timestamp.pb.go @@ -437,10 +437,7 @@ func (m *Timestamp) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTimestamp - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTimestamp } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/type.pb.go b/vendor/github.com/gogo/protobuf/types/type.pb.go index 13b7ec02f79..791427bb228 100644 --- a/vendor/github.com/gogo/protobuf/types/type.pb.go +++ b/vendor/github.com/gogo/protobuf/types/type.pb.go @@ -2483,10 +2483,7 @@ func (m *Type) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthType } if (iNdEx + skippy) > l { @@ -2795,10 +2792,7 @@ func (m *Field) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthType } if (iNdEx + skippy) > l { @@ -3004,10 +2998,7 @@ func (m *Enum) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthType } if (iNdEx + skippy) > l { @@ -3143,10 +3134,7 @@ func (m *EnumValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthType } if (iNdEx + skippy) > l { @@ -3265,10 +3253,7 @@ func (m *Option) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthType - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthType } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/gogo/protobuf/types/wrappers.pb.go b/vendor/github.com/gogo/protobuf/types/wrappers.pb.go index 8f1edb57d30..8d415420a74 100644 --- a/vendor/github.com/gogo/protobuf/types/wrappers.pb.go +++ b/vendor/github.com/gogo/protobuf/types/wrappers.pb.go @@ -2020,10 +2020,7 @@ func (m *DoubleValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2085,10 +2082,7 @@ func (m *FloatValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2158,10 +2152,7 @@ func (m *Int64Value) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2231,10 +2222,7 @@ func (m *UInt64Value) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2304,10 +2292,7 @@ func (m *Int32Value) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2377,10 +2362,7 @@ func (m *UInt32Value) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2451,10 +2433,7 @@ func (m *BoolValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2537,10 +2516,7 @@ func (m *StringValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { @@ -2625,10 +2601,7 @@ func (m *BytesValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthWrappers - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthWrappers } if (iNdEx + skippy) > l { diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b1746163151..b404f4bec27 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -26,8 +26,8 @@ var ( // NewMD5 and NewSHA1. func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() - h.Write(space[:]) - h.Write(data) + h.Write(space[:]) //nolint:errcheck + h.Write(data) //nolint:errcheck s := h.Sum(nil) var uuid UUID copy(uuid[:], s) diff --git a/vendor/github.com/google/uuid/sql.go b/vendor/github.com/google/uuid/sql.go index f326b54db37..2e02ec06c01 100644 --- a/vendor/github.com/google/uuid/sql.go +++ b/vendor/github.com/google/uuid/sql.go @@ -9,7 +9,7 @@ import ( "fmt" ) -// Scan implements sql.Scanner so UUIDs can be read from databases transparently +// Scan implements sql.Scanner so UUIDs can be read from databases transparently. // Currently, database types that map to string and []byte are supported. Please // consult database-specific driver documentation for matching types. func (uuid *UUID) Scan(src interface{}) error { diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index 524404cc522..60d26bb50c6 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -35,6 +35,12 @@ const ( var rander = rand.Reader // random function +type invalidLengthError struct{ len int } + +func (err invalidLengthError) Error() string { + return fmt.Sprintf("invalid UUID length: %d", err.len) +} + // Parse decodes s into a UUID or returns an error. Both the standard UUID // forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the @@ -68,7 +74,7 @@ func Parse(s string) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(s)) + return uuid, invalidLengthError{len(s)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx @@ -112,7 +118,7 @@ func ParseBytes(b []byte) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(b)) + return uuid, invalidLengthError{len(b)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index c110465db59..86160fbd072 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -14,6 +14,14 @@ func New() UUID { return Must(NewRandom()) } +// NewString creates a new random UUID and returns it as a string or panics. +// NewString is equivalent to the expression +// +// uuid.New().String() +func NewString() string { + return Must(NewRandom()).String() +} + // NewRandom returns a Random (Version 4) UUID. // // The strength of the UUIDs is based on the strength of the crypto/rand diff --git a/vendor/gopkg.in/jcmturner/aescts.v1/LICENSE b/vendor/github.com/jcmturner/aescts/v2/LICENSE similarity index 100% rename from vendor/gopkg.in/jcmturner/aescts.v1/LICENSE rename to vendor/github.com/jcmturner/aescts/v2/LICENSE diff --git a/vendor/gopkg.in/jcmturner/aescts.v1/aescts.go b/vendor/github.com/jcmturner/aescts/v2/aescts.go similarity index 93% rename from vendor/gopkg.in/jcmturner/aescts.v1/aescts.go rename to vendor/github.com/jcmturner/aescts/v2/aescts.go index 278713ea5b4..fee3b43e91e 100644 --- a/vendor/gopkg.in/jcmturner/aescts.v1/aescts.go +++ b/vendor/github.com/jcmturner/aescts/v2/aescts.go @@ -15,7 +15,7 @@ func Encrypt(key, iv, plaintext []byte) ([]byte, []byte, error) { block, err := aes.NewCipher(key) if err != nil { - return []byte{}, []byte{}, fmt.Errorf("Error creating cipher: %v", err) + return []byte{}, []byte{}, fmt.Errorf("error creating cipher: %v", err) } mode := cipher.NewCBCEncrypter(block, iv) @@ -43,7 +43,7 @@ func Encrypt(key, iv, plaintext []byte) ([]byte, []byte, error) { m, _ = zeroPad(m, aes.BlockSize) rb, pb, lb, err := tailBlocks(m, aes.BlockSize) if err != nil { - return []byte{}, []byte{}, fmt.Errorf("Error tailing blocks: %v", err) + return []byte{}, []byte{}, fmt.Errorf("error tailing blocks: %v", err) } var ct []byte if rb != nil { @@ -70,12 +70,12 @@ func Decrypt(key, iv, ciphertext []byte) ([]byte, error) { ct := make([]byte, len(ciphertext)) copy(ct, ciphertext) if len(ct) < aes.BlockSize { - return []byte{}, fmt.Errorf("Ciphertext is not large enough. It is less that one block size. Blocksize:%v; Ciphertext:%v", aes.BlockSize, len(ct)) + return []byte{}, fmt.Errorf("ciphertext is not large enough. It is less that one block size. Blocksize:%v; Ciphertext:%v", aes.BlockSize, len(ct)) } // Configure the CBC block, err := aes.NewCipher(key) if err != nil { - return nil, fmt.Errorf("Error creating cipher: %v", err) + return nil, fmt.Errorf("error creating cipher: %v", err) } var mode cipher.BlockMode @@ -172,10 +172,10 @@ func swapLastTwoBlocks(b []byte, c int) ([]byte, error) { // zeroPad pads bytes with zeros to nearest multiple of message size m. func zeroPad(b []byte, m int) ([]byte, error) { if m <= 0 { - return nil, errors.New("Invalid message block size when padding") + return nil, errors.New("invalid message block size when padding") } if b == nil || len(b) == 0 { - return nil, errors.New("Data not valid to pad: Zero size") + return nil, errors.New("data not valid to pad: Zero size") } if l := len(b) % m; l != 0 { n := m - l diff --git a/vendor/github.com/jcmturner/aescts/v2/go.mod b/vendor/github.com/jcmturner/aescts/v2/go.mod new file mode 100644 index 00000000000..034c3cec60c --- /dev/null +++ b/vendor/github.com/jcmturner/aescts/v2/go.mod @@ -0,0 +1,5 @@ +module github.com/jcmturner/aescts/v2 + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/vendor/github.com/jcmturner/aescts/v2/go.sum b/vendor/github.com/jcmturner/aescts/v2/go.sum new file mode 100644 index 00000000000..e863f517e19 --- /dev/null +++ b/vendor/github.com/jcmturner/aescts/v2/go.sum @@ -0,0 +1,10 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/gopkg.in/jcmturner/dnsutils.v1/LICENSE b/vendor/github.com/jcmturner/dnsutils/v2/LICENSE similarity index 100% rename from vendor/gopkg.in/jcmturner/dnsutils.v1/LICENSE rename to vendor/github.com/jcmturner/dnsutils/v2/LICENSE diff --git a/vendor/github.com/jcmturner/dnsutils/v2/go.mod b/vendor/github.com/jcmturner/dnsutils/v2/go.mod new file mode 100644 index 00000000000..f75ac6d264d --- /dev/null +++ b/vendor/github.com/jcmturner/dnsutils/v2/go.mod @@ -0,0 +1,5 @@ +module github.com/jcmturner/dnsutils/v2 + +go 1.13 + +require github.com/stretchr/testify v1.4.0 diff --git a/vendor/github.com/jcmturner/dnsutils/v2/go.sum b/vendor/github.com/jcmturner/dnsutils/v2/go.sum new file mode 100644 index 00000000000..e863f517e19 --- /dev/null +++ b/vendor/github.com/jcmturner/dnsutils/v2/go.sum @@ -0,0 +1,10 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/gopkg.in/jcmturner/dnsutils.v1/srv.go b/vendor/github.com/jcmturner/dnsutils/v2/srv.go similarity index 100% rename from vendor/gopkg.in/jcmturner/dnsutils.v1/srv.go rename to vendor/github.com/jcmturner/dnsutils/v2/srv.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/LICENSE b/vendor/github.com/jcmturner/gokrb5/v8/LICENSE similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/LICENSE rename to vendor/github.com/jcmturner/gokrb5/v8/LICENSE diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/asn1tools/tools.go b/vendor/github.com/jcmturner/gokrb5/v8/asn1tools/tools.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/asn1tools/tools.go rename to vendor/github.com/jcmturner/gokrb5/v8/asn1tools/tools.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/ASExchange.go b/vendor/github.com/jcmturner/gokrb5/v8/client/ASExchange.go similarity index 85% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/ASExchange.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/ASExchange.go index 9d1a2f3f50f..5becccc4dde 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/ASExchange.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/ASExchange.go @@ -1,14 +1,14 @@ package client import ( - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/patype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/crypto/etype" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/patype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // ASExchange performs an AS exchange for the client to retrieve a TGT. @@ -86,6 +86,7 @@ func setPAData(cl *Client, krberr *messages.KRBError, ASReq *messages.ASReq) err var et etype.EType var err error var key types.EncryptionKey + var kvno int if krberr == nil { // This is not in response to an error from the KDC. It is preemptive or renewal // There is no KRB Error that tells us the etype to use @@ -97,7 +98,7 @@ func setPAData(cl *Client, krberr *messages.KRBError, ASReq *messages.ASReq) err if err != nil { return krberror.Errorf(err, krberror.EncryptingError, "error getting etype for pre-auth encryption") } - key, err = cl.Key(et, nil) + key, kvno, err = cl.Key(et, 0, nil) if err != nil { return krberror.Errorf(err, krberror.EncryptingError, "error getting key from credentials") } @@ -108,7 +109,7 @@ func setPAData(cl *Client, krberr *messages.KRBError, ASReq *messages.ASReq) err return krberror.Errorf(err, krberror.EncryptingError, "error getting etype for pre-auth encryption") } cl.settings.preAuthEType = et.GetETypeID() // Set the etype that has been defined for potential future use - key, err = cl.Key(et, krberr) + key, kvno, err = cl.Key(et, 0, krberr) if err != nil { return krberror.Errorf(err, krberror.EncryptingError, "error getting key from credentials") } @@ -118,8 +119,7 @@ func setPAData(cl *Client, krberr *messages.KRBError, ASReq *messages.ASReq) err if err != nil { return krberror.Errorf(err, krberror.KRBMsgError, "error creating PAEncTSEnc for Pre-Authentication") } - //TODO (theme: KVNO from keytab) the kvno should not be hard coded to 1 as this hampers troubleshooting. - paEncTS, err := crypto.GetEncryptedData(paTSb, key, keyusage.AS_REQ_PA_ENC_TIMESTAMP, 1) + paEncTS, err := crypto.GetEncryptedData(paTSb, key, keyusage.AS_REQ_PA_ENC_TIMESTAMP, kvno) if err != nil { return krberror.Errorf(err, krberror.EncryptingError, "error encrypting pre-authentication timestamp") } @@ -145,15 +145,7 @@ func setPAData(cl *Client, krberr *messages.KRBError, ASReq *messages.ASReq) err // preAuthEType establishes what encryption type to use for pre-authentication from the KRBError returned from the KDC. func preAuthEType(krberr *messages.KRBError) (etype etype.EType, err error) { - //The preferred ordering of the "hint" pre-authentication data that - //affect client key selection is: ETYPE-INFO2, followed by ETYPE-INFO, - //followed by PW-SALT. - //A KDC SHOULD NOT send PA-PW-SALT when issuing a KRB-ERROR message - //that requests additional pre-authentication. Implementation note: - //Some KDC implementations issue an erroneous PA-PW-SALT when issuing a - //KRB-ERROR message that requests additional pre-authentication. - //Therefore, clients SHOULD ignore a PA-PW-SALT accompanying a - //KRB-ERROR message that requests additional pre-authentication. + //RFC 4120 5.2.7.5 covers the preference order of ETYPE-INFO2 and ETYPE-INFO. var etypeID int32 var pas types.PADataSequence e := pas.Unmarshal(krberr.EData) @@ -161,6 +153,7 @@ func preAuthEType(krberr *messages.KRBError) (etype etype.EType, err error) { err = krberror.Errorf(e, krberror.EncodingError, "error unmashalling KRBError data") return } +Loop: for _, pa := range pas { switch pa.PADataType { case patype.PA_ETYPE_INFO2: @@ -170,7 +163,7 @@ func preAuthEType(krberr *messages.KRBError) (etype etype.EType, err error) { return } etypeID = info[0].EType - break + break Loop case patype.PA_ETYPE_INFO: info, e := pa.GetETypeInfo() if e != nil { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/TGSExchange.go b/vendor/github.com/jcmturner/gokrb5/v8/client/TGSExchange.go similarity index 95% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/TGSExchange.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/TGSExchange.go index 93ff1dbaf03..e4571ce8669 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/TGSExchange.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/TGSExchange.go @@ -1,11 +1,11 @@ package client import ( - "gopkg.in/jcmturner/gokrb5.v7/iana/flags" - "gopkg.in/jcmturner/gokrb5.v7/iana/nametype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/iana/flags" + "github.com/jcmturner/gokrb5/v8/iana/nametype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // TGSREQGenerateAndExchange generates the TGS_REQ and performs a TGS exchange to retrieve a ticket to the specified SPN. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/cache.go b/vendor/github.com/jcmturner/gokrb5/v8/client/cache.go similarity index 79% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/cache.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/cache.go index 07b4a01dc9c..552e73e41e1 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/cache.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/cache.go @@ -1,12 +1,14 @@ package client import ( + "encoding/json" "errors" + "sort" "sync" "time" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // Cache for service tickets held by the client. @@ -17,12 +19,13 @@ type Cache struct { // CacheEntry holds details for a cache entry. type CacheEntry struct { - Ticket messages.Ticket + SPN string + Ticket messages.Ticket `json:"-"` AuthTime time.Time StartTime time.Time EndTime time.Time RenewTill time.Time - SessionKey types.EncryptionKey + SessionKey types.EncryptionKey `json:"-"` } // NewCache creates a new client ticket cache instance. @@ -40,12 +43,33 @@ func (c *Cache) getEntry(spn string) (CacheEntry, bool) { return e, ok } +// JSON returns information about the cached service tickets in a JSON format. +func (c *Cache) JSON() (string, error) { + c.mux.RLock() + defer c.mux.RUnlock() + var es []CacheEntry + keys := make([]string, 0, len(c.Entries)) + for k := range c.Entries { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + es = append(es, c.Entries[k]) + } + b, err := json.MarshalIndent(&es, "", " ") + if err != nil { + return "", err + } + return string(b), nil +} + // addEntry adds a ticket to the cache. func (c *Cache) addEntry(tkt messages.Ticket, authTime, startTime, endTime, renewTill time.Time, sessionKey types.EncryptionKey) CacheEntry { spn := tkt.SName.PrincipalNameString() c.mux.Lock() defer c.mux.Unlock() (*c).Entries[spn] = CacheEntry{ + SPN: spn, Ticket: tkt, AuthTime: authTime, StartTime: startTime, diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/client.go b/vendor/github.com/jcmturner/gokrb5/v8/client/client.go similarity index 61% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/client.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/client.go index cc931748aea..074e3f1245f 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/client.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/client.go @@ -2,20 +2,23 @@ package client import ( + "encoding/json" "errors" "fmt" + "io" + "strings" "time" - "gopkg.in/jcmturner/gokrb5.v7/config" - "gopkg.in/jcmturner/gokrb5.v7/credentials" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/iana/nametype" - "gopkg.in/jcmturner/gokrb5.v7/keytab" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/config" + "github.com/jcmturner/gokrb5/v8/credentials" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/crypto/etype" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/iana/nametype" + "github.com/jcmturner/gokrb5/v8/keytab" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // Client side configuration and state. @@ -27,9 +30,9 @@ type Client struct { cache *Cache } -// NewClientWithPassword creates a new client from a password credential. +// NewWithPassword creates a new client from a password credential. // Set the realm to empty string to use the default realm from config. -func NewClientWithPassword(username, realm, password string, krb5conf *config.Config, settings ...func(*Settings)) *Client { +func NewWithPassword(username, realm, password string, krb5conf *config.Config, settings ...func(*Settings)) *Client { creds := credentials.New(username, realm) return &Client{ Credentials: creds.WithPassword(password), @@ -42,8 +45,8 @@ func NewClientWithPassword(username, realm, password string, krb5conf *config.Co } } -// NewClientWithKeytab creates a new client from a keytab credential. -func NewClientWithKeytab(username, realm string, kt *keytab.Keytab, krb5conf *config.Config, settings ...func(*Settings)) *Client { +// NewWithKeytab creates a new client from a keytab credential. +func NewWithKeytab(username, realm string, kt *keytab.Keytab, krb5conf *config.Config, settings ...func(*Settings)) *Client { creds := credentials.New(username, realm) return &Client{ Credentials: creds.WithKeytab(kt), @@ -56,10 +59,10 @@ func NewClientWithKeytab(username, realm string, kt *keytab.Keytab, krb5conf *co } } -// NewClientFromCCache create a client from a populated client cache. +// NewFromCCache create a client from a populated client cache. // // WARNING: A client created from CCache does not automatically renew TGTs and a failure will occur after the TGT expires. -func NewClientFromCCache(c *credentials.CCache, krb5conf *config.Config, settings ...func(*Settings)) (*Client, error) { +func NewFromCCache(c *credentials.CCache, krb5conf *config.Config, settings ...func(*Settings)) (*Client, error) { cl := &Client{ Credentials: c.GetClientCredentials(), Config: krb5conf, @@ -108,28 +111,28 @@ func NewClientFromCCache(c *credentials.CCache, krb5conf *config.Config, setting return cl, nil } -// Key returns the client's encryption key for the specified encryption type. +// Key returns the client's encryption key for the specified encryption type and its kvno (kvno of zero will find latest). // The key can be retrieved either from the keytab or generated from the client's password. // If the client has both a keytab and a password defined the keytab is favoured as the source for the key // A KRBError can be passed in the event the KDC returns one of type KDC_ERR_PREAUTH_REQUIRED and is required to derive // the key for pre-authentication from the client's password. If a KRBError is not available, pass nil to this argument. -func (cl *Client) Key(etype etype.EType, krberr *messages.KRBError) (types.EncryptionKey, error) { +func (cl *Client) Key(etype etype.EType, kvno int, krberr *messages.KRBError) (types.EncryptionKey, int, error) { if cl.Credentials.HasKeytab() && etype != nil { - return cl.Credentials.Keytab().GetEncryptionKey(cl.Credentials.CName(), cl.Credentials.Domain(), 0, etype.GetETypeID()) + return cl.Credentials.Keytab().GetEncryptionKey(cl.Credentials.CName(), cl.Credentials.Domain(), kvno, etype.GetETypeID()) } else if cl.Credentials.HasPassword() { if krberr != nil && krberr.ErrorCode == errorcode.KDC_ERR_PREAUTH_REQUIRED { var pas types.PADataSequence err := pas.Unmarshal(krberr.EData) if err != nil { - return types.EncryptionKey{}, fmt.Errorf("could not get PAData from KRBError to generate key from password: %v", err) + return types.EncryptionKey{}, 0, fmt.Errorf("could not get PAData from KRBError to generate key from password: %v", err) } key, _, err := crypto.GetKeyFromPassword(cl.Credentials.Password(), krberr.CName, krberr.CRealm, etype.GetETypeID(), pas) - return key, err + return key, 0, err } key, _, err := crypto.GetKeyFromPassword(cl.Credentials.Password(), cl.Credentials.CName(), cl.Credentials.Domain(), etype.GetETypeID(), types.PADataSequence{}) - return key, err + return key, 0, err } - return types.EncryptionKey{}, errors.New("credential has neither keytab or password to generate key") + return types.EncryptionKey{}, 0, errors.New("credential has neither keytab or password to generate key") } // IsConfigured indicates if the client has the values required set. @@ -171,7 +174,7 @@ func (cl *Client) Login() error { return krberror.Errorf(err, krberror.KRBMsgError, "no user credentials available and error getting any existing session") } if time.Now().UTC().After(endTime) { - return krberror.NewKrberror(krberror.KRBMsgError, "cannot login, no user credentials available and no valid existing session") + return krberror.New(krberror.KRBMsgError, "cannot login, no user credentials available and no valid existing session") } // no credentials but there is a session with tgt already return nil @@ -239,3 +242,88 @@ func (cl *Client) Destroy() { cl.Credentials = creds cl.Log("client destroyed") } + +// Diagnostics runs a set of checks that the client is properly configured and writes details to the io.Writer provided. +func (cl *Client) Diagnostics(w io.Writer) error { + cl.Print(w) + var errs []string + if cl.Credentials.HasKeytab() { + var loginRealmEncTypes []int32 + for _, e := range cl.Credentials.Keytab().Entries { + if e.Principal.Realm == cl.Credentials.Realm() { + loginRealmEncTypes = append(loginRealmEncTypes, e.Key.KeyType) + } + } + for _, et := range cl.Config.LibDefaults.DefaultTktEnctypeIDs { + var etInKt bool + for _, val := range loginRealmEncTypes { + if val == et { + etInKt = true + break + } + } + if !etInKt { + errs = append(errs, fmt.Sprintf("default_tkt_enctypes specifies %d but this enctype is not available in the client's keytab", et)) + } + } + for _, et := range cl.Config.LibDefaults.PreferredPreauthTypes { + var etInKt bool + for _, val := range loginRealmEncTypes { + if int(val) == et { + etInKt = true + break + } + } + if !etInKt { + errs = append(errs, fmt.Sprintf("preferred_preauth_types specifies %d but this enctype is not available in the client's keytab", et)) + } + } + } + udpCnt, udpKDC, err := cl.Config.GetKDCs(cl.Credentials.Realm(), false) + if err != nil { + errs = append(errs, fmt.Sprintf("error when resolving KDCs for UDP communication: %v", err)) + } + if udpCnt < 1 { + errs = append(errs, "no KDCs resolved for communication via UDP.") + } else { + b, _ := json.MarshalIndent(&udpKDC, "", " ") + fmt.Fprintf(w, "UDP KDCs: %s\n", string(b)) + } + tcpCnt, tcpKDC, err := cl.Config.GetKDCs(cl.Credentials.Realm(), false) + if err != nil { + errs = append(errs, fmt.Sprintf("error when resolving KDCs for TCP communication: %v", err)) + } + if tcpCnt < 1 { + errs = append(errs, "no KDCs resolved for communication via TCP.") + } else { + b, _ := json.MarshalIndent(&tcpKDC, "", " ") + fmt.Fprintf(w, "TCP KDCs: %s\n", string(b)) + } + + if errs == nil || len(errs) < 1 { + return nil + } + err = fmt.Errorf(strings.Join(errs, "\n")) + return err +} + +// Print writes the details of the client to the io.Writer provided. +func (cl *Client) Print(w io.Writer) { + c, _ := cl.Credentials.JSON() + fmt.Fprintf(w, "Credentials:\n%s\n", c) + + s, _ := cl.sessions.JSON() + fmt.Fprintf(w, "TGT Sessions:\n%s\n", s) + + c, _ = cl.cache.JSON() + fmt.Fprintf(w, "Service ticket cache:\n%s\n", c) + + s, _ = cl.settings.JSON() + fmt.Fprintf(w, "Settings:\n%s\n", s) + + j, _ := cl.Config.JSON() + fmt.Fprintf(w, "Krb5 config:\n%s\n", j) + + k, _ := cl.Credentials.Keytab().JSON() + fmt.Fprintf(w, "Keytab:\n%s\n", k) +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go b/vendor/github.com/jcmturner/gokrb5/v8/client/network.go similarity index 64% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/network.go index 493fb2f3dbd..634f015c214 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/network.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/network.go @@ -1,16 +1,16 @@ package client import ( - "bytes" "encoding/binary" "errors" "fmt" "io" "net" + "strings" "time" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/messages" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/messages" ) // SendToKDC performs network actions to send data to the KDC. @@ -68,88 +68,52 @@ func (cl *Client) sendToKDC(b []byte, realm string) ([]byte, error) { return rb, nil } -// dialKDCTCP establishes a UDP connection to a KDC. -func dialKDCUDP(count int, kdcs map[int]string) (*net.UDPConn, error) { - i := 1 - for i <= count { - udpAddr, err := net.ResolveUDPAddr("udp", kdcs[i]) - if err != nil { - return nil, fmt.Errorf("error resolving KDC address: %v", err) - } - - conn, err := net.DialTimeout("udp", udpAddr.String(), 5*time.Second) - if err == nil { - if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { - return nil, err - } - // conn is guaranteed to be a UDPConn - return conn.(*net.UDPConn), nil - } - i++ - } - return nil, errors.New("error in getting a UDP connection to any of the KDCs") -} - -// dialKDCTCP establishes a TCP connection to a KDC. -func dialKDCTCP(count int, kdcs map[int]string) (*net.TCPConn, error) { - i := 1 - for i <= count { - tcpAddr, err := net.ResolveTCPAddr("tcp", kdcs[i]) - if err != nil { - return nil, fmt.Errorf("error resolving KDC address: %v", err) - } - - conn, err := net.DialTimeout("tcp", tcpAddr.String(), 5*time.Second) - if err == nil { - if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { - return nil, err - } - // conn is guaranteed to be a TCPConn - return conn.(*net.TCPConn), nil - } - i++ - } - return nil, errors.New("error in getting a TCP connection to any of the KDCs") -} - // sendKDCUDP sends bytes to the KDC via UDP. func (cl *Client) sendKDCUDP(realm string, b []byte) ([]byte, error) { var r []byte - count, kdcs, err := cl.Config.GetKDCs(realm, false) - if err != nil { - return r, err - } - conn, err := dialKDCUDP(count, kdcs) + _, kdcs, err := cl.Config.GetKDCs(realm, false) if err != nil { return r, err } - r, err = cl.sendUDP(conn, b) + r, err = dialSendUDP(kdcs, b) if err != nil { return r, err } return checkForKRBError(r) } -// sendKDCTCP sends bytes to the KDC via TCP. -func (cl *Client) sendKDCTCP(realm string, b []byte) ([]byte, error) { - var r []byte - count, kdcs, err := cl.Config.GetKDCs(realm, true) - if err != nil { - return r, err - } - conn, err := dialKDCTCP(count, kdcs) - if err != nil { - return r, err - } - rb, err := cl.sendTCP(conn, b) - if err != nil { - return r, err +// dialSendUDP establishes a UDP connection to a KDC. +func dialSendUDP(kdcs map[int]string, b []byte) ([]byte, error) { + var errs []string + for i := 1; i <= len(kdcs); i++ { + udpAddr, err := net.ResolveUDPAddr("udp", kdcs[i]) + if err != nil { + errs = append(errs, fmt.Sprintf("error resolving KDC address: %v", err)) + continue + } + + conn, err := net.DialTimeout("udp", udpAddr.String(), 5*time.Second) + if err != nil { + errs = append(errs, fmt.Sprintf("error setting dial timeout on connection to %s: %v", kdcs[i], err)) + continue + } + if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { + errs = append(errs, fmt.Sprintf("error setting deadline on connection to %s: %v", kdcs[i], err)) + continue + } + // conn is guaranteed to be a UDPConn + rb, err := sendUDP(conn.(*net.UDPConn), b) + if err != nil { + errs = append(errs, fmt.Sprintf("error sneding to %s: %v", kdcs[i], err)) + continue + } + return rb, nil } - return checkForKRBError(rb) + return nil, fmt.Errorf("error sending to a KDC: %s", strings.Join(errs, "; ")) } // sendUDP sends bytes to connection over UDP. -func (cl *Client) sendUDP(conn *net.UDPConn, b []byte) ([]byte, error) { +func sendUDP(conn *net.UDPConn, b []byte) ([]byte, error) { var r []byte defer conn.Close() _, err := conn.Write(b) @@ -168,30 +132,60 @@ func (cl *Client) sendUDP(conn *net.UDPConn, b []byte) ([]byte, error) { return r, nil } -// sendTCP sends bytes to connection over TCP. -func (cl *Client) sendTCP(conn *net.TCPConn, b []byte) ([]byte, error) { - defer conn.Close() +// sendKDCTCP sends bytes to the KDC via TCP. +func (cl *Client) sendKDCTCP(realm string, b []byte) ([]byte, error) { var r []byte - /* - RFC https://tools.ietf.org/html/rfc4120#section-7.2.2 - Each request (KRB_KDC_REQ) and response (KRB_KDC_REP or KRB_ERROR) - sent over the TCP stream is preceded by the length of the request as - 4 octets in network byte order. The high bit of the length is - reserved for future expansion and MUST currently be set to zero. If - a KDC that does not understand how to interpret a set high bit of the - length encoding receives a request with the high order bit of the - length set, it MUST return a KRB-ERROR message with the error - KRB_ERR_FIELD_TOOLONG and MUST close the TCP stream. - NB: network byte order == big endian - */ - var buf bytes.Buffer - err := binary.Write(&buf, binary.BigEndian, uint32(len(b))) + _, kdcs, err := cl.Config.GetKDCs(realm, true) + if err != nil { + return r, err + } + r, err = dialSendTCP(kdcs, b) if err != nil { return r, err } - b = append(buf.Bytes(), b...) + return checkForKRBError(r) +} + +// dialKDCTCP establishes a TCP connection to a KDC. +func dialSendTCP(kdcs map[int]string, b []byte) ([]byte, error) { + var errs []string + for i := 1; i <= len(kdcs); i++ { + tcpAddr, err := net.ResolveTCPAddr("tcp", kdcs[i]) + if err != nil { + errs = append(errs, fmt.Sprintf("error resolving KDC address: %v", err)) + continue + } + + conn, err := net.DialTimeout("tcp", tcpAddr.String(), 5*time.Second) + if err != nil { + errs = append(errs, fmt.Sprintf("error setting dial timeout on connection to %s: %v", kdcs[i], err)) + continue + } + if err := conn.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { + errs = append(errs, fmt.Sprintf("error setting deadline on connection to %s: %v", kdcs[i], err)) + continue + } + // conn is guaranteed to be a TCPConn + rb, err := sendTCP(conn.(*net.TCPConn), b) + if err != nil { + errs = append(errs, fmt.Sprintf("error sneding to %s: %v", kdcs[i], err)) + continue + } + return rb, nil + } + return nil, errors.New("error in getting a TCP connection to any of the KDCs") +} - _, err = conn.Write(b) +// sendTCP sends bytes to connection over TCP. +func sendTCP(conn *net.TCPConn, b []byte) ([]byte, error) { + defer conn.Close() + var r []byte + // RFC 4120 7.2.2 specifies the first 4 bytes indicate the length of the message in big endian order. + hb := make([]byte, 4, 4) + binary.BigEndian.PutUint32(hb, uint32(len(b))) + b = append(hb, b...) + + _, err := conn.Write(b) if err != nil { return r, fmt.Errorf("error sending to KDC (%s): %v", conn.RemoteAddr().String(), err) } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/passwd.go b/vendor/github.com/jcmturner/gokrb5/v8/client/passwd.go similarity index 67% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/passwd.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/passwd.go index da838edcdbb..fe20559ca12 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/passwd.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/passwd.go @@ -2,10 +2,9 @@ package client import ( "fmt" - "net" - "gopkg.in/jcmturner/gokrb5.v7/kadmin" - "gopkg.in/jcmturner/gokrb5.v7/messages" + "github.com/jcmturner/gokrb5/v8/kadmin" + "github.com/jcmturner/gokrb5/v8/messages" ) // Kpasswd server response codes. @@ -55,41 +54,22 @@ func (cl *Client) sendToKPasswd(msg kadmin.Request) (r kadmin.Reply, err error) if err != nil { return } - addr := kps[1] b, err := msg.Marshal() if err != nil { return } + var rb []byte if len(b) <= cl.Config.LibDefaults.UDPPreferenceLimit { - return cl.sendKPasswdUDP(b, addr) + rb, err = dialSendUDP(kps, b) + if err != nil { + return + } + } else { + rb, err = dialSendTCP(kps, b) + if err != nil { + return + } } - return cl.sendKPasswdTCP(b, addr) -} - -func (cl *Client) sendKPasswdTCP(b []byte, kadmindAddr string) (r kadmin.Reply, err error) { - tcpAddr, err := net.ResolveTCPAddr("tcp", kadmindAddr) - if err != nil { - return - } - conn, err := net.DialTCP("tcp", nil, tcpAddr) - if err != nil { - return - } - rb, err := cl.sendTCP(conn, b) - err = r.Unmarshal(rb) - return -} - -func (cl *Client) sendKPasswdUDP(b []byte, kadmindAddr string) (r kadmin.Reply, err error) { - udpAddr, err := net.ResolveUDPAddr("udp", kadmindAddr) - if err != nil { - return - } - conn, err := net.DialUDP("udp", nil, udpAddr) - if err != nil { - return - } - rb, err := cl.sendUDP(conn, b) err = r.Unmarshal(rb) return } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/session.go b/vendor/github.com/jcmturner/gokrb5/v8/client/session.go similarity index 84% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/session.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/session.go index ec6c513d3bd..f7654d0d07e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/session.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/session.go @@ -1,15 +1,17 @@ package client import ( + "encoding/json" "fmt" + "sort" "strings" "sync" "time" - "gopkg.in/jcmturner/gokrb5.v7/iana/nametype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/iana/nametype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // sessions hold TGTs and are keyed on the realm name @@ -69,6 +71,15 @@ type session struct { mux sync.RWMutex } +// jsonSession is used to enable marshaling some information of a session in a JSON format +type jsonSession struct { + Realm string + AuthTime time.Time + EndTime time.Time + RenewTill time.Time + SessionKeyExpiration time.Time +} + // AddSession adds a session for a realm with a TGT to the client's session cache. // A goroutine is started to automatically renew the TGT before expiry. func (cl *Client) addSession(tgt messages.Ticket, dep messages.EncKDCRepPart) { @@ -140,6 +151,34 @@ func (s *session) timeDetails() (string, time.Time, time.Time, time.Time, time.T return s.realm, s.authTime, s.endTime, s.renewTill, s.sessionKeyExpiration } +// JSON return information about the held sessions in a JSON format. +func (s *sessions) JSON() (string, error) { + s.mux.RLock() + defer s.mux.RUnlock() + var js []jsonSession + keys := make([]string, 0, len(s.Entries)) + for k := range s.Entries { + keys = append(keys, k) + } + sort.Strings(keys) + for _, k := range keys { + r, at, et, rt, kt := s.Entries[k].timeDetails() + j := jsonSession{ + Realm: r, + AuthTime: at, + EndTime: et, + RenewTill: rt, + SessionKeyExpiration: kt, + } + js = append(js, j) + } + b, err := json.MarshalIndent(js, "", " ") + if err != nil { + return "", err + } + return string(b), nil +} + // enableAutoSessionRenewal turns on the automatic renewal for the client's TGT session. func (cl *Client) enableAutoSessionRenewal(s *session) { var timer *time.Timer @@ -239,6 +278,7 @@ func (cl *Client) sessionTGT(realm string) (tgt messages.Ticket, sessionKey type return } +// sessionTimes provides the timing information with regards to a session for the realm specified. func (cl *Client) sessionTimes(realm string) (authTime, endTime, renewTime, sessionExp time.Time, err error) { s, ok := cl.sessions.get(realm) if !ok { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/settings.go b/vendor/github.com/jcmturner/gokrb5/v8/client/settings.go similarity index 73% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/client/settings.go rename to vendor/github.com/jcmturner/gokrb5/v8/client/settings.go index 12c04c45262..bcd3945431e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/client/settings.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/client/settings.go @@ -1,6 +1,10 @@ package client -import "log" +import ( + "encoding/json" + "fmt" + "log" +) // Settings holds optional client settings. type Settings struct { @@ -10,6 +14,12 @@ type Settings struct { logger *log.Logger } +// jsonSettings is used when marshaling the Settings details to JSON format. +type jsonSettings struct { + DisablePAFXFast bool + AssumePreAuthentication bool +} + // NewSettings creates a new client settings struct. func NewSettings(settings ...func(*Settings)) *Settings { s := new(Settings) @@ -64,6 +74,20 @@ func (s *Settings) Logger() *log.Logger { // Log will write to the service's logger if it is configured. func (cl *Client) Log(format string, v ...interface{}) { if cl.settings.Logger() != nil { - cl.settings.Logger().Printf(format, v...) + cl.settings.Logger().Output(2, fmt.Sprintf(format, v...)) } } + +// JSON returns a JSON representation of the settings. +func (s *Settings) JSON() (string, error) { + js := jsonSettings{ + DisablePAFXFast: s.disablePAFXFast, + AssumePreAuthentication: s.assumePreAuthentication, + } + b, err := json.MarshalIndent(js, "", " ") + if err != nil { + return "", err + } + return string(b), nil + +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/error.go b/vendor/github.com/jcmturner/gokrb5/v8/config/error.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/config/error.go rename to vendor/github.com/jcmturner/gokrb5/v8/config/error.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/hosts.go b/vendor/github.com/jcmturner/gokrb5/v8/config/hosts.go similarity index 98% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/config/hosts.go rename to vendor/github.com/jcmturner/gokrb5/v8/config/hosts.go index a67989f9334..3f22c70c41c 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/hosts.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/config/hosts.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "gopkg.in/jcmturner/dnsutils.v1" + "github.com/jcmturner/dnsutils/v2" ) // GetKDCs returns the count of KDCs available and a map of KDC host names keyed on preference order. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go b/vendor/github.com/jcmturner/gokrb5/v8/config/krb5conf.go similarity index 96% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go rename to vendor/github.com/jcmturner/gokrb5/v8/config/krb5conf.go index 8efe92d8b45..a7638433d5f 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/config/krb5conf.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/config/krb5conf.go @@ -4,6 +4,7 @@ package config import ( "bufio" "encoding/hex" + "encoding/json" "errors" "fmt" "io" @@ -16,7 +17,7 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // Config represents the KRB5 configuration. @@ -32,8 +33,8 @@ type Config struct { // WeakETypeList is a list of encryption types that have been deemed weak. const WeakETypeList = "des-cbc-crc des-cbc-md4 des-cbc-md5 des-cbc-raw des3-cbc-raw des-hmac-sha1 arcfour-hmac-exp rc4-hmac-exp arcfour-hmac-md5-exp des" -// NewConfig creates a new config struct instance. -func NewConfig() *Config { +// New creates a new config struct instance. +func New() *Config { d := make(DomainRealm) return &Config{ LibDefaults: newLibDefaults(), @@ -301,9 +302,6 @@ func (l *LibDefaults) parseLines(lines []string) error { return InvalidErrorf("libdefaults section line (%s): %v", line, err) } l.VerifyAPReqNofail = v - default: - //Ignore the line - continue } } l.DefaultTGSEnctypeIDs = parseETypes(l.DefaultTGSEnctypes, l.AllowWeakCrypto) @@ -394,9 +392,6 @@ func (r *Realm) parseLines(name string, lines []string) (err error) { appendUntilFinal(&r.KPasswdServer, v, &kpasswdServerFinal) case "master_kdc": appendUntilFinal(&r.MasterKDC, v, &masterKDCFinal) - default: - //Ignore the line - continue } } //default for Kpasswd_server = admin_server:464 @@ -523,24 +518,24 @@ func Load(cfgPath string) (*Config, error) { } defer fh.Close() scanner := bufio.NewScanner(fh) - return NewConfigFromScanner(scanner) + return NewFromScanner(scanner) } -// NewConfigFromString creates a new Config struct from a string. -func NewConfigFromString(s string) (*Config, error) { +// NewFromString creates a new Config struct from a string. +func NewFromString(s string) (*Config, error) { reader := strings.NewReader(s) - return NewConfigFromReader(reader) + return NewFromReader(reader) } -// NewConfigFromReader creates a new Config struct from an io.Reader. -func NewConfigFromReader(r io.Reader) (*Config, error) { +// NewFromReader creates a new Config struct from an io.Reader. +func NewFromReader(r io.Reader) (*Config, error) { scanner := bufio.NewScanner(r) - return NewConfigFromScanner(scanner) + return NewFromScanner(scanner) } -// NewConfigFromScanner creates a new Config struct from a bufio.Scanner. -func NewConfigFromScanner(scanner *bufio.Scanner) (*Config, error) { - c := NewConfig() +// NewFromScanner creates a new Config struct from a bufio.Scanner. +func NewFromScanner(scanner *bufio.Scanner) (*Config, error) { + c := New() var e error sections := make(map[int]string) var sectionLineNum []int @@ -605,8 +600,6 @@ func NewConfigFromScanner(scanner *bufio.Scanner) (*Config, error) { } e = err } - default: - continue } } return c, e @@ -724,3 +717,12 @@ func appendUntilFinal(s *[]string, value string, final *bool) { } *s = append(*s, value) } + +// JSON return details of the config in a JSON format. +func (c *Config) JSON() (string, error) { + b, err := json.MarshalIndent(c, "", " ") + if err != nil { + return "", err + } + return string(b), nil +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/ccache.go b/vendor/github.com/jcmturner/gokrb5/v8/credentials/ccache.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/ccache.go rename to vendor/github.com/jcmturner/gokrb5/v8/credentials/ccache.go index 98ec29b9e07..c3b35c77a12 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/ccache.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/credentials/ccache.go @@ -10,22 +10,13 @@ import ( "unsafe" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/types" ) const ( headerFieldTagKDCOffset = 1 ) -// The first byte of the file always has the value 5. -// The value of the second byte contains the version number (1 through 4) -// Versions 1 and 2 of the file format use native byte order for integer representations. -// Versions 3 and 4 always use big-endian byte order -// After the two-byte version indicator, the file has three parts: -// 1) the header (in version 4 only) -// 2) the default principal name -// 3) a sequence of credentials - // CCache is the file credentials cache as define here: https://web.mit.edu/kerberos/krb5-latest/doc/formats/ccache_file_format.html type CCache struct { Version uint8 @@ -257,13 +248,7 @@ func (c *CCache) GetEntries() []*Credential { } func (h *headerField) valid() bool { - // At this time there is only one defined header field. - // Its tag value is 1, its length is always 8. - // Its contents are two 32-bit integers giving the seconds and microseconds - // of the time offset of the KDC relative to the client. - // Adding this offset to the current time on the client should give the current time on the KDC, if that offset has not changed since the initial authentication. - - // Done as a switch in case other tag values are added in the future. + // See https://web.mit.edu/kerberos/krb5-latest/doc/formats/ccache_file_format.html - Header format switch h.tag { case headerFieldTagKDCOffset: if h.length != 8 || len(h.value) != 8 { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/credentials.go b/vendor/github.com/jcmturner/gokrb5/v8/credentials/credentials.go similarity index 70% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/credentials.go rename to vendor/github.com/jcmturner/gokrb5/v8/credentials/credentials.go index beec0664720..bddbc7e3e3a 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/credentials/credentials.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/credentials/credentials.go @@ -2,12 +2,15 @@ package credentials import ( + "bytes" + "encoding/gob" + "encoding/json" "time" "github.com/hashicorp/go-uuid" - "gopkg.in/jcmturner/gokrb5.v7/iana/nametype" - "gopkg.in/jcmturner/gokrb5.v7/keytab" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/iana/nametype" + "github.com/jcmturner/gokrb5/v8/keytab" + "github.com/jcmturner/gokrb5/v8/types" ) const ( @@ -19,15 +22,14 @@ const ( // Contains either a keytab, password or both. // Keytabs are used over passwords if both are defined. type Credentials struct { - username string - displayName string - realm string - cname types.PrincipalName - keytab *keytab.Keytab - password string - attributes map[string]interface{} - validUntil time.Time - + username string + displayName string + realm string + cname types.PrincipalName + keytab *keytab.Keytab + password string + attributes map[string]interface{} + validUntil time.Time authenticated bool human bool authTime time.Time @@ -35,6 +37,24 @@ type Credentials struct { sessionID string } +// marshalCredentials is used to enable marshaling and unmarshaling of credentials +// without having exported fields on the Credentials struct +type marshalCredentials struct { + Username string + DisplayName string + Realm string + CName types.PrincipalName `json:"-"` + Keytab bool + Password bool + Attributes map[string]interface{} `json:"-"` + ValidUntil time.Time + Authenticated bool + Human bool + AuthTime time.Time + GroupMembership map[string]bool `json:"-"` + SessionID string +} + // ADCredentials contains information obtained from the PAC. type ADCredentials struct { EffectiveName string @@ -71,21 +91,9 @@ func New(username string, realm string) *Credentials { // NewFromPrincipalName creates a new Credentials instance with the user details provides as a PrincipalName type. func NewFromPrincipalName(cname types.PrincipalName, realm string) *Credentials { - uid, err := uuid.GenerateUUID() - if err != nil { - uid = "00unique-sess-ions-uuid-unavailable0" - } - return &Credentials{ - username: cname.PrincipalNameString(), - displayName: cname.PrincipalNameString(), - realm: realm, - cname: cname, - keytab: keytab.New(), - attributes: make(map[string]interface{}), - groupMembership: make(map[string]bool), - sessionID: uid, - human: true, - } + c := New(cname.PrincipalNameString(), realm) + c.cname = cname + return c } // WithKeytab sets the Keytab in the Credentials struct. @@ -147,6 +155,14 @@ func (c *Credentials) SetADCredentials(a ADCredentials) { } } +// GetADCredentials returns ADCredentials attributes sorted in the credential +func (c *Credentials) GetADCredentials() ADCredentials { + if a, ok := c.attributes[AttributeKeyADCredentials].(ADCredentials); ok { + return a + } + return ADCredentials{} +} + // Methods to implement goidentity.Identity interface // UserName returns the credential's username. @@ -312,3 +328,78 @@ func (c *Credentials) SetAttributes(a map[string]interface{}) { func (c *Credentials) RemoveAttribute(k string) { delete(c.attributes, k) } + +// Marshal the Credentials into a byte slice +func (c *Credentials) Marshal() ([]byte, error) { + gob.Register(map[string]interface{}{}) + gob.Register(ADCredentials{}) + buf := new(bytes.Buffer) + enc := gob.NewEncoder(buf) + mc := marshalCredentials{ + Username: c.username, + DisplayName: c.displayName, + Realm: c.realm, + CName: c.cname, + Keytab: c.HasKeytab(), + Password: c.HasPassword(), + Attributes: c.attributes, + ValidUntil: c.validUntil, + Authenticated: c.authenticated, + Human: c.human, + AuthTime: c.authTime, + GroupMembership: c.groupMembership, + SessionID: c.sessionID, + } + err := enc.Encode(&mc) + if err != nil { + return []byte{}, err + } + return buf.Bytes(), nil +} + +// Unmarshal a byte slice into Credentials +func (c *Credentials) Unmarshal(b []byte) error { + gob.Register(map[string]interface{}{}) + gob.Register(ADCredentials{}) + mc := new(marshalCredentials) + buf := bytes.NewBuffer(b) + dec := gob.NewDecoder(buf) + err := dec.Decode(mc) + if err != nil { + return err + } + c.username = mc.Username + c.displayName = mc.DisplayName + c.realm = mc.Realm + c.cname = mc.CName + c.attributes = mc.Attributes + c.validUntil = mc.ValidUntil + c.authenticated = mc.Authenticated + c.human = mc.Human + c.authTime = mc.AuthTime + c.groupMembership = mc.GroupMembership + c.sessionID = mc.SessionID + return nil +} + +// JSON return details of the Credentials in a JSON format. +func (c *Credentials) JSON() (string, error) { + mc := marshalCredentials{ + Username: c.username, + DisplayName: c.displayName, + Realm: c.realm, + CName: c.cname, + Keytab: c.HasKeytab(), + Password: c.HasPassword(), + ValidUntil: c.validUntil, + Authenticated: c.authenticated, + Human: c.human, + AuthTime: c.authTime, + SessionID: c.sessionID, + } + b, err := json.MarshalIndent(mc, "", " ") + if err != nil { + return "", err + } + return string(b), nil +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha1-96.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha1-96.go similarity index 55% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha1-96.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha1-96.go index 90b5df08071..dd8babd5df4 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha1-96.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha1-96.go @@ -6,58 +6,14 @@ import ( "crypto/sha1" "hash" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3961" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3962" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // RFC 3962 -//+--------------------------------------------------------------------+ -//| protocol key format 128- or 256-bit string | -//| | -//| string-to-key function PBKDF2+DK with variable | -//| iteration count (see | -//| above) | -//| | -//| default string-to-key parameters 00 00 10 00 | -//| | -//| key-generation seed length key size | -//| | -//| random-to-key function identity function | -//| | -//| hash function, H SHA-1 | -//| | -//| HMAC output size, h 12 octets (96 bits) | -//| | -//| message block size, m 1 octet | -//| | -//| encryption/decryption functions, AES in CBC-CTS mode | -//| E and D (cipher block size 16 | -//| octets), with next-to- | -//| last block (last block | -//| if only one) as CBC-style | -//| ivec | -//+--------------------------------------------------------------------+ -// -//+--------------------------------------------------------------------+ -//| encryption types | -//+--------------------------------------------------------------------+ -//| type name etype value key size | -//+--------------------------------------------------------------------+ -//| aes128-cts-hmac-sha1-96 17 128 | -//| aes256-cts-hmac-sha1-96 18 256 | -//+--------------------------------------------------------------------+ -// -//+--------------------------------------------------------------------+ -//| checksum types | -//+--------------------------------------------------------------------+ -//| type name sumtype value length | -//+--------------------------------------------------------------------+ -//| hmac-sha1-96-aes128 15 96 | -//| hmac-sha1-96-aes256 16 96 | -//+--------------------------------------------------------------------+ // Aes128CtsHmacSha96 implements Kerberos encryption type aes128-cts-hmac-sha1-96 type Aes128CtsHmacSha96 struct { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha256-128.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha256-128.go similarity index 89% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha256-128.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha256-128.go index 49a1b077405..b05af7d3d45 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes128-cts-hmac-sha256-128.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes128-cts-hmac-sha256-128.go @@ -6,10 +6,10 @@ import ( "crypto/sha256" "hash" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/rfc8009" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // RFC https://tools.ietf.org/html/rfc8009 @@ -110,11 +110,8 @@ func (e Aes128CtsHmacSha256128) DeriveRandom(protocolKey, usage []byte) ([]byte, } // VerifyIntegrity checks the integrity of the ciphertext message. -// The HMAC is calculated over the cipher state concatenated with the -// AES output, instead of being calculated over the confounder and -// plaintext. This allows the message receiver to verify the -// integrity of the message before decrypting the message. -// Therefore the pt value to this interface method is not use. Pass any []byte. +// As the hash is calculated over the iv concatenated with the AES cipher output not the plaintext the pt value to this +// interface method is not use. Pass any []byte. func (e Aes128CtsHmacSha256128) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool { // We don't need ib just there for the interface return rfc8009.VerifyIntegrity(protocolKey, ct, usage, e) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha1-96.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha1-96.go similarity index 55% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha1-96.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha1-96.go index 0cdbb7ec197..45e439a434e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha1-96.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha1-96.go @@ -6,58 +6,14 @@ import ( "crypto/sha1" "hash" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3961" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3962" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // RFC 3962 -//+--------------------------------------------------------------------+ -//| protocol key format 128- or 256-bit string | -//| | -//| string-to-key function PBKDF2+DK with variable | -//| iteration count (see | -//| above) | -//| | -//| default string-to-key parameters 00 00 10 00 | -//| | -//| key-generation seed length key size | -//| | -//| random-to-key function identity function | -//| | -//| hash function, H SHA-1 | -//| | -//| HMAC output size, h 12 octets (96 bits) | -//| | -//| message block size, m 1 octet | -//| | -//| encryption/decryption functions, AES in CBC-CTS mode | -//| E and D (cipher block size 16 | -//| octets), with next-to- | -//| last block (last block | -//| if only one) as CBC-style | -//| ivec | -//+--------------------------------------------------------------------+ -// -//+--------------------------------------------------------------------+ -//| encryption types | -//+--------------------------------------------------------------------+ -//| type name etype value key size | -//+--------------------------------------------------------------------+ -//| aes128-cts-hmac-sha1-96 17 128 | -//| aes256-cts-hmac-sha1-96 18 256 | -//+--------------------------------------------------------------------+ -// -//+--------------------------------------------------------------------+ -//| checksum types | -//+--------------------------------------------------------------------+ -//| type name sumtype value length | -//+--------------------------------------------------------------------+ -//| hmac-sha1-96-aes128 15 96 | -//| hmac-sha1-96-aes256 16 96 | -//+--------------------------------------------------------------------+ // Aes256CtsHmacSha96 implements Kerberos encryption type aes256-cts-hmac-sha1-96 type Aes256CtsHmacSha96 struct { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha384-192.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha384-192.go similarity index 89% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha384-192.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha384-192.go index 562b078654e..6a54475930e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/aes256-cts-hmac-sha384-192.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/aes256-cts-hmac-sha384-192.go @@ -6,10 +6,10 @@ import ( "crypto/sha512" "hash" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/rfc8009" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // RFC https://tools.ietf.org/html/rfc8009 @@ -110,11 +110,8 @@ func (e Aes256CtsHmacSha384192) DeriveRandom(protocolKey, usage []byte) ([]byte, } // VerifyIntegrity checks the integrity of the ciphertext message. -// The HMAC is calculated over the cipher state concatenated with the -// AES output, instead of being calculated over the confounder and -// plaintext. This allows the message receiver to verify the -// integrity of the message before decrypting the message. -// Therefore the pt value to this interface method is not use. Pass any []byte. +// As the hash is calculated over the iv concatenated with the AES cipher output not the plaintext the pt value to this +// interface method is not use. Pass any []byte. func (e Aes256CtsHmacSha384192) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool { // We don't need ib just there for the interface return rfc8009.VerifyIntegrity(protocolKey, ct, usage, e) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/common/common.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/common/common.go similarity index 77% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/common/common.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/common/common.go index 96ae5499348..dab55be7583 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/common/common.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/common/common.go @@ -9,7 +9,7 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) // ZeroPad pads bytes with zeros to nearest multiple of message size m. @@ -92,39 +92,28 @@ func GetIntegrityHash(b, key []byte, usage uint32, etype etype.EType) ([]byte, e // VerifyChecksum compares the checksum of the msg bytes is the same as the checksum provided. func VerifyChecksum(key, chksum, msg []byte, usage uint32, etype etype.EType) bool { - //The ciphertext output is the concatenation of the output of the basic - //encryption function E and a (possibly truncated) HMAC using the - //specified hash function H, both applied to the plaintext with a - //random confounder prefix and sufficient padding to bring it to a - //multiple of the message block size. When the HMAC is computed, the - //key is used in the protocol key form. + //The encrypted message is a concatenation of the encrypted output and the hash HMAC. expectedMAC, _ := GetChecksumHash(msg, key, usage, etype) return hmac.Equal(chksum, expectedMAC) } // GetUsageKc returns the checksum key usage value for the usage number un. // -// RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below. -// -// Kc = DK(base-key, usage | 0x99); +// See RFC 3961 5.3 key-derivation function definition. func GetUsageKc(un uint32) []byte { return getUsage(un, 0x99) } // GetUsageKe returns the encryption key usage value for the usage number un // -// RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below. -// -// Ke = DK(base-key, usage | 0xAA); +// See RFC 3961 5.3 key-derivation function definition. func GetUsageKe(un uint32) []byte { return getUsage(un, 0xAA) } // GetUsageKi returns the integrity key usage value for the usage number un // -// RFC 3961: The "well-known constant" used for the DK function is the key usage number, expressed as four octets in big-endian order, followed by one octet indicated below. -// -// Ki = DK(base-key, usage | 0x55); +// See RFC 3961 5.3 key-derivation function definition. func GetUsageKi(un uint32) []byte { return getUsage(un, 0x55) } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/crypto.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/crypto.go similarity index 95% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/crypto.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/crypto.go index e04e9681c2a..5c96ddfdf6f 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/crypto.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/crypto.go @@ -5,11 +5,11 @@ import ( "encoding/hex" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" - "gopkg.in/jcmturner/gokrb5.v7/iana/patype" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto/etype" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/iana/patype" + "github.com/jcmturner/gokrb5/v8/types" ) // GetEtype returns an instances of the required etype struct for the etype ID. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/des3-cbc-sha1-kd.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/des3-cbc-sha1-kd.go similarity index 76% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/des3-cbc-sha1-kd.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/des3-cbc-sha1-kd.go index db3a149ad79..6e650eb6c19 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/des3-cbc-sha1-kd.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/des3-cbc-sha1-kd.go @@ -7,49 +7,14 @@ import ( "errors" "hash" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3961" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) //RFC: 3961 Section 6.3 -/* - des3-cbc-hmac-sha1-kd, hmac-sha1-des3-kd - ------------------------------------------------ - protocol key format 24 bytes, parity in low - bit of each - - key-generation seed 21 bytes - length - - hash function SHA-1 - - HMAC output size 160 bits - - message block size 8 bytes - - default string-to-key empty string - params - - encryption and triple-DES encrypt and - decryption functions decrypt, in outer-CBC - mode (cipher block size - 8 octets) - - key generation functions: - - random-to-key DES3random-to-key (see - below) - - string-to-key DES3string-to-key (see - below) - - The des3-cbc-hmac-sha1-kd encryption type is assigned the value - sixteen (16). The hmac-sha1-des3-kd checksum algorithm is assigned a - checksum type number of twelve (12)*/ - // Des3CbcSha1Kd implements Kerberos encryption type des3-cbc-hmac-sha1-kd type Des3CbcSha1Kd struct { } diff --git a/vendor/github.com/jcmturner/gokrb5/v8/crypto/etype/etype.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/etype/etype.go new file mode 100644 index 00000000000..ab1496d3f67 --- /dev/null +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/etype/etype.go @@ -0,0 +1,29 @@ +// Package etype provides the Kerberos Encryption Type interface +package etype + +import "hash" + +// EType is the interface defining the Encryption Type. +type EType interface { + GetETypeID() int32 + GetHashID() int32 + GetKeyByteSize() int + GetKeySeedBitLength() int + GetDefaultStringToKeyParams() string + StringToKey(string, salt, s2kparams string) ([]byte, error) + RandomToKey(b []byte) []byte + GetHMACBitLength() int + GetMessageBlockByteSize() int + EncryptData(key, data []byte) ([]byte, []byte, error) + EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error) + DecryptData(key, data []byte) ([]byte, error) + DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error) + GetCypherBlockBitLength() int + GetConfounderByteSize() int + DeriveKey(protocolKey, usage []byte) ([]byte, error) + DeriveRandom(protocolKey, usage []byte) ([]byte, error) + VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool + GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error) + VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool + GetHashFunc() func() hash.Hash +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rc4-hmac.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rc4-hmac.go similarity index 88% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rc4-hmac.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rc4-hmac.go index 9df55eed4a2..42f84b850b9 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rc4-hmac.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rc4-hmac.go @@ -7,16 +7,14 @@ import ( "hash" "io" + "github.com/jcmturner/gokrb5/v8/crypto/rfc3961" + "github.com/jcmturner/gokrb5/v8/crypto/rfc4757" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" "golang.org/x/crypto/md4" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961" - "gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" ) -//http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/sun/security/krb5/internal/crypto/dk/ArcFourCrypto.java#ArcFourCrypto.encrypt%28byte%5B%5D%2Cint%2Cbyte%5B%5D%2Cbyte%5B%5D%2Cbyte%5B%5D%2Cint%2Cint%29 - -// RC4HMAC implements Kerberos encryption type aes256-cts-hmac-sha1-96 +// RC4HMAC implements Kerberos encryption type rc4-hmac type RC4HMAC struct { } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/encryption.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/encryption.go similarity index 89% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/encryption.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/encryption.go index 6f550fa8605..1383258c7f1 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/encryption.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/encryption.go @@ -9,8 +9,8 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) // DES3EncryptData encrypts the data provided using DES3 and methods specific to the etype provided. @@ -112,12 +112,6 @@ func DES3DecryptMessage(key, ciphertext []byte, usage uint32, e etype.EType) ([] // VerifyIntegrity verifies the integrity of cipertext bytes ct. func VerifyIntegrity(key, ct, pt []byte, usage uint32, etype etype.EType) bool { - //The ciphertext output is the concatenation of the output of the basic - //encryption function E and a (possibly truncated) HMAC using the - //specified hash function H, both applied to the plaintext with a - //random confounder prefix and sufficient padding to bring it to a - //multiple of the message block size. When the HMAC is computed, the - //key is used in the protocol key form. h := make([]byte, etype.GetHMACBitLength()/8) copy(h, ct[len(ct)-etype.GetHMACBitLength()/8:]) expectedMAC, _ := common.GetIntegrityHash(pt, key, usage, etype) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/keyDerivation.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/keyDerivation.go similarity index 91% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/keyDerivation.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/keyDerivation.go index 8c637a22d99..ed9b169c5d9 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/keyDerivation.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/keyDerivation.go @@ -3,7 +3,7 @@ package rfc3961 import ( "bytes" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) const ( @@ -28,16 +28,7 @@ func DeriveRandom(key, usage []byte, e etype.EType) ([]byte, error) { nFoldUsage := Nfold(usage, n) //k-truncate implemented by creating a byte array the size of k (k is in bits hence /8) out := make([]byte, k/8) - - /*If the output of E is shorter than k bits, it is fed back into the encryption as many times as necessary. - The construct is as follows (where | indicates concatenation): - - K1 = E(Key, n-fold(Constant), initial-cipher-state) - K2 = E(Key, K1, initial-cipher-state) - K3 = E(Key, K2, initial-cipher-state) - K4 = ... - - DR(Key, Constant) = k-truncate(K1 | K2 | K3 | K4 ...)*/ + // Keep feeding the output back into the encryption function until it is no longer short than k. _, K, err := e.EncryptData(key, nFoldUsage) if err != nil { return out, err diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/nfold.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/nfold.go similarity index 72% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/nfold.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/nfold.go index 779d1c6ef66..9536b1e3e35 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961/nfold.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3961/nfold.go @@ -1,27 +1,6 @@ package rfc3961 -/* -Implementation of the n-fold algorithm as defined in RFC 3961. - -n-fold is an algorithm that takes m input bits and "stretches" them -to form n output bits with equal contribution from each input bit to -the output, as described in [Blumenthal96]: - -We first define a primitive called n-folding, which takes a -variable-length input block and produces a fixed-length output -sequence. The intent is to give each input bit approximately -equal weight in determining the value of each output bit. Note -that whenever we need to treat a string of octets as a number, the -assumed representation is Big-Endian -- Most Significant Byte -first. - -To n-fold a number X, replicate the input value to a length that -is the least common multiple of n and the length of X. Before -each repetition, the input is rotated to the right by 13 bit -positions. The successive n-bit chunks are added together using -1's-complement addition (that is, with end-around carry) to yield -a n-bit result.... -*/ +// Implementation of the n-fold algorithm as defined in RFC 3961. /* Credits This golang implementation of nfold used the following project for help with implementation detail. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/encryption.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/encryption.go similarity index 95% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/encryption.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/encryption.go index 2be2fde0710..5ff89e85b03 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/encryption.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/encryption.go @@ -6,9 +6,9 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/aescts.v1" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/aescts/v2" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) // EncryptData encrypts the data provided using methods specific to the etype provided as defined in RFC 3962. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/keyDerivation.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/keyDerivation.go similarity index 75% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/keyDerivation.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/keyDerivation.go index a5f45c1c5fe..fb402d97b75 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962/keyDerivation.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc3962/keyDerivation.go @@ -6,7 +6,7 @@ import ( "errors" "github.com/jcmturner/gofork/x/crypto/pbkdf2" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) const ( @@ -35,11 +35,9 @@ func StringToKeyIter(secret, salt string, iterations int64, e etype.EType) ([]by // S2KparamsToItertions converts the string representation of iterations to an integer func S2KparamsToItertions(s2kparams string) (int64, error) { - //process s2kparams string - //The parameter string is four octets indicating an unsigned - //number in big-endian order. This is the number of iterations to be - //performed. If the value is 00 00 00 00, the number of iterations to - //be performed is 4,294,967,296 (2**32). + //The s2kparams string should be hex string representing 4 bytes + //The 4 bytes represent a number in big endian order + //If the value is zero then the number of iterations should be 4,294,967,296 (2^32) var i uint32 if len(s2kparams) != 8 { return int64(s2kParamsZero), errors.New("invalid s2kparams length") @@ -49,10 +47,5 @@ func S2KparamsToItertions(s2kparams string) (int64, error) { return int64(s2kParamsZero), errors.New("invalid s2kparams, cannot decode string to bytes") } i = binary.BigEndian.Uint32(b) - //buf := bytes.NewBuffer(b) - //err = binary.Read(buf, binary.BigEndian, &i) - if err != nil { - return int64(s2kParamsZero), errors.New("invalid s2kparams, cannot convert to big endian int32") - } return int64(i), nil } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/checksum.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/checksum.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/checksum.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/checksum.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/encryption.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/encryption.go similarity index 98% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/encryption.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/encryption.go index 0ec8b99211c..fdebe736685 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/encryption.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/encryption.go @@ -8,7 +8,7 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) // EncryptData encrypts the data provided using methods specific to the etype provided as defined in RFC 4757. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/keyDerivation.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/keyDerivation.go similarity index 72% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/keyDerivation.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/keyDerivation.go index 5e7ec4800bf..d1f90c077d8 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/keyDerivation.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/keyDerivation.go @@ -33,21 +33,6 @@ func StringToKey(secret string) ([]byte, error) { } func deriveKeys(key, checksum []byte, usage uint32, export bool) (k1, k2, k3 []byte) { - //if export { - // L40 := make([]byte, 14, 14) - // copy(L40, []byte(`fortybits`)) - // k1 = HMAC(key, L40) - //} else { - // tb := MessageTypeBytes(usage) - // k1 = HMAC(key, tb) - //} - //k2 = k1[:16] - //if export { - // mask := []byte{0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB,0xAB} - // copy(k1[7:16], mask) - //} - //k3 = HMAC(k1, checksum) - //return k1 = key k2 = HMAC(k1, UsageToMSMsgType(usage)) k3 = HMAC(k2, checksum) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/msgtype.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/msgtype.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757/msgtype.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/msgtype.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/encryption.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/encryption.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/encryption.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/encryption.go index 86aae098896..54cff7b4629 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/encryption.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/encryption.go @@ -8,10 +8,10 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/aescts.v1" - "gopkg.in/jcmturner/gokrb5.v7/crypto/common" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" + "github.com/jcmturner/aescts/v2" + "github.com/jcmturner/gokrb5/v8/crypto/common" + "github.com/jcmturner/gokrb5/v8/crypto/etype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" ) // EncryptData encrypts the data provided using methods specific to the etype provided as defined in RFC 8009. @@ -108,11 +108,8 @@ func DecryptMessage(key, ciphertext []byte, usage uint32, e etype.EType) ([]byte // GetIntegityHash returns a keyed integrity hash of the bytes provided as defined in RFC 8009 func GetIntegityHash(iv, c, key []byte, usage uint32, e etype.EType) ([]byte, error) { // Generate and append integrity hash - // The HMAC is calculated over the cipher state concatenated with the - // AES output, instead of being calculated over the confounder and - // plaintext. This allows the message receiver to verify the - // integrity of the message before decrypting the message. - // H = HMAC(Ki, IV | C) + // Rather than calculating the hash over the confounder and plaintext + // it is calculated over the iv concatenated with the AES cipher output. ib := append(iv, c...) return common.GetIntegrityHash(ib, key, usage, e) } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/keyDerivation.go b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/keyDerivation.go similarity index 88% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/keyDerivation.go rename to vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/keyDerivation.go index 90ced3b58c9..e94732226c6 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009/keyDerivation.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc8009/keyDerivation.go @@ -6,9 +6,9 @@ import ( "encoding/hex" "errors" + "github.com/jcmturner/gokrb5/v8/crypto/etype" + "github.com/jcmturner/gokrb5/v8/iana/etypeID" "golang.org/x/crypto/pbkdf2" - "gopkg.in/jcmturner/gokrb5.v7/crypto/etype" - "gopkg.in/jcmturner/gokrb5.v7/iana/etypeID" ) const ( @@ -24,21 +24,12 @@ func DeriveRandom(protocolKey, usage []byte, e etype.EType) ([]byte, error) { // DeriveKey derives a key from the protocol key based on the usage and the etype's specific methods. // // https://tools.ietf.org/html/rfc8009#section-5 -// -// If the enctype is aes128-cts-hmac-sha256-128: -// Kc = KDF-HMAC-SHA2(base-key, usage | 0x99, 128) -// Ke = KDF-HMAC-SHA2(base-key, usage | 0xAA, 128) -// Ki = KDF-HMAC-SHA2(base-key, usage | 0x55, 128) -// -// If the enctype is aes256-cts-hmac-sha384-192: -// Kc = KDF-HMAC-SHA2(base-key, usage | 0x99, 192) -// Ke = KDF-HMAC-SHA2(base-key, usage | 0xAA, 256) -// Ki = KDF-HMAC-SHA2(base-key, usage | 0x55, 192) func DeriveKey(protocolKey, label []byte, e etype.EType) []byte { var context []byte var kl int // Key length is longer for aes256-cts-hmac-sha384-192 is it is a Ke or from StringToKey (where label is "kerberos") if e.GetETypeID() == etypeID.AES256_CTS_HMAC_SHA384_192 { + Swtch: switch label[len(label)-1] { case 0x73: // 0x73 is "s" so label could be kerberos meaning StringToKey so now check if the label is "kerberos" @@ -49,7 +40,7 @@ func DeriveKey(protocolKey, label []byte, e etype.EType) []byte { for i, b := range label { if b != kerblabel[i] { kl = e.GetKeySeedBitLength() - break + break Swtch } } if kl == 0 { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/MICToken.go b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/MICToken.go similarity index 79% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/MICToken.go rename to vendor/github.com/jcmturner/gokrb5/v8/gssapi/MICToken.go index 856412baf78..ab8daa2897b 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/MICToken.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/MICToken.go @@ -8,37 +8,12 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/types" ) -/* -From RFC 4121, section 4.2.6.1: - - Use of the GSS_GetMIC() call yields a token (referred as the MIC - token in this document), separate from the user data being protected, - which can be used to verify the integrity of that data as received. - The token has the following format: - - Octet no Name Description - -------------------------------------------------------------- - 0..1 TOK_ID Identification field. Tokens emitted by - GSS_GetMIC() contain the hex value 04 04 - expressed in big-endian order in this - field. - 2 Flags Attributes field, as described in section - 4.2.2. - 3..7 Filler Contains five octets of hex value FF. - 8..15 SND_SEQ Sequence number field in clear text, - expressed in big-endian order. - 16..last SGN_CKSUM Checksum of the "to-be-signed" data and - octet 0..15, as described in section 4.2.4. - - The Filler field is included in the checksum calculation for - simplicity. - -*/ +// RFC 4121, section 4.2.6.1 const ( // MICTokenFlagSentByAcceptor - this flag indicates the sender is the context acceptor. When not set, it indicates the sender is the context initiator @@ -106,9 +81,6 @@ func (mt *MICToken) SetChecksum(key types.EncryptionKey, keyUsage uint32) error } // Compute and return the checksum of this token, computed using the passed key and key usage. -// Confirms to RFC 4121 in that the checksum will be computed over { body | header }. -// In the context of Kerberos MIC tokens, mostly keyusage GSSAPI_ACCEPTOR_SIGN (=23) -// and GSSAPI_INITIATOR_SIGN (=25) will be used. // Note: This will NOT update the struct's Checksum field. func (mt *MICToken) checksum(key types.EncryptionKey, keyUsage uint32) ([]byte, error) { if mt.Payload == nil { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/README.md b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/README.md similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/README.md rename to vendor/github.com/jcmturner/gokrb5/v8/gssapi/README.md diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/contextFlags.go b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/contextFlags.go similarity index 81% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/contextFlags.go rename to vendor/github.com/jcmturner/gokrb5/v8/gssapi/contextFlags.go index 6634c6d7826..8c91859b89f 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/contextFlags.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/contextFlags.go @@ -14,9 +14,11 @@ const ( ) // ContextFlags flags for GSSAPI +// DEPRECATED - do not use type ContextFlags asn1.BitString -// NewContextFlags creates a new ContextFlags instance. +// NewContextFlags creates a new ContextFlags instance +// DEPRECATED - do not use func NewContextFlags() ContextFlags { var c ContextFlags c.BitLength = 32 diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/gssapi.go b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/gssapi.go similarity index 95% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/gssapi.go rename to vendor/github.com/jcmturner/gokrb5/v8/gssapi/gssapi.go index 47754d738a4..80822319022 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/gssapi.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/gssapi.go @@ -14,6 +14,7 @@ const ( OIDKRB5 OIDName = "KRB5" // MechType OID for Kerberos 5 OIDMSLegacyKRB5 OIDName = "MSLegacyKRB5" // MechType OID for Kerberos 5 OIDSPNEGO OIDName = "SPNEGO" + OIDGSSIAKerb OIDName = "GSSIAKerb" // Indicates the client cannot get a service ticket and asks the server to serve as an intermediate to the target KDC. http://k5wiki.kerberos.org/wiki/Projects/IAKERB#IAKERB_mech ) // GSS-API status values @@ -117,7 +118,7 @@ type Mechanism interface { type OIDName string // OID returns the OID for the provided OID name. -func OID(o OIDName) asn1.ObjectIdentifier { +func (o OIDName) OID() asn1.ObjectIdentifier { switch o { case OIDSPNEGO: return asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 2} @@ -125,6 +126,8 @@ func OID(o OIDName) asn1.ObjectIdentifier { return asn1.ObjectIdentifier{1, 2, 840, 113554, 1, 2, 2} case OIDMSLegacyKRB5: return asn1.ObjectIdentifier{1, 2, 840, 48018, 1, 2, 2} + case OIDGSSIAKerb: + return asn1.ObjectIdentifier{1, 3, 6, 1, 5, 2, 5} } return asn1.ObjectIdentifier{} } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/wrapToken.go b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/wrapToken.go similarity index 71% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/wrapToken.go rename to vendor/github.com/jcmturner/gokrb5/v8/gssapi/wrapToken.go index 9dbf96baa8e..ea7d0543e09 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/gssapi/wrapToken.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/gssapi/wrapToken.go @@ -8,53 +8,17 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/types" ) -/* -From RFC 4121, section 4.2.6.2: - - Use of the GSS_Wrap() call yields a token (referred as the Wrap token - in this document), which consists of a descriptive header, followed - by a body portion that contains either the input user data in - plaintext concatenated with the checksum, or the input user data - encrypted. The GSS_Wrap() token SHALL have the following format: - - Octet no Name Description - -------------------------------------------------------------- - 0..1 TOK_ID Identification field. Tokens emitted by - GSS_Wrap() contain the hex value 05 04 - expressed in big-endian order in this - field. - 2 Flags Attributes field, as described in section - 4.2.2. - 3 Filler Contains the hex value FF. - 4..5 EC Contains the "extra count" field, in big- - endian order as described in section 4.2.3. - 6..7 RRC Contains the "right rotation count" in big- - endian order, as described in section - 4.2.5. - 8..15 SndSeqNum Sequence number field in clear text, - expressed in big-endian order. - 16..last Data Encrypted data for Wrap tokens with - confidentiality, or plaintext data followed - by the checksum for Wrap tokens without - confidentiality, as described in section - 4.2.4. - -Quick notes: - - "EC" or "Extra Count" refers to the length of the checksum. - - "Flags" (complete details in section 4.2.2) is a set of bits: - - if bit 0 is set, it means the token was sent by the acceptor (generally the kerberized service). - - bit 1 indicates that the token's payload is encrypted - - bit 2 indicates if the message is protected using a subkey defined by the acceptor. - - When computing checksums, EC and RRC MUST be set to 0. - - Wrap Tokens are not ASN.1 encoded. -*/ +// RFC 4121, section 4.2.6.2 + const ( - HdrLen = 16 // Length of the Wrap Token's header + // HdrLen is the length of the Wrap Token's header + HdrLen = 16 + // FillerByte is a filler in the WrapToken structure FillerByte byte = 0xFF ) @@ -121,10 +85,6 @@ func (wt *WrapToken) SetCheckSum(key types.EncryptionKey, keyUsage uint32) error } // ComputeCheckSum computes and returns the checksum of this token, computed using the passed key and key usage. -// Conforms to RFC 4121 in that the checksum will be computed over { body | header }, -// with the EC and RRC flags zeroed out. -// In the context of Kerberos Wrap tokens, mostly keyusage GSSAPI_ACCEPTOR_SEAL (=22) -// and GSSAPI_INITIATOR_SEAL (=24) will be used. // Note: This will NOT update the struct's Checksum field. func (wt *WrapToken) computeCheckSum(key types.EncryptionKey, keyUsage uint32) ([]byte, error) { if wt.Payload == nil { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/addrtype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/addrtype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/addrtype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/addrtype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/adtype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/adtype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/adtype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/adtype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/asnAppTag/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/asnAppTag/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/chksumtype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/chksumtype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/errorcode/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/errorcode/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/errorcode/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/errorcode/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/etypeID/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/etypeID/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/etypeID/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/etypeID/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/flags/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/flags/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/flags/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/flags/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/keyusage/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/keyusage/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/keyusage/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/keyusage/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/msgtype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/msgtype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/msgtype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/msgtype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/nametype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/nametype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/nametype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/nametype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/iana/patype/constants.go b/vendor/github.com/jcmturner/gokrb5/v8/iana/patype/constants.go similarity index 100% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/iana/patype/constants.go rename to vendor/github.com/jcmturner/gokrb5/v8/iana/patype/constants.go diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/changepasswddata.go b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/changepasswddata.go similarity index 93% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/changepasswddata.go rename to vendor/github.com/jcmturner/gokrb5/v8/kadmin/changepasswddata.go index a3e2efdd9cc..2d68eda1924 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/changepasswddata.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/changepasswddata.go @@ -2,7 +2,7 @@ package kadmin import ( "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/types" ) // ChangePasswdData is the payload to a password change message. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/message.go b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/message.go similarity index 96% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/message.go rename to vendor/github.com/jcmturner/gokrb5/v8/kadmin/message.go index 157fcad4c68..d1864c998be 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/message.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/message.go @@ -7,8 +7,8 @@ import ( "fmt" "math" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) const ( diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/passwd.go b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/passwd.go similarity index 91% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/passwd.go rename to vendor/github.com/jcmturner/gokrb5/v8/kadmin/passwd.go index 2a7491aa755..db199bffcb2 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/kadmin/passwd.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/kadmin/passwd.go @@ -2,10 +2,10 @@ package kadmin import ( - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/messages" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/messages" + "github.com/jcmturner/gokrb5/v8/types" ) // ChangePasswdMsg generate a change password request and also return the key needed to decrypt the reply. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/keytab/keytab.go b/vendor/github.com/jcmturner/gokrb5/v8/keytab/keytab.go similarity index 79% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/keytab/keytab.go rename to vendor/github.com/jcmturner/gokrb5/v8/keytab/keytab.go index 22c02044b31..5c2e9d79a1b 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/keytab/keytab.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/keytab/keytab.go @@ -4,14 +4,17 @@ package keytab import ( "bytes" "encoding/binary" + "encoding/json" "errors" "fmt" "io" "io/ioutil" + "strings" "time" "unsafe" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/types" ) const ( @@ -33,28 +36,43 @@ type entry struct { KVNO uint32 } +func (e entry) String() string { + return fmt.Sprintf("% 4d %s %-56s %2d %-64x", + e.KVNO8, + e.Timestamp.Format("02/01/06 15:04:05"), + e.Principal.String(), + e.Key.KeyType, + e.Key.KeyValue, + ) +} + // Keytab entry principal struct. type principal struct { - NumComponents int16 + NumComponents int16 `json:"-"` Realm string Components []string NameType int32 } +func (p principal) String() string { + return fmt.Sprintf("%s@%s", strings.Join(p.Components, "/"), p.Realm) +} + // New creates new, empty Keytab type. func New() *Keytab { var e []entry return &Keytab{ - version: 0, + version: 2, Entries: e, } } // GetEncryptionKey returns the EncryptionKey from the Keytab for the newest entry with the required kvno, etype and matching principal. -func (kt *Keytab) GetEncryptionKey(princName types.PrincipalName, realm string, kvno int, etype int32) (types.EncryptionKey, error) { - //TODO (theme: KVNO from keytab) this function should return the kvno too +// If the kvno is zero then the latest kvno will be returned. The kvno is also returned for +func (kt *Keytab) GetEncryptionKey(princName types.PrincipalName, realm string, kvno int, etype int32) (types.EncryptionKey, int, error) { var key types.EncryptionKey var t time.Time + var kv int for _, k := range kt.Entries { if k.Principal.Realm == realm && len(k.Principal.Components) == len(princName.NameString) && k.Key.KeyType == etype && @@ -69,18 +87,19 @@ func (kt *Keytab) GetEncryptionKey(princName types.PrincipalName, realm string, } if p { key = k.Key + kv = int(k.KVNO) t = k.Timestamp } } } if len(key.KeyValue) < 1 { - return key, fmt.Errorf("matching key not found in keytab. Looking for %v realm: %v kvno: %v etype: %v", princName.NameString, realm, kvno, etype) + return key, 0, fmt.Errorf("matching key not found in keytab. Looking for %v realm: %v kvno: %v etype: %v", princName.NameString, realm, kvno, etype) } - return key, nil + return key, kv, nil } // Create a new Keytab entry. -func newKeytabEntry() entry { +func newEntry() entry { var b []byte return entry{ Principal: newPrincipal(), @@ -94,6 +113,49 @@ func newKeytabEntry() entry { } } +func (kt Keytab) String() string { + var s string + s = `KVNO Timestamp Principal ET Key +---- ----------------- -------------------------------------------------------- -- ---------------------------------------------------------------- +` + for _, entry := range kt.Entries { + s += entry.String() + "\n" + } + return s +} + +// AddEntry adds an entry to the keytab. The password should be provided in plain text and it will be converted using the defined enctype to be stored. +func (kt *Keytab) AddEntry(principalName, realm, password string, ts time.Time, KVNO uint8, encType int32) error { + // Generate a key from the password + princ, _ := types.ParseSPNString(principalName) + key, _, err := crypto.GetKeyFromPassword(password, princ, realm, encType, types.PADataSequence{}) + if err != nil { + return err + } + + // Populate the keytab entry principal + ktep := newPrincipal() + ktep.NumComponents = int16(len(princ.NameString)) + if kt.version == 1 { + ktep.NumComponents += 1 + } + + ktep.Realm = realm + ktep.Components = princ.NameString + ktep.NameType = princ.NameType + + // Populate the keytab entry + e := newEntry() + e.Principal = ktep + e.Timestamp = ts + e.KVNO8 = KVNO + e.KVNO = uint32(KVNO) + e.Key = key + + kt.Entries = append(kt.Entries, e) + return nil +} + // Create a new principal. func newPrincipal() principal { var c []string @@ -161,12 +223,6 @@ func (kt *Keytab) Unmarshal(b []byte) error { if kt.version == 1 && isNativeEndianLittle() { endian = binary.LittleEndian } - /* - After the two-byte version indicator, the file contains a sequence of signed 32-bit record lengths followed by key records or holes. - A positive record length indicates a valid key entry whose size is equal to or less than the record length. - A negative length indicates a zero-filled hole whose size is the inverse of the length. - A length of 0 indicates the end of the file. - */ // n tracks position in the byte array n := 2 l, err := readInt32(b, &n, &endian) @@ -179,7 +235,6 @@ func (kt *Keytab) Unmarshal(b []byte) error { l = l * -1 n = n + int(l) } else { - //fmt.Printf("Bytes for entry: %v\n", b[n:n+int(l)]) if n < 0 { return fmt.Errorf("%d can't be less than zero", n) } @@ -188,7 +243,7 @@ func (kt *Keytab) Unmarshal(b []byte) error { } eb := b[n : n+int(l)] n = n + int(l) - ke := newKeytabEntry() + ke := newEntry() // p keeps track as to where we are in the byte stream var p int var err error @@ -216,9 +271,9 @@ func (kt *Keytab) Unmarshal(b []byte) error { if err != nil { return err } - //The 32-bit key version overrides the 8-bit key version. - // To determine if it is present, the implementation must check that at least 4 bytes remain in the record after the other fields are read, - // and that the value of the 32-bit integer contained in those bytes is non-zero. + // The 32-bit key version overrides the 8-bit key version. + // If at least 4 bytes are left after the other fields are read and they are non-zero + // this indicates the 32-bit version is present. if len(eb)-p >= 4 { // The 32-bit key may be present ri32, err := readInt32(eb, &p, &endian) @@ -464,3 +519,12 @@ func isNativeEndianLittle() bool { } return endian } + +// JSON return information about the keys held in the keytab in a JSON format. +func (kt *Keytab) JSON() (string, error) { + b, err := json.MarshalIndent(kt, "", " ") + if err != nil { + return "", err + } + return string(b), nil +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/krberror/error.go b/vendor/github.com/jcmturner/gokrb5/v8/krberror/error.go similarity index 94% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/krberror/error.go rename to vendor/github.com/jcmturner/gokrb5/v8/krberror/error.go index d591bdeb37c..01c6d9904c5 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/krberror/error.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/krberror/error.go @@ -35,8 +35,8 @@ func (e *Krberror) Add(et string, s string) { e.EText = append([]string{fmt.Sprintf("%s: %s", et, s)}, e.EText...) } -// NewKrberror creates a new instance of Krberror. -func NewKrberror(et, s string) Krberror { +// New creates a new instance of Krberror. +func New(et, s string) Krberror { return Krberror{ RootCause: et, EText: []string{s}, diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APRep.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/APRep.go similarity index 72% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APRep.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/APRep.go index 9c244f074ec..555fb807207 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APRep.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/APRep.go @@ -5,27 +5,12 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) -/* -AP-REP ::= [APPLICATION 15] SEQUENCE { -pvno [0] INTEGER (5), -msg-type [1] INTEGER (15), -enc-part [2] EncryptedData -- EncAPRepPart -} - -EncAPRepPart ::= [APPLICATION 27] SEQUENCE { - ctime [0] KerberosTime, - cusec [1] Microseconds, - subkey [2] EncryptionKey OPTIONAL, - seq-number [3] UInt32 OPTIONAL -} -*/ - // APRep implements RFC 4120 KRB_AP_REP: https://tools.ietf.org/html/rfc4120#section-5.5.2. type APRep struct { PVNO int `asn1:"explicit,tag:0"` diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APReq.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/APReq.go similarity index 78% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APReq.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/APReq.go index e1ed4ae1008..18360797631 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/APReq.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/APReq.go @@ -5,31 +5,18 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/keytab" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/keytab" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) -/*AP-REQ ::= [APPLICATION 14] SEQUENCE { -pvno [0] INTEGER (5), -msg-type [1] INTEGER (14), -ap-options [2] APOptions, -ticket [3] Ticket, -authenticator [4] EncryptedData -- Authenticator -} - -APOptions ::= KerberosFlags --- reserved(0), --- use-session-key(1), --- mutual-required(2)*/ - type marshalAPReq struct { PVNO int `asn1:"explicit,tag:0"` MsgType int `asn1:"explicit,tag:1"` @@ -153,32 +140,25 @@ func (a *APReq) Marshal() ([]byte, error) { // Verify an AP_REQ using service's keytab, spn and max acceptable clock skew duration. // The service ticket encrypted part and authenticator will be decrypted as part of this operation. -func (a *APReq) Verify(kt *keytab.Keytab, d time.Duration, cAddr types.HostAddress) (bool, error) { +func (a *APReq) Verify(kt *keytab.Keytab, d time.Duration, cAddr types.HostAddress, snameOverride *types.PrincipalName) (bool, error) { // Decrypt ticket's encrypted part with service key //TODO decrypt with service's session key from its TGT is use-to-user. Need to figure out how to get TGT. //if types.IsFlagSet(&a.APOptions, flags.APOptionUseSessionKey) { - // //If the USE-SESSION-KEY flag is set in the ap-options field, it indicates to - // //the server that user-to-user authentication is in use, and that the ticket - // //is encrypted in the session key from the server's TGT rather than in the server's secret key. // err := a.Ticket.Decrypt(tgt.DecryptedEncPart.Key) // if err != nil { // return false, krberror.Errorf(err, krberror.DecryptingError, "error decrypting encpart of ticket provided using session key") // } //} else { - // // Because it is possible for the server to be registered in multiple - // // realms, with different keys in each, the srealm field in the - // // unencrypted portion of the ticket in the KRB_AP_REQ is used to - // // specify which secret key the server should use to decrypt that - // // ticket.The KRB_AP_ERR_NOKEY error code is returned if the server - // // doesn't have the proper key to decipher the ticket. - // // The ticket is decrypted using the version of the server's key - // // specified by the ticket. // err := a.Ticket.DecryptEncPart(*kt, &a.Ticket.SName) // if err != nil { // return false, krberror.Errorf(err, krberror.DecryptingError, "error decrypting encpart of service ticket provided") // } //} - err := a.Ticket.DecryptEncPart(kt, &a.Ticket.SName) + sname := &a.Ticket.SName + if snameOverride != nil { + sname = snameOverride + } + err := a.Ticket.DecryptEncPart(kt, sname) if err != nil { return false, krberror.Errorf(err, krberror.DecryptingError, "error decrypting encpart of service ticket provided") } @@ -191,9 +171,8 @@ func (a *APReq) Verify(kt *keytab.Keytab, d time.Duration, cAddr types.HostAddre // Check client's address is listed in the client addresses in the ticket if len(a.Ticket.DecryptedEncPart.CAddr) > 0 { - //The addresses in the ticket (if any) are then searched for an address matching the operating-system reported - //address of the client. If no match is found or the server insists on ticket addresses but none are present in - //the ticket, the KRB_AP_ERR_BADADDR error is returned. + //If client addresses are present check if any of them match the source IP that sent the APReq + //If there is no match return KRB_AP_ERR_BADADDR error. if !types.HostAddressesContains(a.Ticket.DecryptedEncPart.CAddr, cAddr) { return false, NewKRBError(a.Ticket.SName, a.Ticket.Realm, errorcode.KRB_AP_ERR_BADADDR, "client address not within the list contained in the service ticket") } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCRep.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KDCRep.go similarity index 83% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCRep.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KDCRep.go index 76c89c3466a..69df9f0f6f5 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCRep.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KDCRep.go @@ -8,16 +8,17 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/config" - "gopkg.in/jcmturner/gokrb5.v7/credentials" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/flags" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/patype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/config" + "github.com/jcmturner/gokrb5/v8/credentials" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/flags" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/iana/patype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) type marshalKDCRep struct { @@ -103,6 +104,34 @@ func (k *ASRep) Unmarshal(b []byte) error { return nil } +// Marshal ASRep struct. +func (k *ASRep) Marshal() ([]byte, error) { + m := marshalKDCRep{ + PVNO: k.PVNO, + MsgType: k.MsgType, + PAData: k.PAData, + CRealm: k.CRealm, + CName: k.CName, + EncPart: k.EncPart, + } + b, err := k.Ticket.Marshal() + if err != nil { + return []byte{}, err + } + m.Ticket = asn1.RawValue{ + Class: asn1.ClassContextSpecific, + IsCompound: true, + Tag: 5, + Bytes: b, + } + mk, err := asn1.Marshal(m) + if err != nil { + return mk, krberror.Errorf(err, krberror.EncodingError, "error marshaling AS_REP") + } + mk = asn1tools.AddASNAppTag(mk, asnAppTag.ASREP) + return mk, nil +} + // Unmarshal bytes b into the TGSRep struct. func (k *TGSRep) Unmarshal(b []byte) error { var m marshalKDCRep @@ -130,17 +159,41 @@ func (k *TGSRep) Unmarshal(b []byte) error { return nil } +// Marshal TGSRep struct. +func (k *TGSRep) Marshal() ([]byte, error) { + m := marshalKDCRep{ + PVNO: k.PVNO, + MsgType: k.MsgType, + PAData: k.PAData, + CRealm: k.CRealm, + CName: k.CName, + EncPart: k.EncPart, + } + b, err := k.Ticket.Marshal() + if err != nil { + return []byte{}, err + } + m.Ticket = asn1.RawValue{ + Class: asn1.ClassContextSpecific, + IsCompound: true, + Tag: 5, + Bytes: b, + } + mk, err := asn1.Marshal(m) + if err != nil { + return mk, krberror.Errorf(err, krberror.EncodingError, "error marshaling TGS_REP") + } + mk = asn1tools.AddASNAppTag(mk, asnAppTag.TGSREP) + return mk, nil +} + // Unmarshal bytes b into encrypted part of KRB_KDC_REP. func (e *EncKDCRepPart) Unmarshal(b []byte) error { _, err := asn1.UnmarshalWithParams(b, e, fmt.Sprintf("application,explicit,tag:%v", asnAppTag.EncASRepPart)) if err != nil { // Try using tag 26 - /* Ref: RFC 4120 - Compatibility note: Some implementations unconditionally send an - encrypted EncTGSRepPart (application tag number 26) in this field - regardless of whether the reply is a AS-REP or a TGS-REP. In the - interest of compatibility, implementors MAY relax the check on the - tag number of the decrypted ENC-PART.*/ + // Ref: RFC 4120 - mentions that some implementations use application tag number 26 wether or not the reply is + // a AS-REP or a TGS-REP. _, err = asn1.UnmarshalWithParams(b, e, fmt.Sprintf("application,explicit,tag:%v", asnAppTag.EncTGSRepPart)) if err != nil { return krberror.Errorf(err, krberror.EncodingError, "error unmarshaling encrypted part within KDC_REP") @@ -149,12 +202,22 @@ func (e *EncKDCRepPart) Unmarshal(b []byte) error { return nil } +// Marshal encrypted part of KRB_KDC_REP. +func (e *EncKDCRepPart) Marshal() ([]byte, error) { + b, err := asn1.Marshal(*e) + if err != nil { + return b, krberror.Errorf(err, krberror.EncodingError, "marshaling error of AS_REP encpart") + } + b = asn1tools.AddASNAppTag(b, asnAppTag.EncASRepPart) + return b, nil +} + // DecryptEncPart decrypts the encrypted part of an AS_REP. func (k *ASRep) DecryptEncPart(c *credentials.Credentials) (types.EncryptionKey, error) { var key types.EncryptionKey var err error if c.HasKeytab() { - key, err = c.Keytab().GetEncryptionKey(k.CName, k.CRealm, k.EncPart.KVNO, k.EncPart.EType) + key, _, err = c.Keytab().GetEncryptionKey(k.CName, k.CRealm, k.EncPart.KVNO, k.EncPart.EType) if err != nil { return key, krberror.Errorf(err, krberror.DecryptingError, "error decrypting AS_REP encrypted part") } @@ -184,14 +247,9 @@ func (k *ASRep) DecryptEncPart(c *credentials.Credentials) (types.EncryptionKey, // Verify checks the validity of AS_REP message. func (k *ASRep) Verify(cfg *config.Config, creds *credentials.Credentials, asReq ASReq) (bool, error) { //Ref RFC 4120 Section 3.1.5 - if k.CName.NameType != asReq.ReqBody.CName.NameType || k.CName.NameString == nil { + if !k.CName.Equal(asReq.ReqBody.CName) { return false, krberror.NewErrorf(krberror.KRBMsgError, "CName in response does not match what was requested. Requested: %+v; Reply: %+v", asReq.ReqBody.CName, k.CName) } - for i := range k.CName.NameString { - if k.CName.NameString[i] != asReq.ReqBody.CName.NameString[i] { - return false, krberror.NewErrorf(krberror.KRBMsgError, "CName in response does not match what was requested. Requested: %+v; Reply: %+v", asReq.ReqBody.CName, k.CName) - } - } if k.CRealm != asReq.ReqBody.Realm { return false, krberror.NewErrorf(krberror.KRBMsgError, "CRealm in response does not match what was requested. Requested: %s; Reply: %s", asReq.ReqBody.Realm, k.CRealm) } @@ -202,14 +260,9 @@ func (k *ASRep) Verify(cfg *config.Config, creds *credentials.Credentials, asReq if k.DecryptedEncPart.Nonce != asReq.ReqBody.Nonce { return false, krberror.NewErrorf(krberror.KRBMsgError, "possible replay attack, nonce in response does not match that in request") } - if k.DecryptedEncPart.SName.NameType != asReq.ReqBody.SName.NameType || k.DecryptedEncPart.SName.NameString == nil { + if !k.DecryptedEncPart.SName.Equal(asReq.ReqBody.SName) { return false, krberror.NewErrorf(krberror.KRBMsgError, "SName in response does not match what was requested. Requested: %v; Reply: %v", asReq.ReqBody.SName, k.DecryptedEncPart.SName) } - for i := range k.CName.NameString { - if k.DecryptedEncPart.SName.NameString[i] != asReq.ReqBody.SName.NameString[i] { - return false, krberror.NewErrorf(krberror.KRBMsgError, "SName in response does not match what was requested. Requested: %+v; Reply: %+v", asReq.ReqBody.SName, k.DecryptedEncPart.SName) - } - } if k.DecryptedEncPart.SRealm != asReq.ReqBody.Realm { return false, krberror.NewErrorf(krberror.KRBMsgError, "SRealm in response does not match what was requested. Requested: %s; Reply: %s", asReq.ReqBody.Realm, k.DecryptedEncPart.SRealm) } @@ -265,13 +318,8 @@ func (k *TGSRep) DecryptEncPart(key types.EncryptionKey) error { // Verify checks the validity of the TGS_REP message. func (k *TGSRep) Verify(cfg *config.Config, tgsReq TGSReq) (bool, error) { - if k.CName.NameType != tgsReq.ReqBody.CName.NameType || k.CName.NameString == nil { - return false, krberror.NewErrorf(krberror.KRBMsgError, "CName type in response does not match what was requested. Requested: %+v; Reply: %+v", tgsReq.ReqBody.CName, k.CName) - } - for i := range k.CName.NameString { - if k.CName.NameString[i] != tgsReq.ReqBody.CName.NameString[i] { - return false, krberror.NewErrorf(krberror.KRBMsgError, "CName in response does not match what was requested. Requested: %+v; Reply: %+v", tgsReq.ReqBody.CName, k.CName) - } + if !k.CName.Equal(tgsReq.ReqBody.CName) { + return false, krberror.NewErrorf(krberror.KRBMsgError, "CName in response does not match what was requested. Requested: %+v; Reply: %+v", tgsReq.ReqBody.CName, k.CName) } if k.Ticket.Realm != tgsReq.ReqBody.Realm { return false, krberror.NewErrorf(krberror.KRBMsgError, "realm in response ticket does not match what was requested. Requested: %s; Reply: %s", tgsReq.ReqBody.Realm, k.Ticket.Realm) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCReq.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KDCReq.go similarity index 96% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCReq.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KDCReq.go index f75ddc4e1ce..3745afed2b9 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KDCReq.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KDCReq.go @@ -11,18 +11,18 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/config" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/flags" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/nametype" - "gopkg.in/jcmturner/gokrb5.v7/iana/patype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/config" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/flags" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/iana/nametype" + "github.com/jcmturner/gokrb5/v8/iana/patype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) type marshalKDCReq struct { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBCred.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBCred.go similarity index 93% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBCred.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KRBCred.go index 380cf80f9d9..536fdb9ec93 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBCred.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBCred.go @@ -5,12 +5,12 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) type marshalKRBCred struct { diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBError.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBError.go similarity index 82% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBError.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KRBError.go index 5aa9def6e2b..d2cf32d6581 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBError.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBError.go @@ -6,12 +6,13 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) // KRBError implements RFC 4120 KRB_ERROR: https://tools.ietf.org/html/rfc4120#section-5.9.1. @@ -59,6 +60,16 @@ func (k *KRBError) Unmarshal(b []byte) error { return nil } +// Marshal a KRBError into bytes. +func (k *KRBError) Marshal() ([]byte, error) { + b, err := asn1.Marshal(*k) + if err != nil { + return b, krberror.Errorf(err, krberror.EncodingError, "error marshaling KRBError") + } + b = asn1tools.AddASNAppTag(b, asnAppTag.KRBError) + return b, nil +} + // Error method implementing error interface on KRBError struct. func (k KRBError) Error() string { etxt := fmt.Sprintf("KRB Error: %s", errorcode.Lookup(k.ErrorCode)) diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBPriv.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBPriv.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBPriv.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KRBPriv.go index ebc5d3d0973..0ca614949fd 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBPriv.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBPriv.go @@ -5,14 +5,14 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) // KRBPriv implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.7.1. diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBSafe.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBSafe.go similarity index 68% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBSafe.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/KRBSafe.go index 9c5acc1dbcb..52cd2844936 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/KRBSafe.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/KRBSafe.go @@ -5,30 +5,12 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/msgtype" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/msgtype" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/types" ) -/* -KRB-SAFE ::= [APPLICATION 20] SEQUENCE { - pvno [0] INTEGER (5), - msg-type [1] INTEGER (20), - safe-body [2] KRB-SAFE-BODY, - cksum [3] Checksum -} - -KRB-SAFE-BODY ::= SEQUENCE { - user-data [0] OCTET STRING, - timestamp [1] KerberosTime OPTIONAL, - usec [2] Microseconds OPTIONAL, - seq-number [3] UInt32 OPTIONAL, - s-address [4] HostAddress, - r-address [5] HostAddress OPTIONAL -} -*/ - // KRBSafe implements RFC 4120 KRB_SAFE: https://tools.ietf.org/html/rfc4120#section-5.6.1. type KRBSafe struct { PVNO int `asn1:"explicit,tag:0"` diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/Ticket.go b/vendor/github.com/jcmturner/gokrb5/v8/messages/Ticket.go similarity index 91% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/messages/Ticket.go rename to vendor/github.com/jcmturner/gokrb5/v8/messages/Ticket.go index 49664b81c03..11efad62c2c 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/messages/Ticket.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/messages/Ticket.go @@ -1,24 +1,23 @@ package messages import ( - "crypto/rand" "fmt" "log" "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/adtype" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" - "gopkg.in/jcmturner/gokrb5.v7/iana/errorcode" - "gopkg.in/jcmturner/gokrb5.v7/iana/flags" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/keytab" - "gopkg.in/jcmturner/gokrb5.v7/krberror" - "gopkg.in/jcmturner/gokrb5.v7/pac" - "gopkg.in/jcmturner/gokrb5.v7/types" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/adtype" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/iana/errorcode" + "github.com/jcmturner/gokrb5/v8/iana/flags" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/keytab" + "github.com/jcmturner/gokrb5/v8/krberror" + "github.com/jcmturner/gokrb5/v8/pac" + "github.com/jcmturner/gokrb5/v8/types" ) // Reference: https://www.ietf.org/rfc/rfc4120.txt @@ -60,13 +59,11 @@ func NewTicket(cname types.PrincipalName, crealm string, sname types.PrincipalNa if err != nil { return Ticket{}, types.EncryptionKey{}, krberror.Errorf(err, krberror.EncryptingError, "error getting etype for new ticket") } - ks := etype.GetKeyByteSize() - kv := make([]byte, ks, ks) - rand.Read(kv) - sessionKey := types.EncryptionKey{ - KeyType: eTypeID, - KeyValue: kv, + sessionKey, err := types.GenerateEncryptionKey(etype) + if err != nil { + return Ticket{}, types.EncryptionKey{}, krberror.Errorf(err, krberror.EncryptingError, "error generating session key") } + etp := EncTicketPart{ Flags: flags, Key: sessionKey, @@ -83,7 +80,7 @@ func NewTicket(cname types.PrincipalName, crealm string, sname types.PrincipalNa return Ticket{}, types.EncryptionKey{}, krberror.Errorf(err, krberror.EncodingError, "error marshalling ticket encpart") } b = asn1tools.AddASNAppTag(b, asnAppTag.EncTicketPart) - skey, err := sktab.GetEncryptionKey(sname, srealm, kvno, eTypeID) + skey, _, err := sktab.GetEncryptionKey(sname, srealm, kvno, eTypeID) if err != nil { return Ticket{}, types.EncryptionKey{}, krberror.Errorf(err, krberror.EncryptingError, "error getting encryption key for new ticket") } @@ -193,7 +190,7 @@ func (t *Ticket) DecryptEncPart(keytab *keytab.Keytab, sname *types.PrincipalNam if sname == nil { sname = &t.SName } - key, err := keytab.GetEncryptionKey(*sname, t.Realm, t.EncPart.KVNO, t.EncPart.EType) + key, _, err := keytab.GetEncryptionKey(*sname, t.Realm, t.EncPart.KVNO, t.EncPart.EType) if err != nil { return NewKRBError(t.SName, t.Realm, errorcode.KRB_AP_ERR_NOKEY, fmt.Sprintf("Could not get key from keytab: %v", err)) } @@ -236,7 +233,7 @@ func (t *Ticket) GetPACType(keytab *keytab.Keytab, sname *types.PrincipalName, l if sname == nil { sname = &t.SName } - key, err := keytab.GetEncryptionKey(*sname, t.Realm, t.EncPart.KVNO, t.EncPart.EType) + key, _, err := keytab.GetEncryptionKey(*sname, t.Realm, t.EncPart.KVNO, t.EncPart.EType) if err != nil { return isPAC, p, NewKRBError(t.SName, t.Realm, errorcode.KRB_AP_ERR_NOKEY, fmt.Sprintf("Could not get key from keytab: %v", err)) } diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_claims.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/client_claims.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_claims.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/client_claims.go index 612979e4ed4..36871e00fb4 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_claims.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/client_claims.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // Claims reference: https://msdn.microsoft.com/en-us/library/hh553895.aspx @@ -23,6 +23,7 @@ func (k *ClientClaimsInfo) Unmarshal(b []byte) (err error) { err = dec.Decode(m) if err != nil { err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSetMetadata: %v", err) + return } k.ClaimsSetMetadata = *m k.ClaimsSet, err = k.ClaimsSetMetadata.ClaimsSet() diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/client_info.go similarity index 96% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/client_info.go index ad5212dca7e..ddd957808a8 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/client_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/client_info.go @@ -3,7 +3,7 @@ package pac import ( "bytes" - "gopkg.in/jcmturner/rpc.v1/mstypes" + "github.com/jcmturner/rpc/v2/mstypes" ) // ClientInfo implements https://msdn.microsoft.com/en-us/library/cc237951.aspx diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/credentials_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/credentials_info.go similarity index 76% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/credentials_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/credentials_info.go index a8c2c3ca7f8..0c7ccd4263e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/credentials_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/credentials_info.go @@ -5,11 +5,11 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/types" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/types" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // https://msdn.microsoft.com/en-us/library/cc237931.aspx @@ -40,6 +40,10 @@ func (c *CredentialsInfo) Unmarshal(b []byte, k types.EncryptionKey) (err error) return } c.PACCredentialDataEncrypted, err = r.ReadBytes(len(b) - 8) + if err != nil { + err = fmt.Errorf("error reading PAC Credetials Data: %v", err) + return + } err = c.DecryptEncPart(k) if err != nil { @@ -66,10 +70,6 @@ func (c *CredentialsInfo) DecryptEncPart(k types.EncryptionKey) error { } // CredentialData implements https://msdn.microsoft.com/en-us/library/cc237952.aspx -// This structure is encrypted prior to being encoded in any other structures. -// Encryption is performed by first serializing the data structure via Network Data Representation (NDR) encoding, as specified in [MS-RPCE]. -// Once serialized, the data is encrypted using the key and cryptographic system selected through the AS protocol and the KRB_AS_REP message -// Fields (for capturing this information) and cryptographic parameters are specified in PAC_CREDENTIAL_INFO (section 2.6.1). type CredentialData struct { CredentialCount uint32 Credentials []SECPKGSupplementalCred // Size is the value of CredentialCount diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_claims.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/device_claims.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_claims.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/device_claims.go index c2299bb082b..6eb29260050 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_claims.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/device_claims.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // Claims reference: https://msdn.microsoft.com/en-us/library/hh553895.aspx @@ -23,6 +23,7 @@ func (k *DeviceClaimsInfo) Unmarshal(b []byte) (err error) { err = dec.Decode(m) if err != nil { err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSetMetadata: %v", err) + return } k.ClaimsSetMetadata = *m k.ClaimsSet, err = k.ClaimsSetMetadata.ClaimsSet() diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/device_info.go similarity index 97% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/device_info.go index 51be207ab10..ce82daa5801 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/device_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/device_info.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // DeviceInfo implements https://msdn.microsoft.com/en-us/library/hh536402.aspx diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/kerb_validation_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/kerb_validation_info.go similarity index 90% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/kerb_validation_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/kerb_validation_info.go index 9dd69d2b3d6..dde78614eee 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/kerb_validation_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/kerb_validation_info.go @@ -5,8 +5,8 @@ import ( "bytes" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // KERB_VALIDATION_INFO flags. @@ -26,11 +26,6 @@ const ( ) // KerbValidationInfo implement https://msdn.microsoft.com/en-us/library/cc237948.aspx -// The KERB_VALIDATION_INFO structure defines the user's logon and authorization information -// provided by the DC. The KERB_VALIDATION_INFO structure is a subset of the -// NETLOGON_VALIDATION_SAM_INFO4 structure ([MS-NRPC] section 2.2.1.4.13). -// It is a subset due to historical reasons and to the use of the common Active Directory to generate this information. -// The KERB_VALIDATION_INFO structure is marshaled by RPC [MS-RPCE]. type KerbValidationInfo struct { LogOnTime mstypes.FileTime LogOffTime mstypes.FileTime diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/pac_type.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/pac_type.go similarity index 97% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/pac_type.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/pac_type.go index c73fd0679d6..fab2ad7cda7 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/pac_type.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/pac_type.go @@ -6,10 +6,10 @@ import ( "fmt" "log" - "gopkg.in/jcmturner/gokrb5.v7/crypto" - "gopkg.in/jcmturner/gokrb5.v7/iana/keyusage" - "gopkg.in/jcmturner/gokrb5.v7/types" - "gopkg.in/jcmturner/rpc.v1/mstypes" + "github.com/jcmturner/gokrb5/v8/crypto" + "github.com/jcmturner/gokrb5/v8/iana/keyusage" + "github.com/jcmturner/gokrb5/v8/types" + "github.com/jcmturner/rpc/v2/mstypes" ) const ( diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/s4u_delegation_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/s4u_delegation_info.go similarity index 91% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/s4u_delegation_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/s4u_delegation_info.go index 614ee8565a6..da837d4b3a4 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/s4u_delegation_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/s4u_delegation_info.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) // S4UDelegationInfo implements https://msdn.microsoft.com/en-us/library/cc237944.aspx diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/signature_data.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/signature_data.go similarity index 59% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/signature_data.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/signature_data.go index 7e0fce1adec..8f6aa58faa8 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/signature_data.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/signature_data.go @@ -3,8 +3,8 @@ package pac import ( "bytes" - "gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype" - "gopkg.in/jcmturner/rpc.v1/mstypes" + "github.com/jcmturner/gokrb5/v8/iana/chksumtype" + "github.com/jcmturner/rpc/v2/mstypes" ) /* @@ -14,21 +14,9 @@ The Key Usage Value MUST be KERB_NON_KERB_CKSUM_SALT (17) [MS-KILE] (section 3.1 Server Signature (SignatureType = 0x00000006) https://msdn.microsoft.com/en-us/library/cc237957.aspx -The KDC will use the long-term key that the KDC shares with the server, so that the server can verify this signature on receiving a PAC. -The server signature is a keyed hash [RFC4757] of the entire PAC message, with the Signature fields of both PAC_SIGNATURE_DATA structures set to zero. -The key used to protect the ciphertext part of the response is used. -The checksum type corresponds to the key unless the key is DES, in which case the KERB_CHECKSUM_HMAC_MD5 key is used. -The resulting hash value is then placed in the Signature field of the server's PAC_SIGNATURE_DATA structure. KDC Signature (SignatureType = 0x00000007) https://msdn.microsoft.com/en-us/library/dd357117.aspx -The KDC will use KDC (krbtgt) key [RFC4120], so that other KDCs can verify this signature on receiving a PAC. -The KDC signature is a keyed hash [RFC4757] of the Server Signature field in the PAC message. -The cryptographic system that is used to calculate the checksum depends on which system the KDC supports, as defined below: -- Supports RC4-HMAC --> KERB_CHECKSUM_HMAC_MD5 -- Does not support RC4-HMAC and supports AES256 --> HMAC_SHA1_96_AES256 -- Does not support RC4-HMAC or AES256-CTS-HMAC-SHA1-96, and supports AES128-CTS-HMAC-SHA1-96 --> HMAC_SHA1_96_AES128 -- Does not support RC4-HMAC, AES128-CTS-HMAC-SHA1-96 or AES256-CTS-HMAC-SHA1-96 --> None. The checksum operation will fail. */ // SignatureData implements https://msdn.microsoft.com/en-us/library/cc237955.aspx diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/supplemental_cred.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/supplemental_cred.go similarity index 89% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/supplemental_cred.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/supplemental_cred.go index 5f4f93c28bd..d40679d49b8 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/supplemental_cred.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/supplemental_cred.go @@ -6,8 +6,8 @@ import ( "errors" "fmt" - "gopkg.in/jcmturner/rpc.v1/mstypes" - "gopkg.in/jcmturner/rpc.v1/ndr" + "github.com/jcmturner/rpc/v2/mstypes" + "github.com/jcmturner/rpc/v2/ndr" ) const ( @@ -70,9 +70,6 @@ func isFlagSet(f uint32, i uint32) bool { } // SECPKGSupplementalCred implements https://msdn.microsoft.com/en-us/library/cc237956.aspx -// The SECPKG_SUPPLEMENTAL_CRED structure defines the name of the security package that requires -// supplemental credentials and the credential buffer for that package. -// The SECPKG_SUPPLEMENTAL_CRED structure is marshaled by RPC. type SECPKGSupplementalCred struct { PackageName mstypes.RPCUnicodeString CredentialSize uint32 diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/upn_dns_info.go b/vendor/github.com/jcmturner/gokrb5/v8/pac/upn_dns_info.go similarity index 98% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/pac/upn_dns_info.go rename to vendor/github.com/jcmturner/gokrb5/v8/pac/upn_dns_info.go index ee0e6bfd457..d374b963089 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/pac/upn_dns_info.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/pac/upn_dns_info.go @@ -3,7 +3,7 @@ package pac import ( "bytes" - "gopkg.in/jcmturner/rpc.v1/mstypes" + "github.com/jcmturner/rpc/v2/mstypes" ) // UPNDNSInfo implements https://msdn.microsoft.com/en-us/library/dd240468.aspx diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/Authenticator.go b/vendor/github.com/jcmturner/gokrb5/v8/types/Authenticator.go similarity index 71% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/types/Authenticator.go rename to vendor/github.com/jcmturner/gokrb5/v8/types/Authenticator.go index 500e0346149..1fdba78a37d 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/Authenticator.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/types/Authenticator.go @@ -9,32 +9,13 @@ import ( "time" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/asn1tools" - "gopkg.in/jcmturner/gokrb5.v7/iana" - "gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag" + "github.com/jcmturner/gokrb5/v8/asn1tools" + "github.com/jcmturner/gokrb5/v8/iana" + "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" ) -/*Authenticator ::= [APPLICATION 2] SEQUENCE { -authenticator-vno [0] INTEGER (5), -crealm [1] Realm, -cname [2] PrincipalName, -cksum [3] Checksum OPTIONAL, -cusec [4] Microseconds, -ctime [5] KerberosTime, -subkey [6] EncryptionKey OPTIONAL, -seq-number [7] UInt32 OPTIONAL, -authorization-data [8] AuthorizationData OPTIONAL -} - - cksum - This field contains a checksum of the application data that - accompanies the KRB_AP_REQ, computed using a key usage value of 10 - in normal application exchanges, or 6 when used in the TGS-REQ - PA-TGS-REQ AP-DATA field. - -*/ - -// Authenticator - A record containing information that can be shown to have been recently generated using the session key known only by the client and server. +// Authenticator - A record containing information that can be shown to have been recently generated using the session +// key known only by the client and server. // https://tools.ietf.org/html/rfc4120#section-5.5.1 type Authenticator struct { AVNO int `asn1:"explicit,tag:0"` diff --git a/vendor/github.com/jcmturner/gokrb5/v8/types/AuthorizationData.go b/vendor/github.com/jcmturner/gokrb5/v8/types/AuthorizationData.go new file mode 100644 index 00000000000..80c477cef71 --- /dev/null +++ b/vendor/github.com/jcmturner/gokrb5/v8/types/AuthorizationData.go @@ -0,0 +1,55 @@ +package types + +import ( + "github.com/jcmturner/gofork/encoding/asn1" +) + +// Reference: https://www.ietf.org/rfc/rfc4120.txt +// Section: 5.2.6 + +// AuthorizationData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6 +type AuthorizationData []AuthorizationDataEntry + +// AuthorizationDataEntry implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6 +type AuthorizationDataEntry struct { + ADType int32 `asn1:"explicit,tag:0"` + ADData []byte `asn1:"explicit,tag:1"` +} + +// ADIfRelevant implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.1 +type ADIfRelevant AuthorizationData + +// ADKDCIssued implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.2 +type ADKDCIssued struct { + ADChecksum Checksum `asn1:"explicit,tag:0"` + IRealm string `asn1:"optional,generalstring,explicit,tag:1"` + Isname PrincipalName `asn1:"optional,explicit,tag:2"` + Elements AuthorizationData `asn1:"explicit,tag:3"` +} + +// ADAndOr implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.3 +type ADAndOr struct { + ConditionCount int32 `asn1:"explicit,tag:0"` + Elements AuthorizationData `asn1:"explicit,tag:1"` +} + +// ADMandatoryForKDC implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.4 +type ADMandatoryForKDC AuthorizationData + +// Unmarshal bytes into the ADKDCIssued. +func (a *ADKDCIssued) Unmarshal(b []byte) error { + _, err := asn1.Unmarshal(b, a) + return err +} + +// Unmarshal bytes into the AuthorizationData. +func (a *AuthorizationData) Unmarshal(b []byte) error { + _, err := asn1.Unmarshal(b, a) + return err +} + +// Unmarshal bytes into the AuthorizationDataEntry. +func (a *AuthorizationDataEntry) Unmarshal(b []byte) error { + _, err := asn1.Unmarshal(b, a) + return err +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/Cryptosystem.go b/vendor/github.com/jcmturner/gokrb5/v8/types/Cryptosystem.go similarity index 73% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/types/Cryptosystem.go rename to vendor/github.com/jcmturner/gokrb5/v8/types/Cryptosystem.go index 7e8b4ab2969..2f354ea7a6e 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/Cryptosystem.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/types/Cryptosystem.go @@ -1,7 +1,10 @@ package types import ( + "crypto/rand" + "github.com/jcmturner/gofork/encoding/asn1" + "github.com/jcmturner/gokrb5/v8/crypto/etype" ) // Reference: https://www.ietf.org/rfc/rfc4120.txt @@ -18,7 +21,7 @@ type EncryptedData struct { // AKA KeyBlock type EncryptionKey struct { KeyType int32 `asn1:"explicit,tag:0"` - KeyValue []byte `asn1:"explicit,tag:1"` + KeyValue []byte `asn1:"explicit,tag:1" json:"-"` } // Checksum implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.9 @@ -53,3 +56,17 @@ func (a *Checksum) Unmarshal(b []byte) error { _, err := asn1.Unmarshal(b, a) return err } + +// GenerateEncryptionKey creates a new EncryptionKey with a random key value. +func GenerateEncryptionKey(etype etype.EType) (EncryptionKey, error) { + k := EncryptionKey{ + KeyType: etype.GetETypeID(), + } + b := make([]byte, etype.GetKeyByteSize(), etype.GetKeyByteSize()) + _, err := rand.Read(b) + if err != nil { + return k, err + } + k.KeyValue = b + return k, nil +} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/HostAddress.go b/vendor/github.com/jcmturner/gokrb5/v8/types/HostAddress.go similarity index 85% rename from vendor/gopkg.in/jcmturner/gokrb5.v7/types/HostAddress.go rename to vendor/github.com/jcmturner/gokrb5/v8/types/HostAddress.go index 2f6a5a7ccfe..895fe805391 100644 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/HostAddress.go +++ b/vendor/github.com/jcmturner/gokrb5/v8/types/HostAddress.go @@ -9,33 +9,9 @@ import ( "net" "github.com/jcmturner/gofork/encoding/asn1" - "gopkg.in/jcmturner/gokrb5.v7/iana/addrtype" + "github.com/jcmturner/gokrb5/v8/iana/addrtype" ) -/* -HostAddress and HostAddresses - -HostAddress ::= SEQUENCE { - addr-type [0] Int32, - address [1] OCTET STRING -} - --- NOTE: HostAddresses is always used as an OPTIONAL field and --- should not be empty. -HostAddresses -- NOTE: subtly different from rfc1510, - -- but has a value mapping and encodes the same - ::= SEQUENCE OF HostAddress - -The host address encodings consist of two fields: - -addr-type - This field specifies the type of address that follows. Pre- - defined values for this field are specified in Section 7.5.3. - -address - This field encodes a single address of type addr-type. -*/ - // HostAddresses implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.5 type HostAddresses []HostAddress diff --git a/vendor/github.com/jcmturner/gokrb5/v8/types/KerberosFlags.go b/vendor/github.com/jcmturner/gokrb5/v8/types/KerberosFlags.go new file mode 100644 index 00000000000..0f2038340dd --- /dev/null +++ b/vendor/github.com/jcmturner/gokrb5/v8/types/KerberosFlags.go @@ -0,0 +1,68 @@ +package types + +// Reference: https://www.ietf.org/rfc/rfc4120.txt +// Section: 5.2.8 + +import ( + "github.com/jcmturner/gofork/encoding/asn1" +) + +// NewKrbFlags returns an ASN1 BitString struct of the right size for KrbFlags. +func NewKrbFlags() asn1.BitString { + f := asn1.BitString{} + f.Bytes = make([]byte, 4) + f.BitLength = len(f.Bytes) * 8 + return f +} + +// SetFlags sets the flags of an ASN1 BitString. +func SetFlags(f *asn1.BitString, j []int) { + for _, i := range j { + SetFlag(f, i) + } +} + +// SetFlag sets a flag in an ASN1 BitString. +func SetFlag(f *asn1.BitString, i int) { + for l := len(f.Bytes); l < 4; l++ { + (*f).Bytes = append((*f).Bytes, byte(0)) + (*f).BitLength = len((*f).Bytes) * 8 + } + //Which byte? + b := i / 8 + //Which bit in byte + p := uint(7 - (i - 8*b)) + (*f).Bytes[b] = (*f).Bytes[b] | (1 << p) +} + +// UnsetFlags unsets flags in an ASN1 BitString. +func UnsetFlags(f *asn1.BitString, j []int) { + for _, i := range j { + UnsetFlag(f, i) + } +} + +// UnsetFlag unsets a flag in an ASN1 BitString. +func UnsetFlag(f *asn1.BitString, i int) { + for l := len(f.Bytes); l < 4; l++ { + (*f).Bytes = append((*f).Bytes, byte(0)) + (*f).BitLength = len((*f).Bytes) * 8 + } + //Which byte? + b := i / 8 + //Which bit in byte + p := uint(7 - (i - 8*b)) + (*f).Bytes[b] = (*f).Bytes[b] &^ (1 << p) +} + +// IsFlagSet tests if a flag is set in the ASN1 BitString. +func IsFlagSet(f *asn1.BitString, i int) bool { + //Which byte? + b := i / 8 + //Which bit in byte + p := uint(7 - (i - 8*b)) + if (*f).Bytes[b]&(1<= 4294967296 { - str = fmt.Sprintf("S-1-0x%s", hex.EncodeToString(s.IdentifierAuthority[:])) + if i > math.MaxUint32 { + fmt.Fprintf(&strb, "0x%s", hex.EncodeToString(s.IdentifierAuthority[:])) } else { - str = fmt.Sprintf("S-1-%d", i) + fmt.Fprintf(&strb, "%d", i) } for _, sub := range s.SubAuthority { - str = fmt.Sprintf("%s-%d", str, sub) + fmt.Fprintf(&strb, "-%d", sub) } - return str + return strb.String() } diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/mstypes/user_session_key.go b/vendor/github.com/jcmturner/rpc/v2/mstypes/user_session_key.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/mstypes/user_session_key.go rename to vendor/github.com/jcmturner/rpc/v2/mstypes/user_session_key.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/arrays.go b/vendor/github.com/jcmturner/rpc/v2/ndr/arrays.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/arrays.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/arrays.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/decoder.go b/vendor/github.com/jcmturner/rpc/v2/ndr/decoder.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/decoder.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/decoder.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/error.go b/vendor/github.com/jcmturner/rpc/v2/ndr/error.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/error.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/error.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/header.go b/vendor/github.com/jcmturner/rpc/v2/ndr/header.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/header.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/header.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go b/vendor/github.com/jcmturner/rpc/v2/ndr/pipe.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/pipe.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/primitives.go b/vendor/github.com/jcmturner/rpc/v2/ndr/primitives.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/primitives.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/primitives.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/rawbytes.go b/vendor/github.com/jcmturner/rpc/v2/ndr/rawbytes.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/rawbytes.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/rawbytes.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/strings.go b/vendor/github.com/jcmturner/rpc/v2/ndr/strings.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/strings.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/strings.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/tags.go b/vendor/github.com/jcmturner/rpc/v2/ndr/tags.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/tags.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/tags.go diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/union.go b/vendor/github.com/jcmturner/rpc/v2/ndr/union.go similarity index 100% rename from vendor/gopkg.in/jcmturner/rpc.v1/ndr/union.go rename to vendor/github.com/jcmturner/rpc/v2/ndr/union.go diff --git a/vendor/github.com/pierrec/lz4/lz4.go b/vendor/github.com/pierrec/lz4/lz4.go index 6c73539a343..a3284bdf708 100644 --- a/vendor/github.com/pierrec/lz4/lz4.go +++ b/vendor/github.com/pierrec/lz4/lz4.go @@ -10,9 +10,10 @@ // package lz4 -import "math/bits" - -import "sync" +import ( + "math/bits" + "sync" +) const ( // Extension is the LZ4 frame file name extension @@ -20,8 +21,9 @@ const ( // Version is the LZ4 frame format version Version = 1 - frameMagic uint32 = 0x184D2204 - frameSkipMagic uint32 = 0x184D2A50 + frameMagic uint32 = 0x184D2204 + frameSkipMagic uint32 = 0x184D2A50 + frameMagicLegacy uint32 = 0x184C2102 // The following constants are used to setup the compression algorithm. minMatch = 4 // the minimum size of the match sequence size (4 bytes) @@ -108,6 +110,7 @@ type Header struct { done bool // Header processed flag (Read or Write and checked). } +// Reset reset internal status func (h *Header) Reset() { h.done = false } diff --git a/vendor/github.com/pierrec/lz4/reader_legacy.go b/vendor/github.com/pierrec/lz4/reader_legacy.go new file mode 100644 index 00000000000..1670a77d02a --- /dev/null +++ b/vendor/github.com/pierrec/lz4/reader_legacy.go @@ -0,0 +1,207 @@ +package lz4 + +import ( + "encoding/binary" + "fmt" + "io" +) + +// ReaderLegacy implements the LZ4Demo frame decoder. +// The Header is set after the first call to Read(). +type ReaderLegacy struct { + Header + // Handler called when a block has been successfully read. + // It provides the number of bytes read. + OnBlockDone func(size int) + + lastBlock bool + buf [8]byte // Scrap buffer. + pos int64 // Current position in src. + src io.Reader // Source. + zdata []byte // Compressed data. + data []byte // Uncompressed data. + idx int // Index of unread bytes into data. + skip int64 // Bytes to skip before next read. + dpos int64 // Position in dest +} + +// NewReaderLegacy returns a new LZ4Demo frame decoder. +// No access to the underlying io.Reader is performed. +func NewReaderLegacy(src io.Reader) *ReaderLegacy { + r := &ReaderLegacy{src: src} + return r +} + +// readHeader checks the frame magic number and parses the frame descriptoz. +// Skippable frames are supported even as a first frame although the LZ4 +// specifications recommends skippable frames not to be used as first frames. +func (z *ReaderLegacy) readLegacyHeader() error { + z.lastBlock = false + magic, err := z.readUint32() + if err != nil { + z.pos += 4 + if err == io.ErrUnexpectedEOF { + return io.EOF + } + return err + } + if magic != frameMagicLegacy { + return ErrInvalid + } + z.pos += 4 + + // Legacy has fixed 8MB blocksizes + // https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md#legacy-frame + bSize := blockSize4M * 2 + + // Allocate the compressed/uncompressed buffers. + // The compressed buffer cannot exceed the uncompressed one. + if n := 2 * bSize; cap(z.zdata) < n { + z.zdata = make([]byte, n, n) + } + if debugFlag { + debug("header block max size size=%d", bSize) + } + z.zdata = z.zdata[:bSize] + z.data = z.zdata[:cap(z.zdata)][bSize:] + z.idx = len(z.data) + + z.Header.done = true + if debugFlag { + debug("header read: %v", z.Header) + } + + return nil +} + +// Read decompresses data from the underlying source into the supplied buffer. +// +// Since there can be multiple streams concatenated, Header values may +// change between calls to Read(). If that is the case, no data is actually read from +// the underlying io.Reader, to allow for potential input buffer resizing. +func (z *ReaderLegacy) Read(buf []byte) (int, error) { + if debugFlag { + debug("Read buf len=%d", len(buf)) + } + if !z.Header.done { + if err := z.readLegacyHeader(); err != nil { + return 0, err + } + if debugFlag { + debug("header read OK compressed buffer %d / %d uncompressed buffer %d : %d index=%d", + len(z.zdata), cap(z.zdata), len(z.data), cap(z.data), z.idx) + } + } + + if len(buf) == 0 { + return 0, nil + } + + if z.idx == len(z.data) { + // No data ready for reading, process the next block. + if debugFlag { + debug(" reading block from writer %d %d", z.idx, blockSize4M*2) + } + + // Reset uncompressed buffer + z.data = z.zdata[:cap(z.zdata)][len(z.zdata):] + + bLen, err := z.readUint32() + if err != nil { + return 0, err + } + if debugFlag { + debug(" bLen %d (0x%x) offset = %d (0x%x)", bLen, bLen, z.pos, z.pos) + } + z.pos += 4 + + // Legacy blocks are always compressed, even when detrimental + if debugFlag { + debug(" compressed block size %d", bLen) + } + + if int(bLen) > cap(z.data) { + return 0, fmt.Errorf("lz4: invalid block size: %d", bLen) + } + zdata := z.zdata[:bLen] + if _, err := io.ReadFull(z.src, zdata); err != nil { + return 0, err + } + z.pos += int64(bLen) + + n, err := UncompressBlock(zdata, z.data) + if err != nil { + return 0, err + } + + z.data = z.data[:n] + if z.OnBlockDone != nil { + z.OnBlockDone(n) + } + + z.idx = 0 + + // Legacy blocks are fixed to 8MB, if we read a decompressed block smaller than this + // it means we've reached the end... + if n < blockSize4M*2 { + z.lastBlock = true + } + } + + if z.skip > int64(len(z.data[z.idx:])) { + z.skip -= int64(len(z.data[z.idx:])) + z.dpos += int64(len(z.data[z.idx:])) + z.idx = len(z.data) + return 0, nil + } + + z.idx += int(z.skip) + z.dpos += z.skip + z.skip = 0 + + n := copy(buf, z.data[z.idx:]) + z.idx += n + z.dpos += int64(n) + if debugFlag { + debug("%v] copied %d bytes to input (%d:%d)", z.lastBlock, n, z.idx, len(z.data)) + } + if z.lastBlock && len(z.data) == z.idx { + return n, io.EOF + } + return n, nil +} + +// Seek implements io.Seeker, but supports seeking forward from the current +// position only. Any other seek will return an error. Allows skipping output +// bytes which aren't needed, which in some scenarios is faster than reading +// and discarding them. +// Note this may cause future calls to Read() to read 0 bytes if all of the +// data they would have returned is skipped. +func (z *ReaderLegacy) Seek(offset int64, whence int) (int64, error) { + if offset < 0 || whence != io.SeekCurrent { + return z.dpos + z.skip, ErrUnsupportedSeek + } + z.skip += offset + return z.dpos + z.skip, nil +} + +// Reset discards the Reader's state and makes it equivalent to the +// result of its original state from NewReader, but reading from r instead. +// This permits reusing a Reader rather than allocating a new one. +func (z *ReaderLegacy) Reset(r io.Reader) { + z.Header = Header{} + z.pos = 0 + z.src = r + z.zdata = z.zdata[:0] + z.data = z.data[:0] + z.idx = 0 +} + +// readUint32 reads an uint32 into the supplied buffer. +// The idea is to make use of the already allocated buffers avoiding additional allocations. +func (z *ReaderLegacy) readUint32() (uint32, error) { + buf := z.buf[:4] + _, err := io.ReadFull(z.src, buf) + x := binary.LittleEndian.Uint32(buf) + return x, err +} diff --git a/vendor/github.com/pierrec/lz4/writer.go b/vendor/github.com/pierrec/lz4/writer.go index 324f1386b8a..6a60a9a6a57 100644 --- a/vendor/github.com/pierrec/lz4/writer.go +++ b/vendor/github.com/pierrec/lz4/writer.go @@ -3,9 +3,10 @@ package lz4 import ( "encoding/binary" "fmt" - "github.com/pierrec/lz4/internal/xxh32" "io" "runtime" + + "github.com/pierrec/lz4/internal/xxh32" ) // zResult contains the results of compressing a block. @@ -370,6 +371,10 @@ func (z *Writer) Reset(w io.Writer) { z.checksum.Reset() z.idx = 0 z.err = nil + // reset hashtable to ensure deterministic output. + for i := range z.hashtable { + z.hashtable[i] = 0 + } z.WithConcurrency(n) } diff --git a/vendor/github.com/prometheus/common/config/http_config.go b/vendor/github.com/prometheus/common/config/http_config.go index 4dd8875855c..07b389ebed9 100644 --- a/vendor/github.com/prometheus/common/config/http_config.go +++ b/vendor/github.com/prometheus/common/config/http_config.go @@ -52,6 +52,21 @@ func (a *BasicAuth) SetDirectory(dir string) { a.PasswordFile = JoinDir(dir, a.PasswordFile) } +// Authorization contains HTTP authorization credentials. +type Authorization struct { + Type string `yaml:"type,omitempty"` + Credentials Secret `yaml:"credentials,omitempty"` + CredentialsFile string `yaml:"credentials_file,omitempty"` +} + +// SetDirectory joins any relative file paths with dir. +func (a *Authorization) SetDirectory(dir string) { + if a == nil { + return + } + a.CredentialsFile = JoinDir(dir, a.CredentialsFile) +} + // URL is a custom URL type that allows validation at configuration load time. type URL struct { *url.URL @@ -84,9 +99,13 @@ func (u URL) MarshalYAML() (interface{}, error) { type HTTPClientConfig struct { // The HTTP basic authentication credentials for the targets. BasicAuth *BasicAuth `yaml:"basic_auth,omitempty"` - // The bearer token for the targets. + // The HTTP authorization credentials for the targets. + Authorization *Authorization `yaml:"authorization,omitempty"` + // The bearer token for the targets. Deprecated in favour of + // Authorization.Credentials. BearerToken Secret `yaml:"bearer_token,omitempty"` - // The bearer token file for the targets. + // The bearer token file for the targets. Deprecated in favour of + // Authorization.CredentialsFile. BearerTokenFile string `yaml:"bearer_token_file,omitempty"` // HTTP proxy server to use to connect to the targets. ProxyURL URL `yaml:"proxy_url,omitempty"` @@ -101,12 +120,14 @@ func (c *HTTPClientConfig) SetDirectory(dir string) { } c.TLSConfig.SetDirectory(dir) c.BasicAuth.SetDirectory(dir) + c.Authorization.SetDirectory(dir) c.BearerTokenFile = JoinDir(dir, c.BearerTokenFile) } // Validate validates the HTTPClientConfig to check only one of BearerToken, // BasicAuth and BearerTokenFile is configured. func (c *HTTPClientConfig) Validate() error { + // Backwards compatibility with the bearer_token field. if len(c.BearerToken) > 0 && len(c.BearerTokenFile) > 0 { return fmt.Errorf("at most one of bearer_token & bearer_token_file must be configured") } @@ -116,6 +137,35 @@ func (c *HTTPClientConfig) Validate() error { if c.BasicAuth != nil && (string(c.BasicAuth.Password) != "" && c.BasicAuth.PasswordFile != "") { return fmt.Errorf("at most one of basic_auth password & password_file must be configured") } + if c.Authorization != nil { + if len(c.BearerToken) > 0 || len(c.BearerTokenFile) > 0 { + return fmt.Errorf("authorization is not compatible with bearer_token & bearer_token_file") + } + if string(c.Authorization.Credentials) != "" && c.Authorization.CredentialsFile != "" { + return fmt.Errorf("at most one of authorization credentials & credentials_file must be configured") + } + c.Authorization.Type = strings.TrimSpace(c.Authorization.Type) + if len(c.Authorization.Type) == 0 { + c.Authorization.Type = "Bearer" + } + if strings.ToLower(c.Authorization.Type) == "basic" { + return fmt.Errorf(`authorization type cannot be set to "basic", use "basic_auth" instead`) + } + if c.BasicAuth != nil { + return fmt.Errorf("at most one of basic_auth & authorization must be configured") + } + } else { + if len(c.BearerToken) > 0 { + c.Authorization = &Authorization{Credentials: c.BearerToken} + c.Authorization.Type = "Bearer" + c.BearerToken = "" + } + if len(c.BearerTokenFile) > 0 { + c.Authorization = &Authorization{CredentialsFile: c.BearerTokenFile} + c.Authorization.Type = "Bearer" + c.BearerTokenFile = "" + } + } return nil } @@ -186,12 +236,19 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, disableKeepAli } } - // If a bearer token is provided, create a round tripper that will set the + // If a authorization_credentials is provided, create a round tripper that will set the // Authorization header correctly on each request. + if cfg.Authorization != nil && len(cfg.Authorization.Credentials) > 0 { + rt = NewAuthorizationCredentialsRoundTripper(cfg.Authorization.Type, cfg.Authorization.Credentials, rt) + } else if cfg.Authorization != nil && len(cfg.Authorization.CredentialsFile) > 0 { + rt = NewAuthorizationCredentialsFileRoundTripper(cfg.Authorization.Type, cfg.Authorization.CredentialsFile, rt) + } + // Backwards compatibility, be nice with importers who would not have + // called Validate(). if len(cfg.BearerToken) > 0 { - rt = NewBearerAuthRoundTripper(cfg.BearerToken, rt) + rt = NewAuthorizationCredentialsRoundTripper("Bearer", cfg.BearerToken, rt) } else if len(cfg.BearerTokenFile) > 0 { - rt = NewBearerAuthFileRoundTripper(cfg.BearerTokenFile, rt) + rt = NewAuthorizationCredentialsFileRoundTripper("Bearer", cfg.BearerTokenFile, rt) } if cfg.BasicAuth != nil { @@ -214,58 +271,61 @@ func NewRoundTripperFromConfig(cfg HTTPClientConfig, name string, disableKeepAli return newTLSRoundTripper(tlsConfig, cfg.TLSConfig.CAFile, newRT) } -type bearerAuthRoundTripper struct { - bearerToken Secret - rt http.RoundTripper +type authorizationCredentialsRoundTripper struct { + authType string + authCredentials Secret + rt http.RoundTripper } -// NewBearerAuthRoundTripper adds the provided bearer token to a request unless the authorization -// header has already been set. -func NewBearerAuthRoundTripper(token Secret, rt http.RoundTripper) http.RoundTripper { - return &bearerAuthRoundTripper{token, rt} +// NewAuthorizationCredentialsRoundTripper adds the provided credentials to a +// request unless the authorization header has already been set. +func NewAuthorizationCredentialsRoundTripper(authType string, authCredentials Secret, rt http.RoundTripper) http.RoundTripper { + return &authorizationCredentialsRoundTripper{authType, authCredentials, rt} } -func (rt *bearerAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { +func (rt *authorizationCredentialsRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("Authorization")) == 0 { req = cloneRequest(req) - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", string(rt.bearerToken))) + req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, string(rt.authCredentials))) } return rt.rt.RoundTrip(req) } -func (rt *bearerAuthRoundTripper) CloseIdleConnections() { +func (rt *authorizationCredentialsRoundTripper) CloseIdleConnections() { if ci, ok := rt.rt.(closeIdler); ok { ci.CloseIdleConnections() } } -type bearerAuthFileRoundTripper struct { - bearerFile string - rt http.RoundTripper +type authorizationCredentialsFileRoundTripper struct { + authType string + authCredentialsFile string + rt http.RoundTripper } -// NewBearerAuthFileRoundTripper adds the bearer token read from the provided file to a request unless -// the authorization header has already been set. This file is read for every request. -func NewBearerAuthFileRoundTripper(bearerFile string, rt http.RoundTripper) http.RoundTripper { - return &bearerAuthFileRoundTripper{bearerFile, rt} +// NewAuthorizationCredentialsFileRoundTripper adds the authorization +// credentials read from the provided file to a request unless the authorization +// header has already been set. This file is read for every request. +func NewAuthorizationCredentialsFileRoundTripper(authType, authCredentialsFile string, rt http.RoundTripper) http.RoundTripper { + return &authorizationCredentialsFileRoundTripper{authType, authCredentialsFile, rt} } -func (rt *bearerAuthFileRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { +func (rt *authorizationCredentialsFileRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { if len(req.Header.Get("Authorization")) == 0 { - b, err := ioutil.ReadFile(rt.bearerFile) + b, err := ioutil.ReadFile(rt.authCredentialsFile) if err != nil { - return nil, fmt.Errorf("unable to read bearer token file %s: %s", rt.bearerFile, err) + return nil, fmt.Errorf("unable to read authorization credentials file %s: %s", rt.authCredentialsFile, err) } - bearerToken := strings.TrimSpace(string(b)) + authCredentials := strings.TrimSpace(string(b)) req = cloneRequest(req) - req.Header.Set("Authorization", "Bearer "+bearerToken) + req.Header.Set("Authorization", fmt.Sprintf("%s %s", rt.authType, authCredentials)) } return rt.rt.RoundTrip(req) } -func (rt *bearerAuthFileRoundTripper) CloseIdleConnections() { +func (rt *authorizationCredentialsFileRoundTripper) CloseIdleConnections() { if ci, ok := rt.rt.(closeIdler); ok { ci.CloseIdleConnections() } diff --git a/vendor/github.com/prometheus/common/model/time.go b/vendor/github.com/prometheus/common/model/time.go index c40e6403ca8..77b82b2baa2 100644 --- a/vendor/github.com/prometheus/common/model/time.go +++ b/vendor/github.com/prometheus/common/model/time.go @@ -254,6 +254,18 @@ func (d Duration) String() string { return r } +// MarshalText implements the encoding.TextMarshaler interface. +func (d *Duration) MarshalText() ([]byte, error) { + return []byte(d.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (d *Duration) UnmarshalText(text []byte) error { + var err error + *d, err = ParseDuration(string(text)) + return err +} + // MarshalYAML implements the yaml.Marshaler interface. func (d Duration) MarshalYAML() (interface{}, error) { return d.String(), nil diff --git a/vendor/github.com/rcrowley/go-metrics/.travis.yml b/vendor/github.com/rcrowley/go-metrics/.travis.yml index 409a5b631c3..ce9afeaeeac 100644 --- a/vendor/github.com/rcrowley/go-metrics/.travis.yml +++ b/vendor/github.com/rcrowley/go-metrics/.travis.yml @@ -13,6 +13,7 @@ go: - "1.12" - "1.13" - "1.14" + - "1.15" script: - ./validate.sh diff --git a/vendor/github.com/soheilhy/cmux/.travis.yml b/vendor/github.com/soheilhy/cmux/.travis.yml index 4bc48e0669c..4d78a519feb 100644 --- a/vendor/github.com/soheilhy/cmux/.travis.yml +++ b/vendor/github.com/soheilhy/cmux/.travis.yml @@ -14,7 +14,7 @@ gobuild_args: -race before_install: - if [[ $TRAVIS_GO_VERSION == 1.6* ]]; then go get -u github.com/kisielk/errcheck; fi - - if [[ $TRAVIS_GO_VERSION == 1.6* ]]; then go get -u github.com/golang/lint/golint; fi + - if [[ $TRAVIS_GO_VERSION == 1.6* ]]; then go get -u golang.org/x/lint/golint; fi before_script: - '! gofmt -s -l . | read' diff --git a/vendor/github.com/soheilhy/cmux/README.md b/vendor/github.com/soheilhy/cmux/README.md index 70306e6ab62..c4191b70b00 100644 --- a/vendor/github.com/soheilhy/cmux/README.md +++ b/vendor/github.com/soheilhy/cmux/README.md @@ -25,7 +25,7 @@ trpcL := m.Match(cmux.Any()) // Any means anything that is not yet matched. // Create your protocol servers. grpcS := grpc.NewServer() -grpchello.RegisterGreeterServer(grpcs, &server{}) +grpchello.RegisterGreeterServer(grpcS, &server{}) httpS := &http.Server{ Handler: &helloHTTP1Handler{}, diff --git a/vendor/github.com/soheilhy/cmux/cmux.go b/vendor/github.com/soheilhy/cmux/cmux.go index 80403423d8a..5ba921e72dc 100644 --- a/vendor/github.com/soheilhy/cmux/cmux.go +++ b/vendor/github.com/soheilhy/cmux/cmux.go @@ -15,6 +15,7 @@ package cmux import ( + "errors" "fmt" "io" "net" @@ -61,6 +62,9 @@ func (e errListenerClosed) Timeout() bool { return false } // listener is closed. var ErrListenerClosed = errListenerClosed("mux: listener closed") +// ErrServerClosed is returned from muxListener.Accept when mux server is closed. +var ErrServerClosed = errors.New("mux: server closed") + // for readability of readTimeout var noTimeout time.Duration @@ -93,6 +97,8 @@ type CMux interface { // Serve starts multiplexing the listener. Serve blocks and perhaps // should be invoked concurrently within a go routine. Serve() error + // Closes cmux server and stops accepting any connections on listener + Close() // HandleError registers an error handler that handles listener errors. HandleError(ErrorHandler) // sets a timeout for the read of matchers @@ -108,9 +114,10 @@ type cMux struct { root net.Listener bufLen int errh ErrorHandler - donec chan struct{} sls []matchersListener readTimeout time.Duration + donec chan struct{} + mu sync.Mutex } func matchersToMatchWriters(matchers []Matcher) []MatchWriter { @@ -133,6 +140,7 @@ func (m *cMux) MatchWithWriters(matchers ...MatchWriter) net.Listener { ml := muxListener{ Listener: m.root, connc: make(chan net.Conn, m.bufLen), + donec: make(chan struct{}), } m.sls = append(m.sls, matchersListener{ss: matchers, l: ml}) return ml @@ -146,7 +154,7 @@ func (m *cMux) Serve() error { var wg sync.WaitGroup defer func() { - close(m.donec) + m.closeDoneChans() wg.Wait() for _, sl := range m.sls { @@ -204,6 +212,30 @@ func (m *cMux) serve(c net.Conn, donec <-chan struct{}, wg *sync.WaitGroup) { } } +func (m *cMux) Close() { + m.closeDoneChans() +} + +func (m *cMux) closeDoneChans() { + m.mu.Lock() + defer m.mu.Unlock() + + select { + case <-m.donec: + // Already closed. Don't close again + default: + close(m.donec) + } + for _, sl := range m.sls { + select { + case <-sl.l.donec: + // Already closed. Don't close again + default: + close(sl.l.donec) + } + } +} + func (m *cMux) HandleError(h ErrorHandler) { m.errh = h } @@ -223,14 +255,19 @@ func (m *cMux) handleErr(err error) bool { type muxListener struct { net.Listener connc chan net.Conn + donec chan struct{} } func (l muxListener) Accept() (net.Conn, error) { - c, ok := <-l.connc - if !ok { - return nil, ErrListenerClosed + select { + case c, ok := <-l.connc: + if !ok { + return nil, ErrListenerClosed + } + return c, nil + case <-l.donec: + return nil, ErrServerClosed } - return c, nil } // MuxConn wraps a net.Conn and provides transparent sniffing of connection data. diff --git a/vendor/github.com/soheilhy/cmux/go.mod b/vendor/github.com/soheilhy/cmux/go.mod new file mode 100644 index 00000000000..2be915f121b --- /dev/null +++ b/vendor/github.com/soheilhy/cmux/go.mod @@ -0,0 +1,5 @@ +module github.com/soheilhy/cmux + +go 1.11 + +require golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb diff --git a/vendor/github.com/soheilhy/cmux/go.sum b/vendor/github.com/soheilhy/cmux/go.sum new file mode 100644 index 00000000000..bfa16760945 --- /dev/null +++ b/vendor/github.com/soheilhy/cmux/go.sum @@ -0,0 +1,12 @@ +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/spf13/cobra/.golangci.yml b/vendor/github.com/spf13/cobra/.golangci.yml new file mode 100644 index 00000000000..0d6e61793a7 --- /dev/null +++ b/vendor/github.com/spf13/cobra/.golangci.yml @@ -0,0 +1,48 @@ +run: + deadline: 5m + +linters: + disable-all: true + enable: + #- bodyclose + - deadcode + #- depguard + #- dogsled + #- dupl + - errcheck + #- exhaustive + #- funlen + - gas + #- gochecknoinits + - goconst + #- gocritic + #- gocyclo + #- gofmt + - goimports + - golint + #- gomnd + #- goprintffuncname + #- gosec + #- gosimple + - govet + - ineffassign + - interfacer + #- lll + - maligned + - megacheck + #- misspell + #- nakedret + #- noctx + #- nolintlint + #- rowserrcheck + #- scopelint + #- staticcheck + - structcheck + #- stylecheck + #- typecheck + - unconvert + #- unparam + #- unused + - varcheck + #- whitespace + fast: false diff --git a/vendor/github.com/spf13/cobra/.travis.yml b/vendor/github.com/spf13/cobra/.travis.yml index a9bd4e54785..e0a3b50043b 100644 --- a/vendor/github.com/spf13/cobra/.travis.yml +++ b/vendor/github.com/spf13/cobra/.travis.yml @@ -1,7 +1,6 @@ language: go stages: - - diff - test - build @@ -10,20 +9,20 @@ go: - 1.13.x - tip +env: GO111MODULE=on + before_install: - go get -u github.com/kyoh86/richgo - go get -u github.com/mitchellh/gox + - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest matrix: allow_failures: - go: tip include: - - stage: diff - go: 1.13.x - script: make fmt - stage: build go: 1.13.x script: make cobra_generator -script: +script: - make test diff --git a/vendor/github.com/spf13/cobra/CHANGELOG.md b/vendor/github.com/spf13/cobra/CHANGELOG.md index 742d6d6e24a..8a23b4f8513 100644 --- a/vendor/github.com/spf13/cobra/CHANGELOG.md +++ b/vendor/github.com/spf13/cobra/CHANGELOG.md @@ -1,11 +1,40 @@ # Cobra Changelog -## Pending -* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` @jpmcb +## v1.1.3 + +* **Fix:** release-branch.cobra1.1 only: Revert "Deprecate Go < 1.14" to maintain backward compatibility + +## v1.1.2 + +### Notable Changes + +* Bump license year to 2021 in golden files (#1309) @Bowbaq +* Enhance PowerShell completion with custom comp (#1208) @Luap99 +* Update gopkg.in/yaml.v2 to v2.4.0: The previous breaking change in yaml.v2 v2.3.0 has been reverted, see go-yaml/yaml#670 +* Documentation readability improvements (#1228 etc.) @zaataylor etc. +* Use golangci-lint: Repair warnings and errors resulting from linting (#1044) @umarcor + +## v1.1.1 + +* **Fix:** yaml.v2 2.3.0 contained a unintended breaking change. This release reverts to yaml.v2 v2.2.8 which has recent critical CVE fixes, but does not have the breaking changes. See https://github.com/spf13/cobra/pull/1259 for context. +* **Fix:** correct internal formatting for go-md2man v2 (which caused man page generation to be broken). See https://github.com/spf13/cobra/issues/1049 for context. + +## v1.1.0 + +### Notable Changes + +* Extend Go completions and revamp zsh comp (#1070) +* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` (#1104) @jpmcb +* Add completion for help command (#1136) +* Complete subcommands when TraverseChildren is set (#1171) +* Fix stderr printing functions (#894) +* fix: fish output redirection (#1247) ## v1.0.0 + Announcing v1.0.0 of Cobra. 🎉 -**Notable Changes** + +### Notable Changes * Fish completion (including support for Go custom completion) @marckhouzam * API (urgent): Rename BashCompDirectives to ShellCompDirectives @marckhouzam * Remove/replace SetOutput on Command - deprecated @jpmcb diff --git a/vendor/github.com/spf13/cobra/CONDUCT.md b/vendor/github.com/spf13/cobra/CONDUCT.md new file mode 100644 index 00000000000..9d16f88fd12 --- /dev/null +++ b/vendor/github.com/spf13/cobra/CONDUCT.md @@ -0,0 +1,37 @@ +## Cobra User Contract + +### Versioning +Cobra will follow a steady release cadence. Non breaking changes will be released as minor versions quarterly. Patch bug releases are at the discretion of the maintainers. Users can expect security patch fixes to be released within relatively short order of a CVE becoming known. For more information on security patch fixes see the CVE section below. Releases will follow [Semantic Versioning](https://semver.org/). Users tracking the Master branch should expect unpredictable breaking changes as the project continues to move forward. For stability, it is highly recommended to use a release. + +### Backward Compatibility +We will maintain two major releases in a moving window. The N-1 release will only receive bug fixes and security updates and will be dropped once N+1 is released. + +### Deprecation +Deprecation of Go versions or dependent packages will only occur in major releases. To reduce the change of this taking users by surprise, any large deprecation will be preceded by an announcement in the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) and an Issue on Github. + +### CVE +Maintainers will make every effort to release security patches in the case of a medium to high severity CVE directly impacting the library. The speed in which these patches reach a release is up to the discretion of the maintainers. A low severity CVE may be a lower priority than a high severity one. + +### Communication +Cobra maintainers will use GitHub issues and the [#cobra slack channel](https://gophers.slack.com/archives/CD3LP1199) as the primary means of communication with the community. This is to foster open communication with all users and contributors. + +### Breaking Changes +Breaking changes are generally allowed in the master branch, as this is the branch used to develop the next release of Cobra. + +There may be times, however, when master is closed for breaking changes. This is likely to happen as we near the release of a new version. + +Breaking changes are not allowed in release branches, as these represent minor versions that have already been released. These version have consumers who expect the APIs, behaviors, etc, to remain stable during the lifetime of the patch stream for the minor release. + +Examples of breaking changes include: +- Removing or renaming exported constant, variable, type, or function. +- Updating the version of critical libraries such as `spf13/pflag`, `spf13/viper` etc... + - Some version updates may be acceptable for picking up bug fixes, but maintainers must exercise caution when reviewing. + +There may, at times, need to be exceptions where breaking changes are allowed in release branches. These are at the discretion of the project's maintainers, and must be carefully considered before merging. + +### CI Testing +Maintainers will ensure the Cobra test suite utilizes the current supported versions of Golang. + +### Disclaimer +Changes to this document and the contents therein are at the discretion of the maintainers. +None of the contents of this document are legally binding in any way to the maintainers or the users. diff --git a/vendor/github.com/spf13/cobra/Makefile b/vendor/github.com/spf13/cobra/Makefile index e9740d1e175..472c73bf16f 100644 --- a/vendor/github.com/spf13/cobra/Makefile +++ b/vendor/github.com/spf13/cobra/Makefile @@ -1,21 +1,29 @@ BIN="./bin" SRC=$(shell find . -name "*.go") +ifeq (, $(shell which golangci-lint)) +$(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") +endif + ifeq (, $(shell which richgo)) $(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo") endif -.PHONY: fmt vet test cobra_generator install_deps clean +.PHONY: fmt lint test cobra_generator install_deps clean default: all -all: fmt vet test cobra_generator +all: fmt test cobra_generator fmt: $(info ******************** checking formatting ********************) @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) -test: install_deps vet +lint: + $(info ******************** running lint tools ********************) + golangci-lint run -v + +test: install_deps lint $(info ******************** running tests ********************) richgo test -v ./... @@ -28,9 +36,5 @@ install_deps: $(info ******************** downloading dependencies ********************) go get -v ./... -vet: - $(info ******************** vetting ********************) - go vet ./... - clean: rm -rf $(BIN) diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md index 3cf1b25d8e7..a1b13ddda6c 100644 --- a/vendor/github.com/spf13/cobra/README.md +++ b/vendor/github.com/spf13/cobra/README.md @@ -6,6 +6,7 @@ Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/), [Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. +[![](https://img.shields.io/github/workflow/status/spf13/cobra/Test?longCache=tru&label=Test&logo=github%20actions&logoColor=fff)](https://github.com/spf13/cobra/actions?query=workflow%3ATest) [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) @@ -62,8 +63,8 @@ Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. -The best applications will read like sentences when used. Users will know how -to use the application because they will natively understand how to use it. +The best applications read like sentences when used, and as a result, users +intuitively know how to interact with them. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE.` @@ -234,11 +235,6 @@ func init() { rootCmd.AddCommand(initCmd) } -func er(msg interface{}) { - fmt.Println("Error:", msg) - os.Exit(1) -} - func initConfig() { if cfgFile != "" { // Use config file from the flag. @@ -246,9 +242,7 @@ func initConfig() { } else { // Find home directory. home, err := homedir.Dir() - if err != nil { - er(err) - } + cobra.CheckErr(err) // Search config in home directory with name ".cobra" (without extension). viper.AddConfigPath(home) @@ -268,7 +262,7 @@ func initConfig() { With the root command you need to have your main function execute it. Execute should be run on the root for clarity, though it can be called on any command. -In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. +In a Cobra app, typically the main.go file is very bare. It serves one purpose: to initialize Cobra. ```go package main @@ -363,7 +357,7 @@ There are two different approaches to assign a flag. ### Persistent Flags -A flag can be 'persistent' meaning that this flag will be available to the +A flag can be 'persistent', meaning that this flag will be available to the command it's assigned to as well as every command under that command. For global flags, assign a flag as a persistent flag on the root. @@ -373,7 +367,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out ### Local Flags -A flag can also be assigned locally which will only apply to that specific command. +A flag can also be assigned locally, which will only apply to that specific command. ```go localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") @@ -381,8 +375,8 @@ localCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to rea ### Local Flag on Parent Commands -By default Cobra only parses local flags on the target command, any local flags on -parent commands are ignored. By enabling `Command.TraverseChildren` Cobra will +By default, Cobra only parses local flags on the target command, and any local flags on +parent commands are ignored. By enabling `Command.TraverseChildren`, Cobra will parse local flags on each command before executing the target command. ```go @@ -404,8 +398,8 @@ func init() { } ``` -In this example the persistent flag `author` is bound with `viper`. -**Note**, that the variable `author` will not be set to the value from config, +In this example, the persistent flag `author` is bound with `viper`. +**Note**: the variable `author` will not be set to the value from config, when the `--author` flag is not provided by user. More in [viper documentation](https://github.com/spf13/viper#working-with-flags). @@ -465,7 +459,7 @@ var cmd = &cobra.Command{ In the example below, we have defined three commands. Two are at the top level and one (cmdTimes) is a child of one of the top commands. In this case the root -is not executable meaning that a subcommand is required. This is accomplished +is not executable, meaning that a subcommand is required. This is accomplished by not providing a 'Run' for the 'rootCmd'. We have only defined one flag for a single command. @@ -759,7 +753,7 @@ Cobra can generate documentation based on subcommands, flags, etc. Read more abo ## Generating shell completions -Cobra can generate a shell-completion file for the following shells: Bash, Zsh, Fish, Powershell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). +Cobra can generate a shell-completion file for the following shells: bash, zsh, fish, PowerShell. If you add more information to your commands, these completions can be amazingly powerful and flexible. Read more about it in [Shell Completions](shell_completions.md). # License diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go index 846636d75b1..7106147937e 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.go +++ b/vendor/github.com/spf13/cobra/bash_completions.go @@ -19,9 +19,9 @@ const ( BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) -func writePreamble(buf *bytes.Buffer, name string) { - buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` +func writePreamble(buf io.StringWriter, name string) { + WriteStringAndCheck(buf, fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` __%[1]s_debug() { if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then @@ -380,10 +380,10 @@ __%[1]s_handle_word() ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) } -func writePostscript(buf *bytes.Buffer, name string) { +func writePostscript(buf io.StringWriter, name string) { name = strings.Replace(name, ":", "__", -1) - buf.WriteString(fmt.Sprintf("__start_%s()\n", name)) - buf.WriteString(fmt.Sprintf(`{ + WriteStringAndCheck(buf, fmt.Sprintf("__start_%s()\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(`{ local cur prev words cword declare -A flaghash 2>/dev/null || : declare -A aliashash 2>/dev/null || : @@ -410,33 +410,33 @@ func writePostscript(buf *bytes.Buffer, name string) { } `, name)) - buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then + WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name)) - buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n") + WriteStringAndCheck(buf, "# ex: ts=4 sw=4 et filetype=sh\n") } -func writeCommands(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" commands=()\n") +func writeCommands(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " commands=()\n") for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue } - buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" commands+=(%q)\n", c.Name())) writeCmdAliases(buf, c) } - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) { +func writeFlagHandler(buf io.StringWriter, name string, annotations map[string][]string, cmd *Command) { for key, value := range annotations { switch key { case BashCompFilenameExt: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) > 0 { @@ -444,17 +444,18 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) case BashCompCustom: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + if len(value) > 0 { handlers := strings.Join(value, "; ") - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", handlers)) } else { - buf.WriteString(" flags_completion+=(:)\n") + WriteStringAndCheck(buf, " flags_completion+=(:)\n") } case BashCompSubdirsInDir: - buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_with_completion+=(%q)\n", name)) var ext string if len(value) == 1 { @@ -462,46 +463,48 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s } else { ext = "_filedir -d" } - buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext)) + WriteStringAndCheck(buf, fmt.Sprintf(" flags_completion+=(%q)\n", ext)) } } } -func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +const cbn = "\")\n" + +func writeShortFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Shorthand format := " " if len(flag.NoOptDefVal) == 0 { format += "two_word_" } - format += "flags+=(\"-%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += "flags+=(\"-%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd) } -func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) { +func writeFlag(buf io.StringWriter, flag *pflag.Flag, cmd *Command) { name := flag.Name format := " flags+=(\"--%s" if len(flag.NoOptDefVal) == 0 { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.NoOptDefVal) == 0 { - format = " two_word_flags+=(\"--%s\")\n" - buf.WriteString(fmt.Sprintf(format, name)) + format = " two_word_flags+=(\"--%s" + cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) } writeFlagHandler(buf, "--"+name, flag.Annotations, cmd) } -func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { +func writeLocalNonPersistentFlag(buf io.StringWriter, flag *pflag.Flag) { name := flag.Name - format := " local_nonpersistent_flags+=(\"--%[1]s\")\n" + format := " local_nonpersistent_flags+=(\"--%[1]s" + cbn if len(flag.NoOptDefVal) == 0 { - format += " local_nonpersistent_flags+=(\"--%[1]s=\")\n" + format += " local_nonpersistent_flags+=(\"--%[1]s=" + cbn } - buf.WriteString(fmt.Sprintf(format, name)) + WriteStringAndCheck(buf, fmt.Sprintf(format, name)) if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) + WriteStringAndCheck(buf, fmt.Sprintf(" local_nonpersistent_flags+=(\"-%s\")\n", flag.Shorthand)) } } @@ -519,9 +522,9 @@ func prepareCustomAnnotationsForFlags(cmd *Command) { } } -func writeFlags(buf *bytes.Buffer, cmd *Command) { +func writeFlags(buf io.StringWriter, cmd *Command) { prepareCustomAnnotationsForFlags(cmd) - buf.WriteString(` flags=() + WriteStringAndCheck(buf, ` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() @@ -553,11 +556,11 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) { } }) - buf.WriteString("\n") + WriteStringAndCheck(buf, "\n") } -func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_flag=()\n") +func writeRequiredFlag(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_flag=()\n") flags := cmd.NonInheritedFlags() flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { @@ -570,55 +573,55 @@ func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) { if flag.Value.Type() != "bool" { format += "=" } - format += "\")\n" - buf.WriteString(fmt.Sprintf(format, flag.Name)) + format += cbn + WriteStringAndCheck(buf, fmt.Sprintf(format, flag.Name)) if len(flag.Shorthand) > 0 { - buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_flag+=(\"-%s"+cbn, flag.Shorthand)) } } } }) } -func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" must_have_one_noun=()\n") - sort.Sort(sort.StringSlice(cmd.ValidArgs)) +func writeRequiredNouns(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " must_have_one_noun=()\n") + sort.Strings(cmd.ValidArgs) for _, value := range cmd.ValidArgs { // Remove any description that may be included following a tab character. // Descriptions are not supported by bash completion. value = strings.Split(value, "\t")[0] - buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" must_have_one_noun+=(%q)\n", value)) } if cmd.ValidArgsFunction != nil { - buf.WriteString(" has_completion_function=1\n") + WriteStringAndCheck(buf, " has_completion_function=1\n") } } -func writeCmdAliases(buf *bytes.Buffer, cmd *Command) { +func writeCmdAliases(buf io.StringWriter, cmd *Command) { if len(cmd.Aliases) == 0 { return } - sort.Sort(sort.StringSlice(cmd.Aliases)) + sort.Strings(cmd.Aliases) - buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) + WriteStringAndCheck(buf, fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n")) for _, value := range cmd.Aliases { - buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value)) - buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) + WriteStringAndCheck(buf, fmt.Sprintf(" command_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name())) } - buf.WriteString(` fi`) - buf.WriteString("\n") + WriteStringAndCheck(buf, ` fi`) + WriteStringAndCheck(buf, "\n") } -func writeArgAliases(buf *bytes.Buffer, cmd *Command) { - buf.WriteString(" noun_aliases=()\n") - sort.Sort(sort.StringSlice(cmd.ArgAliases)) +func writeArgAliases(buf io.StringWriter, cmd *Command) { + WriteStringAndCheck(buf, " noun_aliases=()\n") + sort.Strings(cmd.ArgAliases) for _, value := range cmd.ArgAliases { - buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value)) + WriteStringAndCheck(buf, fmt.Sprintf(" noun_aliases+=(%q)\n", value)) } } -func gen(buf *bytes.Buffer, cmd *Command) { +func gen(buf io.StringWriter, cmd *Command) { for _, c := range cmd.Commands() { if !c.IsAvailableCommand() && c != cmd.helpCommand { continue @@ -630,22 +633,22 @@ func gen(buf *bytes.Buffer, cmd *Command) { commandName = strings.Replace(commandName, ":", "__", -1) if cmd.Root() == cmd { - buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s_root_command()\n{\n", commandName)) } else { - buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName)) + WriteStringAndCheck(buf, fmt.Sprintf("_%s()\n{\n", commandName)) } - buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName)) - buf.WriteString("\n") - buf.WriteString(" command_aliases=()\n") - buf.WriteString("\n") + WriteStringAndCheck(buf, fmt.Sprintf(" last_command=%q\n", commandName)) + WriteStringAndCheck(buf, "\n") + WriteStringAndCheck(buf, " command_aliases=()\n") + WriteStringAndCheck(buf, "\n") writeCommands(buf, cmd) writeFlags(buf, cmd) writeRequiredFlag(buf, cmd) writeRequiredNouns(buf, cmd) writeArgAliases(buf, cmd) - buf.WriteString("}\n\n") + WriteStringAndCheck(buf, "}\n\n") } // GenBashCompletion generates bash completion file and writes to the passed writer. diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md index a82d5bb8b42..130f99b9230 100644 --- a/vendor/github.com/spf13/cobra/bash_completions.md +++ b/vendor/github.com/spf13/cobra/bash_completions.md @@ -4,7 +4,7 @@ Please refer to [Shell Completions](shell_completions.md) for details. ## Bash legacy dynamic completions -For backwards-compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. +For backward compatibility, Cobra still supports its legacy dynamic completion solution (described below). Unlike the `ValidArgsFunction` solution, the legacy solution will only work for Bash shell-completion and not for other shells. This legacy solution can be used along-side `ValidArgsFunction` and `RegisterFlagCompletionFunc()`, as long as both solutions are not used for the same command. This provides a path to gradually migrate from the legacy solution to the new solution. The legacy solution allows you to inject bash functions into the bash completion script. Those bash functions are responsible for providing the completion choices for your own completions. diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go index d01becc8fa6..d6cbfd71985 100644 --- a/vendor/github.com/spf13/cobra/cobra.go +++ b/vendor/github.com/spf13/cobra/cobra.go @@ -19,6 +19,7 @@ package cobra import ( "fmt" "io" + "os" "reflect" "strconv" "strings" @@ -205,3 +206,17 @@ func stringInSlice(a string, list []string) bool { } return false } + +// CheckErr prints the msg with the prefix 'Error:' and exits with error code 1. If the msg is nil, it does nothing. +func CheckErr(msg interface{}) { + if msg != nil { + fmt.Fprintln(os.Stderr, "Error:", msg) + os.Exit(1) + } +} + +// WriteStringAndCheck writes a string into a buffer, and checks if the error is not nil. +func WriteStringAndCheck(b io.StringWriter, s string) { + _, err := b.WriteString(s) + CheckErr(err) +} diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go index 77b399e02ee..d6732ad1154 100644 --- a/vendor/github.com/spf13/cobra/command.go +++ b/vendor/github.com/spf13/cobra/command.go @@ -84,9 +84,6 @@ type Command struct { // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string - // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. - Hidden bool - // Annotations are key/value pairs that can be used by applications to identify or // group commands. Annotations map[string]string @@ -126,55 +123,6 @@ type Command struct { // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error - // SilenceErrors is an option to quiet errors down stream. - SilenceErrors bool - - // SilenceUsage is an option to silence usage when an error occurs. - SilenceUsage bool - - // DisableFlagParsing disables the flag parsing. - // If this is true all flags will be passed to the command as arguments. - DisableFlagParsing bool - - // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") - // will be printed by generating docs for this command. - DisableAutoGenTag bool - - // DisableFlagsInUseLine will disable the addition of [flags] to the usage - // line of a command when printing help or generating docs - DisableFlagsInUseLine bool - - // DisableSuggestions disables the suggestions based on Levenshtein distance - // that go along with 'unknown command' messages. - DisableSuggestions bool - // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. - // Must be > 0. - SuggestionsMinimumDistance int - - // TraverseChildren parses flags on all parents before executing child command. - TraverseChildren bool - - // FParseErrWhitelist flag parse errors to be ignored - FParseErrWhitelist FParseErrWhitelist - - ctx context.Context - - // commands is the list of commands supported by this program. - commands []*Command - // parent is a parent command for this command. - parent *Command - // Max lengths of commands' string lengths for use in padding. - commandsMaxUseLen int - commandsMaxCommandPathLen int - commandsMaxNameLen int - // commandsAreSorted defines, if command slice are sorted or not. - commandsAreSorted bool - // commandCalledAs is the name or alias value used to call this command. - commandCalledAs struct { - name string - called bool - } - // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. @@ -216,6 +164,60 @@ type Command struct { outWriter io.Writer // errWriter is a writer defined by the user that replaces stderr errWriter io.Writer + + //FParseErrWhitelist flag parse errors to be ignored + FParseErrWhitelist FParseErrWhitelist + + // commandsAreSorted defines, if command slice are sorted or not. + commandsAreSorted bool + // commandCalledAs is the name or alias value used to call this command. + commandCalledAs struct { + name string + called bool + } + + ctx context.Context + + // commands is the list of commands supported by this program. + commands []*Command + // parent is a parent command for this command. + parent *Command + // Max lengths of commands' string lengths for use in padding. + commandsMaxUseLen int + commandsMaxCommandPathLen int + commandsMaxNameLen int + + // TraverseChildren parses flags on all parents before executing child command. + TraverseChildren bool + + // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. + Hidden bool + + // SilenceErrors is an option to quiet errors down stream. + SilenceErrors bool + + // SilenceUsage is an option to silence usage when an error occurs. + SilenceUsage bool + + // DisableFlagParsing disables the flag parsing. + // If this is true all flags will be passed to the command as arguments. + DisableFlagParsing bool + + // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") + // will be printed by generating docs for this command. + DisableAutoGenTag bool + + // DisableFlagsInUseLine will disable the addition of [flags] to the usage + // line of a command when printing help or generating docs + DisableFlagsInUseLine bool + + // DisableSuggestions disables the suggestions based on Levenshtein distance + // that go along with 'unknown command' messages. + DisableSuggestions bool + + // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. + // Must be > 0. + SuggestionsMinimumDistance int } // Context returns underlying command context. If command wasn't @@ -418,7 +420,7 @@ func (c *Command) UsageString() string { c.outWriter = bb c.errWriter = bb - c.Usage() + CheckErr(c.Usage()) // Setting things back to normal c.outWriter = tmpOutput @@ -964,13 +966,13 @@ func (c *Command) ExecuteC() (cmd *Command, err error) { return cmd, nil } - // If root command has SilentErrors flagged, + // If root command has SilenceErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { c.PrintErrln("Error:", err.Error()) } - // If root command has SilentUsage flagged, + // If root command has SilenceUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) @@ -1087,10 +1089,10 @@ Simply type ` + c.Name() + ` help [path to command] for full details.`, cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) - c.Root().Usage() + CheckErr(c.Root().Usage()) } else { cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown - cmd.Help() + CheckErr(cmd.Help()) } }, } diff --git a/vendor/github.com/spf13/cobra/custom_completions.go b/vendor/github.com/spf13/cobra/custom_completions.go index f9e88e081fc..fa060c147be 100644 --- a/vendor/github.com/spf13/cobra/custom_completions.go +++ b/vendor/github.com/spf13/cobra/custom_completions.go @@ -527,13 +527,13 @@ func CompDebug(msg string, printToStdErr bool) { os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err == nil { defer f.Close() - f.WriteString(msg) + WriteStringAndCheck(f, msg) } } if printToStdErr { // Must print to stderr for this not to be read by the completion script. - fmt.Fprintf(os.Stderr, msg) + fmt.Fprint(os.Stderr, msg) } } diff --git a/vendor/github.com/spf13/cobra/fish_completions.go b/vendor/github.com/spf13/cobra/fish_completions.go index eaae9bca866..3e112347d7b 100644 --- a/vendor/github.com/spf13/cobra/fish_completions.go +++ b/vendor/github.com/spf13/cobra/fish_completions.go @@ -8,7 +8,7 @@ import ( "strings" ) -func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { +func genFishComp(buf io.StringWriter, name string, includeDesc bool) { // Variables should not contain a '-' or ':' character nameForVar := name nameForVar = strings.Replace(nameForVar, "-", "_", -1) @@ -18,8 +18,8 @@ func genFishComp(buf *bytes.Buffer, name string, includeDesc bool) { if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - buf.WriteString(fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) - buf.WriteString(fmt.Sprintf(` + WriteStringAndCheck(buf, fmt.Sprintf("# fish completion for %-36s -*- shell-script -*-\n", name)) + WriteStringAndCheck(buf, fmt.Sprintf(` function __%[1]s_debug set file "$BASH_COMP_DEBUG_FILE" if test -n "$file" diff --git a/vendor/github.com/spf13/cobra/go.mod b/vendor/github.com/spf13/cobra/go.mod index 57e3244d5e3..ff56144056a 100644 --- a/vendor/github.com/spf13/cobra/go.mod +++ b/vendor/github.com/spf13/cobra/go.mod @@ -8,5 +8,5 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.0 - gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v2 v2.4.0 ) diff --git a/vendor/github.com/spf13/cobra/go.sum b/vendor/github.com/spf13/cobra/go.sum index 0aae738631c..9328ee3ee7c 100644 --- a/vendor/github.com/spf13/cobra/go.sum +++ b/vendor/github.com/spf13/cobra/go.sum @@ -304,8 +304,8 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/spf13/cobra/powershell_completions.go b/vendor/github.com/spf13/cobra/powershell_completions.go index 756c61b9dcb..c55be71cd14 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.go +++ b/vendor/github.com/spf13/cobra/powershell_completions.go @@ -1,6 +1,3 @@ -// PowerShell completions are based on the amazing work from clap: -// https://github.com/clap-rs/clap/blob/3294d18efe5f264d12c9035f404c7d189d4824e1/src/completions/powershell.rs -// // The generated scripts require PowerShell v5.0+ (which comes Windows 10, but // can be downloaded separately for windows 7 or 8.1). @@ -11,90 +8,278 @@ import ( "fmt" "io" "os" - "strings" - - "github.com/spf13/pflag" ) -var powerShellCompletionTemplate = `using namespace System.Management.Automation -using namespace System.Management.Automation.Language -Register-ArgumentCompleter -Native -CommandName '%s' -ScriptBlock { - param($wordToComplete, $commandAst, $cursorPosition) - $commandElements = $commandAst.CommandElements - $command = @( - '%s' - for ($i = 1; $i -lt $commandElements.Count; $i++) { - $element = $commandElements[$i] - if ($element -isnot [StringConstantExpressionAst] -or - $element.StringConstantType -ne [StringConstantType]::BareWord -or - $element.Value.StartsWith('-')) { - break - } - $element.Value - } - ) -join ';' - $completions = @(switch ($command) {%s - }) - $completions.Where{ $_.CompletionText -like "$wordToComplete*" } | - Sort-Object -Property ListItemText -}` - -func generatePowerShellSubcommandCases(out io.Writer, cmd *Command, previousCommandName string) { - var cmdName string - if previousCommandName == "" { - cmdName = cmd.Name() - } else { - cmdName = fmt.Sprintf("%s;%s", previousCommandName, cmd.Name()) - } - - fmt.Fprintf(out, "\n '%s' {", cmdName) - - cmd.Flags().VisitAll(func(flag *pflag.Flag) { - if nonCompletableFlag(flag) { - return - } - usage := escapeStringForPowerShell(flag.Usage) - if len(flag.Shorthand) > 0 { - fmt.Fprintf(out, "\n [CompletionResult]::new('-%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Shorthand, flag.Shorthand, usage) - } - fmt.Fprintf(out, "\n [CompletionResult]::new('--%s', '%s', [CompletionResultType]::ParameterName, '%s')", flag.Name, flag.Name, usage) - }) - - for _, subCmd := range cmd.Commands() { - usage := escapeStringForPowerShell(subCmd.Short) - fmt.Fprintf(out, "\n [CompletionResult]::new('%s', '%s', [CompletionResultType]::ParameterValue, '%s')", subCmd.Name(), subCmd.Name(), usage) +func genPowerShellComp(buf io.StringWriter, name string, includeDesc bool) { + compCmd := ShellCompRequestCmd + if !includeDesc { + compCmd = ShellCompNoDescRequestCmd } + WriteStringAndCheck(buf, fmt.Sprintf(`# powershell completion for %-36[1]s -*- shell-script -*- - fmt.Fprint(out, "\n break\n }") - - for _, subCmd := range cmd.Commands() { - generatePowerShellSubcommandCases(out, subCmd, cmdName) - } +function __%[1]s_debug { + if ($env:BASH_COMP_DEBUG_FILE) { + "$args" | Out-File -Append -FilePath "$env:BASH_COMP_DEBUG_FILE" + } } -func escapeStringForPowerShell(s string) string { - return strings.Replace(s, "'", "''", -1) +filter __%[1]s_escapeStringWithSpecialChars { +`+" $_ -replace '\\s|#|@|\\$|;|,|''|\\{|\\}|\\(|\\)|\"|`|\\||<|>|&','`$&'"+` } -// GenPowerShellCompletion generates PowerShell completion file and writes to the passed writer. -func (c *Command) GenPowerShellCompletion(w io.Writer) error { - buf := new(bytes.Buffer) +Register-ArgumentCompleter -CommandName '%[1]s' -ScriptBlock { + param( + $WordToComplete, + $CommandAst, + $CursorPosition + ) + + # Get the current command line and convert into a string + $Command = $CommandAst.CommandElements + $Command = "$Command" + + __%[1]s_debug "" + __%[1]s_debug "========= starting completion logic ==========" + __%[1]s_debug "WordToComplete: $WordToComplete Command: $Command CursorPosition: $CursorPosition" + + # The user could have moved the cursor backwards on the command-line. + # We need to trigger completion from the $CursorPosition location, so we need + # to truncate the command-line ($Command) up to the $CursorPosition location. + # Make sure the $Command is longer then the $CursorPosition before we truncate. + # This happens because the $Command does not include the last space. + if ($Command.Length -gt $CursorPosition) { + $Command=$Command.Substring(0,$CursorPosition) + } + __%[1]s_debug "Truncated command: $Command" + + $ShellCompDirectiveError=%[3]d + $ShellCompDirectiveNoSpace=%[4]d + $ShellCompDirectiveNoFileComp=%[5]d + $ShellCompDirectiveFilterFileExt=%[6]d + $ShellCompDirectiveFilterDirs=%[7]d + + # Prepare the command to request completions for the program. + # Split the command at the first space to separate the program and arguments. + $Program,$Arguments = $Command.Split(" ",2) + $RequestComp="$Program %[2]s $Arguments" + __%[1]s_debug "RequestComp: $RequestComp" + + # we cannot use $WordToComplete because it + # has the wrong values if the cursor was moved + # so use the last argument + if ($WordToComplete -ne "" ) { + $WordToComplete = $Arguments.Split(" ")[-1] + } + __%[1]s_debug "New WordToComplete: $WordToComplete" + + + # Check for flag with equal sign + $IsEqualFlag = ($WordToComplete -Like "--*=*" ) + if ( $IsEqualFlag ) { + __%[1]s_debug "Completing equal sign flag" + # Remove the flag part + $Flag,$WordToComplete = $WordToComplete.Split("=",2) + } + + if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) { + # If the last parameter is complete (there is a space following it) + # We add an extra empty parameter so we can indicate this to the go method. + __%[1]s_debug "Adding extra empty parameter" +`+" # We need to use `\"`\" to pass an empty argument a \"\" or '' does not work!!!"+` +`+" $RequestComp=\"$RequestComp\" + ' `\"`\"' "+` + } + + __%[1]s_debug "Calling $RequestComp" + #call the command store the output in $out and redirect stderr and stdout to null + # $Out is an array contains each line per element + Invoke-Expression -OutVariable out "$RequestComp" 2>&1 | Out-Null + + + # get directive from last line + [int]$Directive = $Out[-1].TrimStart(':') + if ($Directive -eq "") { + # There is no directive specified + $Directive = 0 + } + __%[1]s_debug "The completion directive is: $Directive" + + # remove directive (last element) from out + $Out = $Out | Where-Object { $_ -ne $Out[-1] } + __%[1]s_debug "The completions are: $Out" + + if (($Directive -band $ShellCompDirectiveError) -ne 0 ) { + # Error code. No completion. + __%[1]s_debug "Received error from custom completion go code" + return + } + + $Longest = 0 + $Values = $Out | ForEach-Object { + #Split the output in name and description +`+" $Name, $Description = $_.Split(\"`t\",2)"+` + __%[1]s_debug "Name: $Name Description: $Description" + + # Look for the longest completion so that we can format things nicely + if ($Longest -lt $Name.Length) { + $Longest = $Name.Length + } + + # Set the description to a one space string if there is none set. + # This is needed because the CompletionResult does not accept an empty string as argument + if (-Not $Description) { + $Description = " " + } + @{Name="$Name";Description="$Description"} + } + + + $Space = " " + if (($Directive -band $ShellCompDirectiveNoSpace) -ne 0 ) { + # remove the space here + __%[1]s_debug "ShellCompDirectiveNoSpace is called" + $Space = "" + } + + if (($Directive -band $ShellCompDirectiveNoFileComp) -ne 0 ) { + __%[1]s_debug "ShellCompDirectiveNoFileComp is called" + + if ($Values.Length -eq 0) { + # Just print an empty string here so the + # shell does not start to complete paths. + # We cannot use CompletionResult here because + # it does not accept an empty string as argument. + "" + return + } + } + + if ((($Directive -band $ShellCompDirectiveFilterFileExt) -ne 0 ) -or + (($Directive -band $ShellCompDirectiveFilterDirs) -ne 0 )) { + __%[1]s_debug "ShellCompDirectiveFilterFileExt ShellCompDirectiveFilterDirs are not supported" + + # return here to prevent the completion of the extensions + return + } - var subCommandCases bytes.Buffer - generatePowerShellSubcommandCases(&subCommandCases, c, "") - fmt.Fprintf(buf, powerShellCompletionTemplate, c.Name(), c.Name(), subCommandCases.String()) + $Values = $Values | Where-Object { + # filter the result + $_.Name -like "$WordToComplete*" + # Join the flag back if we have a equal sign flag + if ( $IsEqualFlag ) { + __%[1]s_debug "Join the equal sign flag back to the completion value" + $_.Name = $Flag + "=" + $_.Name + } + } + + # Get the current mode + $Mode = (Get-PSReadLineKeyHandler | Where-Object {$_.Key -eq "Tab" }).Function + __%[1]s_debug "Mode: $Mode" + + $Values | ForEach-Object { + + # store temporay because switch will overwrite $_ + $comp = $_ + + # PowerShell supports three different completion modes + # - TabCompleteNext (default windows style - on each key press the next option is displayed) + # - Complete (works like bash) + # - MenuComplete (works like zsh) + # You set the mode with Set-PSReadLineKeyHandler -Key Tab -Function + + # CompletionResult Arguments: + # 1) CompletionText text to be used as the auto completion result + # 2) ListItemText text to be displayed in the suggestion list + # 3) ResultType type of completion result + # 4) ToolTip text for the tooltip with details about the object + + switch ($Mode) { + + # bash like + "Complete" { + + if ($Values.Length -eq 1) { + __%[1]s_debug "Only one completion left" + + # insert space after value + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + + } else { + # Add the proper number of spaces to align the descriptions + while($comp.Name.Length -lt $Longest) { + $comp.Name = $comp.Name + " " + } + + # Check for empty description and only add parentheses if needed + if ($($comp.Description) -eq " " ) { + $Description = "" + } else { + $Description = " ($($comp.Description))" + } + + [System.Management.Automation.CompletionResult]::new("$($comp.Name)$Description", "$($comp.Name)$Description", 'ParameterValue', "$($comp.Description)") + } + } + + # zsh like + "MenuComplete" { + # insert space after value + # MenuComplete will automatically show the ToolTip of + # the highlighted value at the bottom of the suggestions. + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars) + $Space, "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + + # TabCompleteNext and in case we get something unknown + Default { + # Like MenuComplete but we don't want to add a space here because + # the user need to press space anyway to get the completion. + # Description will not be shown because thats not possible with TabCompleteNext + [System.Management.Automation.CompletionResult]::new($($comp.Name | __%[1]s_escapeStringWithSpecialChars), "$($comp.Name)", 'ParameterValue', "$($comp.Description)") + } + } + + } +} +`, name, compCmd, + ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp, + ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs)) +} + +func (c *Command) genPowerShellCompletion(w io.Writer, includeDesc bool) error { + buf := new(bytes.Buffer) + genPowerShellComp(buf, c.Name(), includeDesc) _, err := buf.WriteTo(w) return err } -// GenPowerShellCompletionFile generates PowerShell completion file. -func (c *Command) GenPowerShellCompletionFile(filename string) error { +func (c *Command) genPowerShellCompletionFile(filename string, includeDesc bool) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() - return c.GenPowerShellCompletion(outFile) + return c.genPowerShellCompletion(outFile, includeDesc) +} + +// GenPowerShellCompletionFile generates powershell completion file without descriptions. +func (c *Command) GenPowerShellCompletionFile(filename string) error { + return c.genPowerShellCompletionFile(filename, false) +} + +// GenPowerShellCompletion generates powershell completion file without descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletion(w io.Writer) error { + return c.genPowerShellCompletion(w, false) +} + +// GenPowerShellCompletionFileWithDesc generates powershell completion file with descriptions. +func (c *Command) GenPowerShellCompletionFileWithDesc(filename string) error { + return c.genPowerShellCompletionFile(filename, true) +} + +// GenPowerShellCompletionWithDesc generates powershell completion file with descriptions +// and writes it to the passed writer. +func (c *Command) GenPowerShellCompletionWithDesc(w io.Writer) error { + return c.genPowerShellCompletion(w, true) } diff --git a/vendor/github.com/spf13/cobra/powershell_completions.md b/vendor/github.com/spf13/cobra/powershell_completions.md index 55f154a68fc..c449f1e5c0f 100644 --- a/vendor/github.com/spf13/cobra/powershell_completions.md +++ b/vendor/github.com/spf13/cobra/powershell_completions.md @@ -1,16 +1,3 @@ # Generating PowerShell Completions For Your Own cobra.Command -Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. - -*Note*: PowerShell completions have not (yet?) been aligned to Cobra's generic shell completion support. This implies the PowerShell completions are not as rich as for other shells (see [What's not yet supported](#whats-not-yet-supported)), and may behave slightly differently. They are still very useful for PowerShell users. - -# What's supported - -- Completion for subcommands using their `.Short` description -- Completion for non-hidden flags using their `.Name` and `.Shorthand` - -# What's not yet supported - -- Command aliases -- Required, filename or custom flags (they will work like normal flags) -- Custom completion scripts +Please refer to [Shell Completions](shell_completions.md#powershell-completions) for details. diff --git a/vendor/github.com/spf13/cobra/projects_using_cobra.md b/vendor/github.com/spf13/cobra/projects_using_cobra.md index 31c272036a9..d98a71e36f9 100644 --- a/vendor/github.com/spf13/cobra/projects_using_cobra.md +++ b/vendor/github.com/spf13/cobra/projects_using_cobra.md @@ -25,6 +25,8 @@ - [Moby (former Docker)](https://github.com/moby/moby) - [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) - [OpenShift](https://www.openshift.com/) +- [Ory Hydra](https://github.com/ory/hydra) +- [Ory Kratos](https://github.com/ory/kratos) - [Pouch](https://github.com/alibaba/pouch) - [ProjectAtomic (enterprise)](http://www.projectatomic.io/) - [Prototool](https://github.com/uber/prototool) @@ -32,4 +34,5 @@ - [Rclone](https://rclone.org/) - [Skaffold](https://skaffold.dev/) - [Tendermint](https://github.com/tendermint/tendermint) +- [Twitch CLI](https://github.com/twitchdev/twitch-cli) - [Werf](https://werf.io/) diff --git a/vendor/github.com/spf13/cobra/shell_completions.md b/vendor/github.com/spf13/cobra/shell_completions.md index d8416ab1dc9..cd533ac3d44 100644 --- a/vendor/github.com/spf13/cobra/shell_completions.md +++ b/vendor/github.com/spf13/cobra/shell_completions.md @@ -4,10 +4,10 @@ Cobra can generate shell completions for multiple shells. The currently supported shells are: - Bash - Zsh -- Fish +- fish - PowerShell -If you are using the generator you can create a completion command by running +If you are using the generator, you can create a completion command by running ```bash cobra add completion @@ -17,38 +17,46 @@ and then modifying the generated `cmd/completion.go` file to look something like ```go var completionCmd = &cobra.Command{ - Use: "completion [bash|zsh|fish|powershell]", - Short: "Generate completion script", + Use: "completion [bash|zsh|fish|powershell]", + Short: "Generate completion script", Long: `To load completions: Bash: -$ source <(yourprogram completion bash) + $ source <(yourprogram completion bash) -# To load completions for each session, execute once: -Linux: + # To load completions for each session, execute once: + # Linux: $ yourprogram completion bash > /etc/bash_completion.d/yourprogram -MacOS: + # macOS: $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram Zsh: -# If shell completion is not already enabled in your environment you will need -# to enable it. You can execute the following once: + # If shell completion is not already enabled in your environment, + # you will need to enable it. You can execute the following once: -$ echo "autoload -U compinit; compinit" >> ~/.zshrc + $ echo "autoload -U compinit; compinit" >> ~/.zshrc -# To load completions for each session, execute once: -$ yourprogram completion zsh > "${fpath[1]}/_yourprogram" + # To load completions for each session, execute once: + $ yourprogram completion zsh > "${fpath[1]}/_yourprogram" -# You will need to start a new shell for this setup to take effect. + # You will need to start a new shell for this setup to take effect. -Fish: +fish: -$ yourprogram completion fish | source + $ yourprogram completion fish | source -# To load completions for each session, execute once: -$ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + # To load completions for each session, execute once: + $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish + +PowerShell: + + PS> yourprogram completion powershell | Out-String | Invoke-Expression + + # To load completions for every new session, run: + PS> yourprogram completion powershell > yourprogram.ps1 + # and source this file from your PowerShell profile. `, DisableFlagsInUseLine: true, ValidArgs: []string{"bash", "zsh", "fish", "powershell"}, @@ -68,7 +76,7 @@ $ yourprogram completion fish > ~/.config/fish/completions/yourprogram.fish } ``` -**Note:** The cobra generator may include messages printed to stdout for example if the config file is loaded, this will break the auto complete script so must be removed. +**Note:** The cobra generator may include messages printed to stdout, for example, if the config file is loaded; this will break the auto-completion script so must be removed. # Customizing completions @@ -91,8 +99,7 @@ cmd := &cobra.Command{ Long: get_long, Example: get_example, Run: func(cmd *cobra.Command, args []string) { - err := RunGet(f, out, cmd, args) - util.CheckErr(err) + cobra.CheckErr(RunGet(f, out, cmd, args)) }, ValidArgs: validArgs, } @@ -124,7 +131,7 @@ the completion algorithm if entered manually, e.g. in: ```bash $ kubectl get rc [tab][tab] -backend frontend database +backend frontend database ``` Note that without declaring `rc` as an alias, the completion algorithm would not know to show the list of @@ -246,7 +253,7 @@ and you'll get something like ```bash $ kubectl exec [tab][tab] --c --container= -p --pod= +-c --container= -p --pod= ``` ### Specify dynamic flag completion @@ -316,7 +323,7 @@ cmd.RegisterFlagCompletionFunc(flagName, func(cmd *cobra.Command, args []string, ``` ### Descriptions for completions -Both `zsh` and `fish` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: +`zsh`, `fish` and `powershell` allow for descriptions to annotate completion choices. For commands and flags, Cobra will provide the descriptions automatically, based on usage information. For example, using zsh: ``` $ helm s[tab] search -- search for a keyword in charts @@ -361,12 +368,12 @@ completion firstcommand secondcommand ``` ### Bash legacy dynamic completions -For backwards-compatibility, Cobra still supports its bash legacy dynamic completion solution. +For backward compatibility, Cobra still supports its bash legacy dynamic completion solution. Please refer to [Bash Completions](bash_completions.md) for details. ## Zsh completions -Cobra supports native Zsh completion generated from the root `cobra.Command`. +Cobra supports native zsh completion generated from the root `cobra.Command`. The generated completion script should be put somewhere in your `$fpath` and be named `_`. You will need to start a new shell for the completions to become available. @@ -385,23 +392,23 @@ status -- displays the status of the named release $ helm s[tab] search show status ``` -*Note*: Because of backwards-compatibility requirements, we were forced to have a different API to disable completion descriptions between `Zsh` and `Fish`. +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. ### Limitations * Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `zsh` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). * The function `MarkFlagCustom()` is not supported and will be ignored for `zsh`. * You should instead use `RegisterFlagCompletionFunc()`. ### Zsh completions standardization -Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backwards-compatible, some small changes in behavior were introduced. +Cobra 1.1 standardized its zsh completion support to align it with its other shell completions. Although the API was kept backward-compatible, some small changes in behavior were introduced. Please refer to [Zsh Completions](zsh_completions.md) for details. -## Fish completions +## fish completions -Cobra supports native Fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. +Cobra supports native fish completions generated from the root `cobra.Command`. You can use the `command.GenFishCompletion()` or `command.GenFishCompletionFile()` functions. You must provide these functions with a parameter indicating if the completions should be annotated with a description; Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. ``` # With descriptions $ helm s[tab] @@ -411,12 +418,12 @@ search (search for a keyword in charts) show (show information of a chart) s $ helm s[tab] search show status ``` -*Note*: Because of backwards-compatibility requirements, we were forced to have a different API to disable completion descriptions between `Zsh` and `Fish`. +*Note*: Because of backward-compatibility requirements, we were forced to have a different API to disable completion descriptions between `zsh` and `fish`. ### Limitations -* Custom completions implemented in Bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). - * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`). +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `fish` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). * The function `MarkFlagCustom()` is not supported and will be ignored for `fish`. * You should instead use `RegisterFlagCompletionFunc()`. * The following flag completion annotations are not supported and will be ignored for `fish`: @@ -431,4 +438,46 @@ search show status ## PowerShell completions -Please refer to [PowerShell Completions](powershell_completions.md) for details. +Cobra supports native PowerShell completions generated from the root `cobra.Command`. You can use the `command.GenPowerShellCompletion()` or `command.GenPowerShellCompletionFile()` functions. To include descriptions use `command.GenPowerShellCompletionWithDesc()` and `command.GenPowerShellCompletionFileWithDesc()`. Cobra will provide the description automatically based on usage information. You can choose to make this option configurable by your users. + +The script is designed to support all three PowerShell completion modes: + +* TabCompleteNext (default windows style - on each key press the next option is displayed) +* Complete (works like bash) +* MenuComplete (works like zsh) + +You set the mode with `Set-PSReadLineKeyHandler -Key Tab -Function `. Descriptions are only displayed when using the `Complete` or `MenuComplete` mode. + +Users need PowerShell version 5.0 or above, which comes with Windows 10 and can be downloaded separately for Windows 7 or 8.1. They can then write the completions to a file and source this file from their PowerShell profile, which is referenced by the `$Profile` environment variable. See `Get-Help about_Profiles` for more info about PowerShell profiles. + +``` +# With descriptions and Mode 'Complete' +$ helm s[tab] +search (search for a keyword in charts) show (show information of a chart) status (displays the status of the named release) + +# With descriptions and Mode 'MenuComplete' The description of the current selected value will be displayed below the suggestions. +$ helm s[tab] +search show status + +search for a keyword in charts + +# Without descriptions +$ helm s[tab] +search show status +``` + +### Limitations + +* Custom completions implemented in bash scripting (legacy) are not supported and will be ignored for `powershell` (including the use of the `BashCompCustom` flag annotation). + * You should instead use `ValidArgsFunction` and `RegisterFlagCompletionFunc()` which are portable to the different shells (`bash`, `zsh`, `fish`, `powershell`). +* The function `MarkFlagCustom()` is not supported and will be ignored for `powershell`. + * You should instead use `RegisterFlagCompletionFunc()`. +* The following flag completion annotations are not supported and will be ignored for `powershell`: + * `BashCompFilenameExt` (filtering by file extension) + * `BashCompSubdirsInDir` (filtering by directory) +* The functions corresponding to the above annotations are consequently not supported and will be ignored for `powershell`: + * `MarkFlagFilename()` and `MarkPersistentFlagFilename()` (filtering by file extension) + * `MarkFlagDirname()` and `MarkPersistentFlagDirname()` (filtering by directory) +* Similarly, the following completion directives are not supported and will be ignored for `powershell`: + * `ShellCompDirectiveFilterFileExt` (filtering by file extension) + * `ShellCompDirectiveFilterDirs` (filtering by directory) diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go index 92a70394a9d..2e840285f38 100644 --- a/vendor/github.com/spf13/cobra/zsh_completions.go +++ b/vendor/github.com/spf13/cobra/zsh_completions.go @@ -70,12 +70,12 @@ func (c *Command) genZshCompletion(w io.Writer, includeDesc bool) error { return err } -func genZshComp(buf *bytes.Buffer, name string, includeDesc bool) { +func genZshComp(buf io.StringWriter, name string, includeDesc bool) { compCmd := ShellCompRequestCmd if !includeDesc { compCmd = ShellCompNoDescRequestCmd } - buf.WriteString(fmt.Sprintf(`#compdef _%[1]s %[1]s + WriteStringAndCheck(buf, fmt.Sprintf(`#compdef _%[1]s %[1]s # zsh completion for %-36[1]s -*- shell-script -*- diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go index dc200395ceb..41649d26792 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -13,12 +13,42 @@ const ( compareGreater ) +var ( + intType = reflect.TypeOf(int(1)) + int8Type = reflect.TypeOf(int8(1)) + int16Type = reflect.TypeOf(int16(1)) + int32Type = reflect.TypeOf(int32(1)) + int64Type = reflect.TypeOf(int64(1)) + + uintType = reflect.TypeOf(uint(1)) + uint8Type = reflect.TypeOf(uint8(1)) + uint16Type = reflect.TypeOf(uint16(1)) + uint32Type = reflect.TypeOf(uint32(1)) + uint64Type = reflect.TypeOf(uint64(1)) + + float32Type = reflect.TypeOf(float32(1)) + float64Type = reflect.TypeOf(float64(1)) + + stringType = reflect.TypeOf("") +) + func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { + obj1Value := reflect.ValueOf(obj1) + obj2Value := reflect.ValueOf(obj2) + + // throughout this switch we try and avoid calling .Convert() if possible, + // as this has a pretty big performance impact switch kind { case reflect.Int: { - intobj1 := obj1.(int) - intobj2 := obj2.(int) + intobj1, ok := obj1.(int) + if !ok { + intobj1 = obj1Value.Convert(intType).Interface().(int) + } + intobj2, ok := obj2.(int) + if !ok { + intobj2 = obj2Value.Convert(intType).Interface().(int) + } if intobj1 > intobj2 { return compareGreater, true } @@ -31,8 +61,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int8: { - int8obj1 := obj1.(int8) - int8obj2 := obj2.(int8) + int8obj1, ok := obj1.(int8) + if !ok { + int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) + } + int8obj2, ok := obj2.(int8) + if !ok { + int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) + } if int8obj1 > int8obj2 { return compareGreater, true } @@ -45,8 +81,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int16: { - int16obj1 := obj1.(int16) - int16obj2 := obj2.(int16) + int16obj1, ok := obj1.(int16) + if !ok { + int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) + } + int16obj2, ok := obj2.(int16) + if !ok { + int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) + } if int16obj1 > int16obj2 { return compareGreater, true } @@ -59,8 +101,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int32: { - int32obj1 := obj1.(int32) - int32obj2 := obj2.(int32) + int32obj1, ok := obj1.(int32) + if !ok { + int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) + } + int32obj2, ok := obj2.(int32) + if !ok { + int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) + } if int32obj1 > int32obj2 { return compareGreater, true } @@ -73,8 +121,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Int64: { - int64obj1 := obj1.(int64) - int64obj2 := obj2.(int64) + int64obj1, ok := obj1.(int64) + if !ok { + int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) + } + int64obj2, ok := obj2.(int64) + if !ok { + int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) + } if int64obj1 > int64obj2 { return compareGreater, true } @@ -87,8 +141,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint: { - uintobj1 := obj1.(uint) - uintobj2 := obj2.(uint) + uintobj1, ok := obj1.(uint) + if !ok { + uintobj1 = obj1Value.Convert(uintType).Interface().(uint) + } + uintobj2, ok := obj2.(uint) + if !ok { + uintobj2 = obj2Value.Convert(uintType).Interface().(uint) + } if uintobj1 > uintobj2 { return compareGreater, true } @@ -101,8 +161,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint8: { - uint8obj1 := obj1.(uint8) - uint8obj2 := obj2.(uint8) + uint8obj1, ok := obj1.(uint8) + if !ok { + uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) + } + uint8obj2, ok := obj2.(uint8) + if !ok { + uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) + } if uint8obj1 > uint8obj2 { return compareGreater, true } @@ -115,8 +181,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint16: { - uint16obj1 := obj1.(uint16) - uint16obj2 := obj2.(uint16) + uint16obj1, ok := obj1.(uint16) + if !ok { + uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) + } + uint16obj2, ok := obj2.(uint16) + if !ok { + uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) + } if uint16obj1 > uint16obj2 { return compareGreater, true } @@ -129,8 +201,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint32: { - uint32obj1 := obj1.(uint32) - uint32obj2 := obj2.(uint32) + uint32obj1, ok := obj1.(uint32) + if !ok { + uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) + } + uint32obj2, ok := obj2.(uint32) + if !ok { + uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) + } if uint32obj1 > uint32obj2 { return compareGreater, true } @@ -143,8 +221,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Uint64: { - uint64obj1 := obj1.(uint64) - uint64obj2 := obj2.(uint64) + uint64obj1, ok := obj1.(uint64) + if !ok { + uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) + } + uint64obj2, ok := obj2.(uint64) + if !ok { + uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) + } if uint64obj1 > uint64obj2 { return compareGreater, true } @@ -157,8 +241,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float32: { - float32obj1 := obj1.(float32) - float32obj2 := obj2.(float32) + float32obj1, ok := obj1.(float32) + if !ok { + float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) + } + float32obj2, ok := obj2.(float32) + if !ok { + float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) + } if float32obj1 > float32obj2 { return compareGreater, true } @@ -171,8 +261,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.Float64: { - float64obj1 := obj1.(float64) - float64obj2 := obj2.(float64) + float64obj1, ok := obj1.(float64) + if !ok { + float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) + } + float64obj2, ok := obj2.(float64) + if !ok { + float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) + } if float64obj1 > float64obj2 { return compareGreater, true } @@ -185,8 +281,14 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { } case reflect.String: { - stringobj1 := obj1.(string) - stringobj2 := obj2.(string) + stringobj1, ok := obj1.(string) + if !ok { + stringobj1 = obj1Value.Convert(stringType).Interface().(string) + } + stringobj2, ok := obj2.(string) + if !ok { + stringobj2 = obj2Value.Convert(stringType).Interface().(string) + } if stringobj1 > stringobj2 { return compareGreater, true } @@ -240,6 +342,24 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs) +} + +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { + zero := reflect.Zero(reflect.TypeOf(e)) + return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs) +} + func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go index 49370eb1674..4dfd1229a86 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -114,6 +114,24 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { return Error(t, err, append([]interface{}{msg}, args...)...) } +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorAs(t, err, target, append([]interface{}{msg}, args...)...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return ErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // @@ -321,6 +339,54 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil return InEpsilonSlice(t, expected, actual, epsilon, append([]interface{}{msg}, args...)...) } +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(t, object, append([]interface{}{msg}, args...)...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(t, object, append([]interface{}{msg}, args...)...) +} + // IsTypef asserts that the specified objects are of the same type. func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { @@ -375,6 +441,17 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . return LessOrEqual(t, e1, e2, append([]interface{}{msg}, args...)...) } +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Negative(t, e, append([]interface{}{msg}, args...)...) +} + // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -476,6 +553,15 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) } +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(t, err, target, append([]interface{}{msg}, args...)...) +} + // NotNilf asserts that the specified object is not nil. // // assert.NotNilf(t, err, "error message %s", "formatted") @@ -572,6 +658,17 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str return PanicsWithValue(t, expected, f, append([]interface{}{msg}, args...)...) } +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return Positive(t, e, append([]interface{}{msg}, args...)...) +} + // Regexpf asserts that a specified regexp matches a string. // // assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 9db889427a7..25337a6f07e 100644 --- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -204,6 +204,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { return Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -631,6 +667,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo return InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { @@ -739,6 +871,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i return Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -941,6 +1095,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str return NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1133,6 +1305,28 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b return Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go new file mode 100644 index 00000000000..1c3b47182a7 --- /dev/null +++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go @@ -0,0 +1,81 @@ +package assert + +import ( + "fmt" + "reflect" +) + +// isOrdered checks that collection contains orderable elements. +func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { + objKind := reflect.TypeOf(object).Kind() + if objKind != reflect.Slice && objKind != reflect.Array { + return false + } + + objValue := reflect.ValueOf(object) + objLen := objValue.Len() + + if objLen <= 1 { + return true + } + + value := objValue.Index(0) + valueInterface := value.Interface() + firstValueKind := value.Kind() + + for i := 1; i < objLen; i++ { + prevValue := value + prevValueInterface := valueInterface + + value = objValue.Index(i) + valueInterface = value.Interface() + + compareResult, isComparable := compare(prevValueInterface, valueInterface, firstValueKind) + + if !isComparable { + return Fail(t, fmt.Sprintf("Can not compare type \"%s\" and \"%s\"", reflect.TypeOf(value), reflect.TypeOf(prevValue)), msgAndArgs...) + } + + if !containsValue(allowedComparesResults, compareResult) { + return Fail(t, fmt.Sprintf(failMessage, prevValue, value), msgAndArgs...) + } + } + + return true +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) +} + +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { + return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) +} diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index 914a10d83af..bcac4401f57 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -172,8 +172,8 @@ func isTest(name, prefix string) bool { if len(name) == len(prefix) { // "Test" is ok return true } - rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) - return !unicode.IsLower(rune) + r, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(r) } func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { @@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, DisableMethods: true, + MaxDepth: 10, } type tHelper interface { @@ -1693,3 +1694,81 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D } } } + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should be in err chain:\n"+ + "expected: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err, target error, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if !errors.Is(err, target) { + return true + } + + var expectedText string + if target != nil { + expectedText = target.Error() + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Target error should not be in err chain:\n"+ + "found: %q\n"+ + "in chain: %s", expectedText, chain, + ), msgAndArgs...) +} + +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if errors.As(err, target) { + return true + } + + chain := buildErrorChainString(err) + + return Fail(t, fmt.Sprintf("Should be in error chain:\n"+ + "expected: %q\n"+ + "in chain: %s", target, chain, + ), msgAndArgs...) +} + +func buildErrorChainString(err error) string { + if err == nil { + return "" + } + + e := errors.Unwrap(err) + chain := fmt.Sprintf("%q", err.Error()) + for e != nil { + chain += fmt.Sprintf("\n\t%q", e.Error()) + e = errors.Unwrap(e) + } + return chain +} diff --git a/vendor/github.com/stretchr/testify/mock/mock.go b/vendor/github.com/stretchr/testify/mock/mock.go index c6df4485abc..e2e6a2d237d 100644 --- a/vendor/github.com/stretchr/testify/mock/mock.go +++ b/vendor/github.com/stretchr/testify/mock/mock.go @@ -297,25 +297,52 @@ func (m *Mock) findExpectedCall(method string, arguments ...interface{}) (int, * return -1, expectedCall } +type matchCandidate struct { + call *Call + mismatch string + diffCount int +} + +func (c matchCandidate) isBetterMatchThan(other matchCandidate) bool { + if c.call == nil { + return false + } + if other.call == nil { + return true + } + + if c.diffCount > other.diffCount { + return false + } + if c.diffCount < other.diffCount { + return true + } + + if c.call.Repeatability > 0 && other.call.Repeatability <= 0 { + return true + } + return false +} + func (m *Mock) findClosestCall(method string, arguments ...interface{}) (*Call, string) { - var diffCount int - var closestCall *Call - var err string + var bestMatch matchCandidate for _, call := range m.expectedCalls() { if call.Method == method { errInfo, tempDiffCount := call.Arguments.Diff(arguments) - if tempDiffCount < diffCount || diffCount == 0 { - diffCount = tempDiffCount - closestCall = call - err = errInfo + tempCandidate := matchCandidate{ + call: call, + mismatch: errInfo, + diffCount: tempDiffCount, + } + if tempCandidate.isBetterMatchThan(bestMatch) { + bestMatch = tempCandidate } - } } - return closestCall, err + return bestMatch.call, bestMatch.mismatch } func callString(method string, arguments Arguments, includeArgumentValues bool) string { diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index ec4624b282b..51820df2e67 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -256,6 +256,54 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) { t.FailNow() } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorAsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.ErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -806,6 +854,126 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl t.FailNow() } +// IsDecreasing asserts that the collection is decreasing +// +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) +func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsDecreasingf asserts that the collection is decreasing +// +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsIncreasing asserts that the collection is increasing +// +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) +func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsIncreasingf asserts that the collection is increasing +// +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) +func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonDecreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) +func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasing(t, object, msgAndArgs...) { + return + } + t.FailNow() +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.IsNonIncreasingf(t, object, msg, args...) { + return + } + t.FailNow() +} + // IsType asserts that the specified objects are of the same type. func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { @@ -944,6 +1112,34 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter t.FailNow() } +// Negative asserts that the specified element is negative +// +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) +func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negative(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Negativef asserts that the specified element is negative +// +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") +func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Negativef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -1200,6 +1396,30 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, t.FailNow() } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIs(t, err, target, msgAndArgs...) { + return + } + t.FailNow() +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.NotErrorIsf(t, err, target, msg, args...) { + return + } + t.FailNow() +} + // NotNil asserts that the specified object is not nil. // // assert.NotNil(t, err) @@ -1446,6 +1666,34 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{} t.FailNow() } +// Positive asserts that the specified element is positive +// +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) +func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positive(t, e, msgAndArgs...) { + return + } + t.FailNow() +} + +// Positivef asserts that the specified element is positive +// +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") +func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.Positivef(t, e, msg, args...) { + return + } + t.FailNow() +} + // Regexp asserts that a specified regexp matches a string. // // assert.Regexp(t, regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index 103d7dcb6ad..ed54a9d83f3 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -205,6 +205,42 @@ func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { Error(a.t, err, msgAndArgs...) } +// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAs(a.t, err, target, msgAndArgs...) +} + +// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. +// This is a wrapper for errors.As. +func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorAsf(a.t, err, target, msg, args...) +} + +// ErrorIs asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIs(a.t, err, target, msgAndArgs...) +} + +// ErrorIsf asserts that at least one of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + ErrorIsf(a.t, err, target, msg, args...) +} + // Errorf asserts that a function returned an error (i.e. not `nil`). // // actualObj, err := SomeFunction() @@ -632,6 +668,102 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo InEpsilonf(a.t, expected, actual, epsilon, msg, args...) } +// IsDecreasing asserts that the collection is decreasing +// +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) +func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasing(a.t, object, msgAndArgs...) +} + +// IsDecreasingf asserts that the collection is decreasing +// +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsDecreasingf(a.t, object, msg, args...) +} + +// IsIncreasing asserts that the collection is increasing +// +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) +func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasing(a.t, object, msgAndArgs...) +} + +// IsIncreasingf asserts that the collection is increasing +// +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsIncreasingf(a.t, object, msg, args...) +} + +// IsNonDecreasing asserts that the collection is not decreasing +// +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) +func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasing(a.t, object, msgAndArgs...) +} + +// IsNonDecreasingf asserts that the collection is not decreasing +// +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonDecreasingf(a.t, object, msg, args...) +} + +// IsNonIncreasing asserts that the collection is not increasing +// +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) +func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasing(a.t, object, msgAndArgs...) +} + +// IsNonIncreasingf asserts that the collection is not increasing +// +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + IsNonIncreasingf(a.t, object, msg, args...) +} + // IsType asserts that the specified objects are of the same type. func (a *Assertions) IsType(expectedType interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { @@ -740,6 +872,28 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i Lessf(a.t, e1, e2, msg, args...) } +// Negative asserts that the specified element is negative +// +// a.Negative(-1) +// a.Negative(-1.23) +func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negative(a.t, e, msgAndArgs...) +} + +// Negativef asserts that the specified element is negative +// +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") +func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Negativef(a.t, e, msg, args...) +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // @@ -942,6 +1096,24 @@ func (a *Assertions) NotEqualf(expected interface{}, actual interface{}, msg str NotEqualf(a.t, expected, actual, msg, args...) } +// NotErrorIs asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIs(err error, target error, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIs(a.t, err, target, msgAndArgs...) +} + +// NotErrorIsf asserts that at none of the errors in err's chain matches target. +// This is a wrapper for errors.Is. +func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + NotErrorIsf(a.t, err, target, msg, args...) +} + // NotNil asserts that the specified object is not nil. // // a.NotNil(err) @@ -1134,6 +1306,28 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa Panicsf(a.t, f, msg, args...) } +// Positive asserts that the specified element is positive +// +// a.Positive(1) +// a.Positive(1.23) +func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positive(a.t, e, msgAndArgs...) +} + +// Positivef asserts that the specified element is positive +// +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") +func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + Positivef(a.t, e, msg, args...) +} + // Regexp asserts that a specified regexp matches a string. // // a.Regexp(regexp.MustCompile("start"), "it's starting") diff --git a/vendor/github.com/xdg-go/scram/.gitignore b/vendor/github.com/xdg-go/scram/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/vendor/github.com/xdg-go/scram/.travis.yml b/vendor/github.com/xdg-go/scram/.travis.yml new file mode 100644 index 00000000000..f391327ea9d --- /dev/null +++ b/vendor/github.com/xdg-go/scram/.travis.yml @@ -0,0 +1,11 @@ +language: go +sudo: false +go: + - "1.7" + - "1.8" + - "1.9" + - "1.10" + - master +matrix: + allow_failures: + - go: master diff --git a/vendor/github.com/xdg-go/scram/LICENSE b/vendor/github.com/xdg-go/scram/LICENSE new file mode 100644 index 00000000000..67db8588217 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/xdg-go/scram/README.md b/vendor/github.com/xdg-go/scram/README.md new file mode 100644 index 00000000000..6782d94d746 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/README.md @@ -0,0 +1,71 @@ +[![GoDoc](https://godoc.org/github.com/xdg/scram?status.svg)](https://godoc.org/github.com/xdg/scram) +[![Build Status](https://travis-ci.org/xdg/scram.svg?branch=master)](https://travis-ci.org/xdg/scram) + +# scram – Go implementation of RFC-5802 + +## Description + +Package scram provides client and server implementations of the Salted +Challenge Response Authentication Mechanism (SCRAM) described in +[RFC-5802](https://tools.ietf.org/html/rfc5802) and +[RFC-7677](https://tools.ietf.org/html/rfc7677). + +It includes both client and server side support. + +Channel binding and extensions are not (yet) supported. + +## Examples + +### Client side + + package main + + import "github.com/xdg/scram" + + func main() { + // Get Client with username, password and (optional) authorization ID. + clientSHA1, err := scram.SHA1.NewClient("mulder", "trustno1", "") + if err != nil { + panic(err) + } + + // Prepare the authentication conversation. Use the empty string as the + // initial server message argument to start the conversation. + conv := clientSHA1.NewConversation() + var serverMsg string + + // Get the first message, send it and read the response. + firstMsg, err := conv.Step(serverMsg) + if err != nil { + panic(err) + } + serverMsg = sendClientMsg(firstMsg) + + // Get the second message, send it, and read the response. + secondMsg, err := conv.Step(serverMsg) + if err != nil { + panic(err) + } + serverMsg = sendClientMsg(secondMsg) + + // Validate the server's final message. We have no further message to + // send so ignore that return value. + _, err = conv.Step(serverMsg) + if err != nil { + panic(err) + } + + return + } + + func sendClientMsg(s string) string { + // A real implementation would send this to a server and read a reply. + return "" + } + +## Copyright and License + +Copyright 2018 by David A. Golden. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"). You may +obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/vendor/github.com/xdg-go/scram/client.go b/vendor/github.com/xdg-go/scram/client.go new file mode 100644 index 00000000000..ca0c4c711c6 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/client.go @@ -0,0 +1,130 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "sync" + + "golang.org/x/crypto/pbkdf2" +) + +// Client implements the client side of SCRAM authentication. It holds +// configuration values needed to initialize new client-side conversations for +// a specific username, password and authorization ID tuple. Client caches +// the computationally-expensive parts of a SCRAM conversation as described in +// RFC-5802. If repeated authentication conversations may be required for a +// user (e.g. disconnect/reconnect), the user's Client should be preserved. +// +// For security reasons, Clients have a default minimum PBKDF2 iteration count +// of 4096. If a server requests a smaller iteration count, an authentication +// conversation will error. +// +// A Client can also be used by a server application to construct the hashed +// authentication values to be stored for a new user. See StoredCredentials() +// for more. +type Client struct { + sync.RWMutex + username string + password string + authzID string + minIters int + nonceGen NonceGeneratorFcn + hashGen HashGeneratorFcn + cache map[KeyFactors]derivedKeys +} + +func newClient(username, password, authzID string, fcn HashGeneratorFcn) *Client { + return &Client{ + username: username, + password: password, + authzID: authzID, + minIters: 4096, + nonceGen: defaultNonceGenerator, + hashGen: fcn, + cache: make(map[KeyFactors]derivedKeys), + } +} + +// WithMinIterations changes minimum required PBKDF2 iteration count. +func (c *Client) WithMinIterations(n int) *Client { + c.Lock() + defer c.Unlock() + c.minIters = n + return c +} + +// WithNonceGenerator replaces the default nonce generator (base64 encoding of +// 24 bytes from crypto/rand) with a custom generator. This is provided for +// testing or for users with custom nonce requirements. +func (c *Client) WithNonceGenerator(ng NonceGeneratorFcn) *Client { + c.Lock() + defer c.Unlock() + c.nonceGen = ng + return c +} + +// NewConversation constructs a client-side authentication conversation. +// Conversations cannot be reused, so this must be called for each new +// authentication attempt. +func (c *Client) NewConversation() *ClientConversation { + c.RLock() + defer c.RUnlock() + return &ClientConversation{ + client: c, + nonceGen: c.nonceGen, + hashGen: c.hashGen, + minIters: c.minIters, + } +} + +func (c *Client) getDerivedKeys(kf KeyFactors) derivedKeys { + dk, ok := c.getCache(kf) + if !ok { + dk = c.computeKeys(kf) + c.setCache(kf, dk) + } + return dk +} + +// GetStoredCredentials takes a salt and iteration count structure and +// provides the values that must be stored by a server to authentication a +// user. These values are what the Server credential lookup function must +// return for a given username. +func (c *Client) GetStoredCredentials(kf KeyFactors) StoredCredentials { + dk := c.getDerivedKeys(kf) + return StoredCredentials{ + KeyFactors: kf, + StoredKey: dk.StoredKey, + ServerKey: dk.ServerKey, + } +} + +func (c *Client) computeKeys(kf KeyFactors) derivedKeys { + h := c.hashGen() + saltedPassword := pbkdf2.Key([]byte(c.password), []byte(kf.Salt), kf.Iters, h.Size(), c.hashGen) + clientKey := computeHMAC(c.hashGen, saltedPassword, []byte("Client Key")) + + return derivedKeys{ + ClientKey: clientKey, + StoredKey: computeHash(c.hashGen, clientKey), + ServerKey: computeHMAC(c.hashGen, saltedPassword, []byte("Server Key")), + } +} + +func (c *Client) getCache(kf KeyFactors) (derivedKeys, bool) { + c.RLock() + defer c.RUnlock() + dk, ok := c.cache[kf] + return dk, ok +} + +func (c *Client) setCache(kf KeyFactors, dk derivedKeys) { + c.Lock() + defer c.Unlock() + c.cache[kf] = dk + return +} diff --git a/vendor/github.com/xdg-go/scram/client_conv.go b/vendor/github.com/xdg-go/scram/client_conv.go new file mode 100644 index 00000000000..834056889e8 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/client_conv.go @@ -0,0 +1,149 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "crypto/hmac" + "encoding/base64" + "errors" + "fmt" + "strings" +) + +type clientState int + +const ( + clientStarting clientState = iota + clientFirst + clientFinal + clientDone +) + +// ClientConversation implements the client-side of an authentication +// conversation with a server. A new conversation must be created for +// each authentication attempt. +type ClientConversation struct { + client *Client + nonceGen NonceGeneratorFcn + hashGen HashGeneratorFcn + minIters int + state clientState + valid bool + gs2 string + nonce string + c1b string + serveSig []byte +} + +// Step takes a string provided from a server (or just an empty string for the +// very first conversation step) and attempts to move the authentication +// conversation forward. It returns a string to be sent to the server or an +// error if the server message is invalid. Calling Step after a conversation +// completes is also an error. +func (cc *ClientConversation) Step(challenge string) (response string, err error) { + switch cc.state { + case clientStarting: + cc.state = clientFirst + response, err = cc.firstMsg() + case clientFirst: + cc.state = clientFinal + response, err = cc.finalMsg(challenge) + case clientFinal: + cc.state = clientDone + response, err = cc.validateServer(challenge) + default: + response, err = "", errors.New("Conversation already completed") + } + return +} + +// Done returns true if the conversation is completed or has errored. +func (cc *ClientConversation) Done() bool { + return cc.state == clientDone +} + +// Valid returns true if the conversation successfully authenticated with the +// server, including counter-validation that the server actually has the +// user's stored credentials. +func (cc *ClientConversation) Valid() bool { + return cc.valid +} + +func (cc *ClientConversation) firstMsg() (string, error) { + // Values are cached for use in final message parameters + cc.gs2 = cc.gs2Header() + cc.nonce = cc.client.nonceGen() + cc.c1b = fmt.Sprintf("n=%s,r=%s", encodeName(cc.client.username), cc.nonce) + + return cc.gs2 + cc.c1b, nil +} + +func (cc *ClientConversation) finalMsg(s1 string) (string, error) { + msg, err := parseServerFirst(s1) + if err != nil { + return "", err + } + + // Check nonce prefix and update + if !strings.HasPrefix(msg.nonce, cc.nonce) { + return "", errors.New("server nonce did not extend client nonce") + } + cc.nonce = msg.nonce + + // Check iteration count vs minimum + if msg.iters < cc.minIters { + return "", fmt.Errorf("server requested too few iterations (%d)", msg.iters) + } + + // Create client-final-message-without-proof + c2wop := fmt.Sprintf( + "c=%s,r=%s", + base64.StdEncoding.EncodeToString([]byte(cc.gs2)), + cc.nonce, + ) + + // Create auth message + authMsg := cc.c1b + "," + s1 + "," + c2wop + + // Get derived keys from client cache + dk := cc.client.getDerivedKeys(KeyFactors{Salt: string(msg.salt), Iters: msg.iters}) + + // Create proof as clientkey XOR clientsignature + clientSignature := computeHMAC(cc.hashGen, dk.StoredKey, []byte(authMsg)) + clientProof := xorBytes(dk.ClientKey, clientSignature) + proof := base64.StdEncoding.EncodeToString(clientProof) + + // Cache ServerSignature for later validation + cc.serveSig = computeHMAC(cc.hashGen, dk.ServerKey, []byte(authMsg)) + + return fmt.Sprintf("%s,p=%s", c2wop, proof), nil +} + +func (cc *ClientConversation) validateServer(s2 string) (string, error) { + msg, err := parseServerFinal(s2) + if err != nil { + return "", err + } + + if len(msg.err) > 0 { + return "", fmt.Errorf("server error: %s", msg.err) + } + + if !hmac.Equal(msg.verifier, cc.serveSig) { + return "", errors.New("server validation failed") + } + + cc.valid = true + return "", nil +} + +func (cc *ClientConversation) gs2Header() string { + if cc.client.authzID == "" { + return "n,," + } + return fmt.Sprintf("n,%s,", encodeName(cc.client.authzID)) +} diff --git a/vendor/github.com/xdg-go/scram/common.go b/vendor/github.com/xdg-go/scram/common.go new file mode 100644 index 00000000000..cb705cb74ec --- /dev/null +++ b/vendor/github.com/xdg-go/scram/common.go @@ -0,0 +1,97 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "crypto/hmac" + "crypto/rand" + "encoding/base64" + "strings" +) + +// NonceGeneratorFcn defines a function that returns a string of high-quality +// random printable ASCII characters EXCLUDING the comma (',') character. The +// default nonce generator provides Base64 encoding of 24 bytes from +// crypto/rand. +type NonceGeneratorFcn func() string + +// derivedKeys collects the three cryptographically derived values +// into one struct for caching. +type derivedKeys struct { + ClientKey []byte + StoredKey []byte + ServerKey []byte +} + +// KeyFactors represent the two server-provided factors needed to compute +// client credentials for authentication. Salt is decoded bytes (i.e. not +// base64), but in string form so that KeyFactors can be used as a map key for +// cached credentials. +type KeyFactors struct { + Salt string + Iters int +} + +// StoredCredentials are the values that a server must store for a given +// username to allow authentication. They include the salt and iteration +// count, plus the derived values to authenticate a client and for the server +// to authenticate itself back to the client. +// +// NOTE: these are specific to a given hash function. To allow a user to +// authenticate with either SCRAM-SHA-1 or SCRAM-SHA-256, two sets of +// StoredCredentials must be created and stored, one for each hash function. +type StoredCredentials struct { + KeyFactors + StoredKey []byte + ServerKey []byte +} + +// CredentialLookup is a callback to provide StoredCredentials for a given +// username. This is used to configure Server objects. +// +// NOTE: these are specific to a given hash function. The callback provided +// to a Server with a given hash function must provide the corresponding +// StoredCredentials. +type CredentialLookup func(string) (StoredCredentials, error) + +func defaultNonceGenerator() string { + raw := make([]byte, 24) + nonce := make([]byte, base64.StdEncoding.EncodedLen(len(raw))) + rand.Read(raw) + base64.StdEncoding.Encode(nonce, raw) + return string(nonce) +} + +func encodeName(s string) string { + return strings.Replace(strings.Replace(s, "=", "=3D", -1), ",", "=2C", -1) +} + +func decodeName(s string) (string, error) { + // TODO Check for = not followed by 2C or 3D + return strings.Replace(strings.Replace(s, "=2C", ",", -1), "=3D", "=", -1), nil +} + +func computeHash(hg HashGeneratorFcn, b []byte) []byte { + h := hg() + h.Write(b) + return h.Sum(nil) +} + +func computeHMAC(hg HashGeneratorFcn, key, data []byte) []byte { + mac := hmac.New(hg, key) + mac.Write(data) + return mac.Sum(nil) +} + +func xorBytes(a, b []byte) []byte { + // TODO check a & b are same length, or just xor to smallest + xor := make([]byte, len(a)) + for i := range a { + xor[i] = a[i] ^ b[i] + } + return xor +} diff --git a/vendor/github.com/xdg-go/scram/doc.go b/vendor/github.com/xdg-go/scram/doc.go new file mode 100644 index 00000000000..d43bee6071c --- /dev/null +++ b/vendor/github.com/xdg-go/scram/doc.go @@ -0,0 +1,24 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package scram provides client and server implementations of the Salted +// Challenge Response Authentication Mechanism (SCRAM) described in RFC-5802 +// and RFC-7677. +// +// Usage +// +// The scram package provides two variables, `SHA1` and `SHA256`, that are +// used to construct Client or Server objects. +// +// clientSHA1, err := scram.SHA1.NewClient(username, password, authID) +// clientSHA256, err := scram.SHA256.NewClient(username, password, authID) +// +// serverSHA1, err := scram.SHA1.NewServer(credentialLookupFcn) +// serverSHA256, err := scram.SHA256.NewServer(credentialLookupFcn) +// +// These objects are used to construct ClientConversation or +// ServerConversation objects that are used to carry out authentication. +package scram diff --git a/vendor/github.com/xdg-go/scram/parse.go b/vendor/github.com/xdg-go/scram/parse.go new file mode 100644 index 00000000000..722f6043d37 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/parse.go @@ -0,0 +1,205 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "encoding/base64" + "errors" + "fmt" + "strconv" + "strings" +) + +type c1Msg struct { + gs2Header string + authzID string + username string + nonce string + c1b string +} + +type c2Msg struct { + cbind []byte + nonce string + proof []byte + c2wop string +} + +type s1Msg struct { + nonce string + salt []byte + iters int +} + +type s2Msg struct { + verifier []byte + err string +} + +func parseField(s, k string) (string, error) { + t := strings.TrimPrefix(s, k+"=") + if t == s { + return "", fmt.Errorf("error parsing '%s' for field '%s'", s, k) + } + return t, nil +} + +func parseGS2Flag(s string) (string, error) { + if s[0] == 'p' { + return "", fmt.Errorf("channel binding requested but not supported") + } + + if s == "n" || s == "y" { + return s, nil + } + + return "", fmt.Errorf("error parsing '%s' for gs2 flag", s) +} + +func parseFieldBase64(s, k string) ([]byte, error) { + raw, err := parseField(s, k) + if err != nil { + return nil, err + } + + dec, err := base64.StdEncoding.DecodeString(raw) + if err != nil { + return nil, err + } + + return dec, nil +} + +func parseFieldInt(s, k string) (int, error) { + raw, err := parseField(s, k) + if err != nil { + return 0, err + } + + num, err := strconv.Atoi(raw) + if err != nil { + return 0, fmt.Errorf("error parsing field '%s': %v", k, err) + } + + return num, nil +} + +func parseClientFirst(c1 string) (msg c1Msg, err error) { + + fields := strings.Split(c1, ",") + if len(fields) < 4 { + err = errors.New("not enough fields in first server message") + return + } + + gs2flag, err := parseGS2Flag(fields[0]) + if err != nil { + return + } + + // 'a' field is optional + if len(fields[1]) > 0 { + msg.authzID, err = parseField(fields[1], "a") + if err != nil { + return + } + } + + // Recombine and save the gs2 header + msg.gs2Header = gs2flag + "," + msg.authzID + "," + + // Check for unsupported extensions field "m". + if strings.HasPrefix(fields[2], "m=") { + err = errors.New("SCRAM message extensions are not supported") + return + } + + msg.username, err = parseField(fields[2], "n") + if err != nil { + return + } + + msg.nonce, err = parseField(fields[3], "r") + if err != nil { + return + } + + msg.c1b = strings.Join(fields[2:], ",") + + return +} + +func parseClientFinal(c2 string) (msg c2Msg, err error) { + fields := strings.Split(c2, ",") + if len(fields) < 3 { + err = errors.New("not enough fields in first server message") + return + } + + msg.cbind, err = parseFieldBase64(fields[0], "c") + if err != nil { + return + } + + msg.nonce, err = parseField(fields[1], "r") + if err != nil { + return + } + + // Extension fields may come between nonce and proof, so we + // grab the *last* fields as proof. + msg.proof, err = parseFieldBase64(fields[len(fields)-1], "p") + if err != nil { + return + } + + msg.c2wop = c2[:strings.LastIndex(c2, ",")] + + return +} + +func parseServerFirst(s1 string) (msg s1Msg, err error) { + + // Check for unsupported extensions field "m". + if strings.HasPrefix(s1, "m=") { + err = errors.New("SCRAM message extensions are not supported") + return + } + + fields := strings.Split(s1, ",") + if len(fields) < 3 { + err = errors.New("not enough fields in first server message") + return + } + + msg.nonce, err = parseField(fields[0], "r") + if err != nil { + return + } + + msg.salt, err = parseFieldBase64(fields[1], "s") + if err != nil { + return + } + + msg.iters, err = parseFieldInt(fields[2], "i") + + return +} + +func parseServerFinal(s2 string) (msg s2Msg, err error) { + fields := strings.Split(s2, ",") + + msg.verifier, err = parseFieldBase64(fields[0], "v") + if err == nil { + return + } + + msg.err, err = parseField(fields[0], "e") + + return +} diff --git a/vendor/github.com/xdg-go/scram/scram.go b/vendor/github.com/xdg-go/scram/scram.go new file mode 100644 index 00000000000..9e9836afe71 --- /dev/null +++ b/vendor/github.com/xdg-go/scram/scram.go @@ -0,0 +1,66 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "crypto/sha1" + "crypto/sha256" + "fmt" + "hash" + + "github.com/xdg/stringprep" +) + +// HashGeneratorFcn abstracts a factory function that returns a hash.Hash +// value to be used for SCRAM operations. Generally, one would use the +// provided package variables, `scram.SHA1` and `scram.SHA256`, for the most +// common forms of SCRAM. +type HashGeneratorFcn func() hash.Hash + +// SHA1 is a function that returns a crypto/sha1 hasher and should be used to +// create Client objects configured for SHA-1 hashing. +var SHA1 HashGeneratorFcn = func() hash.Hash { return sha1.New() } + +// SHA256 is a function that returns a crypto/sha256 hasher and should be used +// to create Client objects configured for SHA-256 hashing. +var SHA256 HashGeneratorFcn = func() hash.Hash { return sha256.New() } + +// NewClient constructs a SCRAM client component based on a given hash.Hash +// factory receiver. This constructor will normalize the username, password +// and authzID via the SASLprep algorithm, as recommended by RFC-5802. If +// SASLprep fails, the method returns an error. +func (f HashGeneratorFcn) NewClient(username, password, authzID string) (*Client, error) { + var userprep, passprep, authprep string + var err error + + if userprep, err = stringprep.SASLprep.Prepare(username); err != nil { + return nil, fmt.Errorf("Error SASLprepping username '%s': %v", username, err) + } + if passprep, err = stringprep.SASLprep.Prepare(password); err != nil { + return nil, fmt.Errorf("Error SASLprepping password '%s': %v", password, err) + } + if authprep, err = stringprep.SASLprep.Prepare(authzID); err != nil { + return nil, fmt.Errorf("Error SASLprepping authzID '%s': %v", authzID, err) + } + + return newClient(userprep, passprep, authprep, f), nil +} + +// NewClientUnprepped acts like NewClient, except none of the arguments will +// be normalized via SASLprep. This is not generally recommended, but is +// provided for users that may have custom normalization needs. +func (f HashGeneratorFcn) NewClientUnprepped(username, password, authzID string) (*Client, error) { + return newClient(username, password, authzID, f), nil +} + +// NewServer constructs a SCRAM server component based on a given hash.Hash +// factory receiver. To be maximally generic, it uses dependency injection to +// handle credential lookup, which is the process of turning a username string +// into a struct with stored credentials for authentication. +func (f HashGeneratorFcn) NewServer(cl CredentialLookup) (*Server, error) { + return newServer(cl, f) +} diff --git a/vendor/github.com/xdg-go/scram/server.go b/vendor/github.com/xdg-go/scram/server.go new file mode 100644 index 00000000000..b119b36156d --- /dev/null +++ b/vendor/github.com/xdg-go/scram/server.go @@ -0,0 +1,50 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import "sync" + +// Server implements the server side of SCRAM authentication. It holds +// configuration values needed to initialize new server-side conversations. +// Generally, this can be persistent within an application. +type Server struct { + sync.RWMutex + credentialCB CredentialLookup + nonceGen NonceGeneratorFcn + hashGen HashGeneratorFcn +} + +func newServer(cl CredentialLookup, fcn HashGeneratorFcn) (*Server, error) { + return &Server{ + credentialCB: cl, + nonceGen: defaultNonceGenerator, + hashGen: fcn, + }, nil +} + +// WithNonceGenerator replaces the default nonce generator (base64 encoding of +// 24 bytes from crypto/rand) with a custom generator. This is provided for +// testing or for users with custom nonce requirements. +func (s *Server) WithNonceGenerator(ng NonceGeneratorFcn) *Server { + s.Lock() + defer s.Unlock() + s.nonceGen = ng + return s +} + +// NewConversation constructs a server-side authentication conversation. +// Conversations cannot be reused, so this must be called for each new +// authentication attempt. +func (s *Server) NewConversation() *ServerConversation { + s.RLock() + defer s.RUnlock() + return &ServerConversation{ + nonceGen: s.nonceGen, + hashGen: s.hashGen, + credentialCB: s.credentialCB, + } +} diff --git a/vendor/github.com/xdg-go/scram/server_conv.go b/vendor/github.com/xdg-go/scram/server_conv.go new file mode 100644 index 00000000000..9c8838c38ae --- /dev/null +++ b/vendor/github.com/xdg-go/scram/server_conv.go @@ -0,0 +1,151 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package scram + +import ( + "crypto/hmac" + "encoding/base64" + "errors" + "fmt" +) + +type serverState int + +const ( + serverFirst serverState = iota + serverFinal + serverDone +) + +// ServerConversation implements the server-side of an authentication +// conversation with a client. A new conversation must be created for +// each authentication attempt. +type ServerConversation struct { + nonceGen NonceGeneratorFcn + hashGen HashGeneratorFcn + credentialCB CredentialLookup + state serverState + credential StoredCredentials + valid bool + gs2Header string + username string + authzID string + nonce string + c1b string + s1 string +} + +// Step takes a string provided from a client and attempts to move the +// authentication conversation forward. It returns a string to be sent to the +// client or an error if the client message is invalid. Calling Step after a +// conversation completes is also an error. +func (sc *ServerConversation) Step(challenge string) (response string, err error) { + switch sc.state { + case serverFirst: + sc.state = serverFinal + response, err = sc.firstMsg(challenge) + case serverFinal: + sc.state = serverDone + response, err = sc.finalMsg(challenge) + default: + response, err = "", errors.New("Conversation already completed") + } + return +} + +// Done returns true if the conversation is completed or has errored. +func (sc *ServerConversation) Done() bool { + return sc.state == serverDone +} + +// Valid returns true if the conversation successfully authenticated the +// client. +func (sc *ServerConversation) Valid() bool { + return sc.valid +} + +// Username returns the client-provided username. This is valid to call +// if the first conversation Step() is successful. +func (sc *ServerConversation) Username() string { + return sc.username +} + +// AuthzID returns the (optional) client-provided authorization identity, if +// any. If one was not provided, it returns the empty string. This is valid +// to call if the first conversation Step() is successful. +func (sc *ServerConversation) AuthzID() string { + return sc.authzID +} + +func (sc *ServerConversation) firstMsg(c1 string) (string, error) { + msg, err := parseClientFirst(c1) + if err != nil { + sc.state = serverDone + return "", err + } + + sc.gs2Header = msg.gs2Header + sc.username = msg.username + sc.authzID = msg.authzID + + sc.credential, err = sc.credentialCB(msg.username) + if err != nil { + sc.state = serverDone + return "e=unknown-user", err + } + + sc.nonce = msg.nonce + sc.nonceGen() + sc.c1b = msg.c1b + sc.s1 = fmt.Sprintf("r=%s,s=%s,i=%d", + sc.nonce, + base64.StdEncoding.EncodeToString([]byte(sc.credential.Salt)), + sc.credential.Iters, + ) + + return sc.s1, nil +} + +// For errors, returns server error message as well as non-nil error. Callers +// can choose whether to send server error or not. +func (sc *ServerConversation) finalMsg(c2 string) (string, error) { + msg, err := parseClientFinal(c2) + if err != nil { + return "", err + } + + // Check channel binding matches what we expect; in this case, we expect + // just the gs2 header we received as we don't support channel binding + // with a data payload. If we add binding, we need to independently + // compute the header to match here. + if string(msg.cbind) != sc.gs2Header { + return "e=channel-bindings-dont-match", fmt.Errorf("channel binding received '%s' doesn't match expected '%s'", msg.cbind, sc.gs2Header) + } + + // Check nonce received matches what we sent + if msg.nonce != sc.nonce { + return "e=other-error", errors.New("nonce received did not match nonce sent") + } + + // Create auth message + authMsg := sc.c1b + "," + sc.s1 + "," + msg.c2wop + + // Retrieve ClientKey from proof and verify it + clientSignature := computeHMAC(sc.hashGen, sc.credential.StoredKey, []byte(authMsg)) + clientKey := xorBytes([]byte(msg.proof), clientSignature) + storedKey := computeHash(sc.hashGen, clientKey) + + // Compare with constant-time function + if !hmac.Equal(storedKey, sc.credential.StoredKey) { + return "e=invalid-proof", errors.New("challenge proof invalid") + } + + sc.valid = true + + // Compute and return server verifier + serverSignature := computeHMAC(sc.hashGen, sc.credential.ServerKey, []byte(authMsg)) + return "v=" + base64.StdEncoding.EncodeToString(serverSignature), nil +} diff --git a/vendor/github.com/xdg/stringprep/.gitignore b/vendor/github.com/xdg/stringprep/.gitignore new file mode 100644 index 00000000000..e69de29bb2d diff --git a/vendor/github.com/xdg/stringprep/.travis.yml b/vendor/github.com/xdg/stringprep/.travis.yml new file mode 100644 index 00000000000..376c53a74db --- /dev/null +++ b/vendor/github.com/xdg/stringprep/.travis.yml @@ -0,0 +1,10 @@ +language: go +sudo: false +go: + - 1.7 + - 1.8 + - 1.9 + - master +matrix: + allow_failures: + - go: master diff --git a/vendor/github.com/xdg/stringprep/LICENSE b/vendor/github.com/xdg/stringprep/LICENSE new file mode 100644 index 00000000000..67db8588217 --- /dev/null +++ b/vendor/github.com/xdg/stringprep/LICENSE @@ -0,0 +1,175 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/xdg/stringprep/README.md b/vendor/github.com/xdg/stringprep/README.md new file mode 100644 index 00000000000..87279e3ebfd --- /dev/null +++ b/vendor/github.com/xdg/stringprep/README.md @@ -0,0 +1,27 @@ +[![GoDoc](https://godoc.org/github.com/xdg/stringprep?status.svg)](https://godoc.org/github.com/xdg/stringprep) +[![Build Status](https://travis-ci.org/xdg/stringprep.svg?branch=master)](https://travis-ci.org/xdg/stringprep) + +# stringprep – Go implementation of RFC-3454 stringprep and RFC-4013 SASLprep + +## Synopsis + +``` + import "github.com/xdg/stringprep" + + prepped := stringprep.SASLprep.Prepare("TrustNô1") + +``` + +## Description + +This library provides an implementation of the stringprep algorithm +(RFC-3454) in Go, including all data tables. + +A pre-built SASLprep (RFC-4013) profile is provided as well. + +## Copyright and License + +Copyright 2018 by David A. Golden. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"). You may +obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/vendor/github.com/xdg/stringprep/bidi.go b/vendor/github.com/xdg/stringprep/bidi.go new file mode 100644 index 00000000000..6f6d321dfda --- /dev/null +++ b/vendor/github.com/xdg/stringprep/bidi.go @@ -0,0 +1,73 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package stringprep + +var errHasLCat = "BiDi string can't have runes from category L" +var errFirstRune = "BiDi string first rune must have category R or AL" +var errLastRune = "BiDi string last rune must have category R or AL" + +// Check for prohibited characters from table C.8 +func checkBiDiProhibitedRune(s string) error { + for _, r := range s { + if TableC8.Contains(r) { + return Error{Msg: errProhibited, Rune: r} + } + } + return nil +} + +// Check for LCat characters from table D.2 +func checkBiDiLCat(s string) error { + for _, r := range s { + if TableD2.Contains(r) { + return Error{Msg: errHasLCat, Rune: r} + } + } + return nil +} + +// Check first and last characters are in table D.1; requires non-empty string +func checkBadFirstAndLastRandALCat(s string) error { + rs := []rune(s) + if !TableD1.Contains(rs[0]) { + return Error{Msg: errFirstRune, Rune: rs[0]} + } + n := len(rs) - 1 + if !TableD1.Contains(rs[n]) { + return Error{Msg: errLastRune, Rune: rs[n]} + } + return nil +} + +// Look for RandALCat characters from table D.1 +func hasBiDiRandALCat(s string) bool { + for _, r := range s { + if TableD1.Contains(r) { + return true + } + } + return false +} + +// Check that BiDi rules are satisfied ; let empty string pass this rule +func passesBiDiRules(s string) error { + if len(s) == 0 { + return nil + } + if err := checkBiDiProhibitedRune(s); err != nil { + return err + } + if hasBiDiRandALCat(s) { + if err := checkBiDiLCat(s); err != nil { + return err + } + if err := checkBadFirstAndLastRandALCat(s); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/xdg/stringprep/doc.go b/vendor/github.com/xdg/stringprep/doc.go new file mode 100644 index 00000000000..b319e081b75 --- /dev/null +++ b/vendor/github.com/xdg/stringprep/doc.go @@ -0,0 +1,10 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +// Package stringprep provides data tables and algorithms for RFC-3454, +// including errata (as of 2018-02). It also provides a profile for +// SASLprep as defined in RFC-4013. +package stringprep diff --git a/vendor/github.com/xdg/stringprep/error.go b/vendor/github.com/xdg/stringprep/error.go new file mode 100644 index 00000000000..7403e499119 --- /dev/null +++ b/vendor/github.com/xdg/stringprep/error.go @@ -0,0 +1,14 @@ +package stringprep + +import "fmt" + +// Error describes problems encountered during stringprep, including what rune +// was problematic. +type Error struct { + Msg string + Rune rune +} + +func (e Error) Error() string { + return fmt.Sprintf("%s (rune: '\\u%04x')", e.Msg, e.Rune) +} diff --git a/vendor/github.com/xdg/stringprep/map.go b/vendor/github.com/xdg/stringprep/map.go new file mode 100644 index 00000000000..e56a0dd43ed --- /dev/null +++ b/vendor/github.com/xdg/stringprep/map.go @@ -0,0 +1,21 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package stringprep + +// Mapping represents a stringprep mapping, from a single rune to zero or more +// runes. +type Mapping map[rune][]rune + +// Map maps a rune to a (possibly empty) rune slice via a stringprep Mapping. +// The ok return value is false if the rune was not found. +func (m Mapping) Map(r rune) (replacement []rune, ok bool) { + rs, ok := m[r] + if !ok { + return nil, false + } + return rs, true +} diff --git a/vendor/github.com/xdg/stringprep/profile.go b/vendor/github.com/xdg/stringprep/profile.go new file mode 100644 index 00000000000..5a73be9e548 --- /dev/null +++ b/vendor/github.com/xdg/stringprep/profile.go @@ -0,0 +1,75 @@ +package stringprep + +import ( + "golang.org/x/text/unicode/norm" +) + +// Profile represents a stringprep profile. +type Profile struct { + Mappings []Mapping + Normalize bool + Prohibits []Set + CheckBiDi bool +} + +var errProhibited = "prohibited character" + +// Prepare transforms an input string to an output string following +// the rules defined in the profile as defined by RFC-3454. +func (p Profile) Prepare(s string) (string, error) { + // Optimistically, assume output will be same length as input + temp := make([]rune, 0, len(s)) + + // Apply maps + for _, r := range s { + rs, ok := p.applyMaps(r) + if ok { + temp = append(temp, rs...) + } else { + temp = append(temp, r) + } + } + + // Normalize + var out string + if p.Normalize { + out = norm.NFKC.String(string(temp)) + } else { + out = string(temp) + } + + // Check prohibited + for _, r := range out { + if p.runeIsProhibited(r) { + return "", Error{Msg: errProhibited, Rune: r} + } + } + + // Check BiDi allowed + if p.CheckBiDi { + if err := passesBiDiRules(out); err != nil { + return "", err + } + } + + return out, nil +} + +func (p Profile) applyMaps(r rune) ([]rune, bool) { + for _, m := range p.Mappings { + rs, ok := m.Map(r) + if ok { + return rs, true + } + } + return nil, false +} + +func (p Profile) runeIsProhibited(r rune) bool { + for _, s := range p.Prohibits { + if s.Contains(r) { + return true + } + } + return false +} diff --git a/vendor/github.com/xdg/stringprep/saslprep.go b/vendor/github.com/xdg/stringprep/saslprep.go new file mode 100644 index 00000000000..40013488bfd --- /dev/null +++ b/vendor/github.com/xdg/stringprep/saslprep.go @@ -0,0 +1,52 @@ +package stringprep + +var mapNonASCIISpaceToASCIISpace = Mapping{ + 0x00A0: []rune{0x0020}, + 0x1680: []rune{0x0020}, + 0x2000: []rune{0x0020}, + 0x2001: []rune{0x0020}, + 0x2002: []rune{0x0020}, + 0x2003: []rune{0x0020}, + 0x2004: []rune{0x0020}, + 0x2005: []rune{0x0020}, + 0x2006: []rune{0x0020}, + 0x2007: []rune{0x0020}, + 0x2008: []rune{0x0020}, + 0x2009: []rune{0x0020}, + 0x200A: []rune{0x0020}, + 0x200B: []rune{0x0020}, + 0x202F: []rune{0x0020}, + 0x205F: []rune{0x0020}, + 0x3000: []rune{0x0020}, +} + +// SASLprep is a pre-defined stringprep profile for user names and passwords +// as described in RFC-4013. +// +// Because the stringprep distinction between query and stored strings was +// intended for compatibility across profile versions, but SASLprep was never +// updated and is now deprecated, this profile only operates in stored +// strings mode, prohibiting unassigned code points. +var SASLprep Profile = saslprep + +var saslprep = Profile{ + Mappings: []Mapping{ + TableB1, + mapNonASCIISpaceToASCIISpace, + }, + Normalize: true, + Prohibits: []Set{ + TableA1, + TableC1_2, + TableC2_1, + TableC2_2, + TableC3, + TableC4, + TableC5, + TableC6, + TableC7, + TableC8, + TableC9, + }, + CheckBiDi: true, +} diff --git a/vendor/github.com/xdg/stringprep/set.go b/vendor/github.com/xdg/stringprep/set.go new file mode 100644 index 00000000000..c837e28c88a --- /dev/null +++ b/vendor/github.com/xdg/stringprep/set.go @@ -0,0 +1,36 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package stringprep + +import "sort" + +// RuneRange represents a close-ended range of runes: [N,M]. For a range +// consisting of a single rune, N and M will be equal. +type RuneRange [2]rune + +// Contains returns true if a rune is within the bounds of the RuneRange. +func (rr RuneRange) Contains(r rune) bool { + return rr[0] <= r && r <= rr[1] +} + +func (rr RuneRange) isAbove(r rune) bool { + return r <= rr[0] +} + +// Set represents a stringprep data table used to identify runes of a +// particular type. +type Set []RuneRange + +// Contains returns true if a rune is within any of the RuneRanges in the +// Set. +func (s Set) Contains(r rune) bool { + i := sort.Search(len(s), func(i int) bool { return s[i].Contains(r) || s[i].isAbove(r) }) + if i < len(s) && s[i].Contains(r) { + return true + } + return false +} diff --git a/vendor/github.com/xdg/stringprep/tables.go b/vendor/github.com/xdg/stringprep/tables.go new file mode 100644 index 00000000000..c3fc1fa0fae --- /dev/null +++ b/vendor/github.com/xdg/stringprep/tables.go @@ -0,0 +1,3215 @@ +// Copyright 2018 by David A. Golden. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + +package stringprep + +var tableA1 = Set{ + RuneRange{0x0221, 0x0221}, + RuneRange{0x0234, 0x024F}, + RuneRange{0x02AE, 0x02AF}, + RuneRange{0x02EF, 0x02FF}, + RuneRange{0x0350, 0x035F}, + RuneRange{0x0370, 0x0373}, + RuneRange{0x0376, 0x0379}, + RuneRange{0x037B, 0x037D}, + RuneRange{0x037F, 0x0383}, + RuneRange{0x038B, 0x038B}, + RuneRange{0x038D, 0x038D}, + RuneRange{0x03A2, 0x03A2}, + RuneRange{0x03CF, 0x03CF}, + RuneRange{0x03F7, 0x03FF}, + RuneRange{0x0487, 0x0487}, + RuneRange{0x04CF, 0x04CF}, + RuneRange{0x04F6, 0x04F7}, + RuneRange{0x04FA, 0x04FF}, + RuneRange{0x0510, 0x0530}, + RuneRange{0x0557, 0x0558}, + RuneRange{0x0560, 0x0560}, + RuneRange{0x0588, 0x0588}, + RuneRange{0x058B, 0x0590}, + RuneRange{0x05A2, 0x05A2}, + RuneRange{0x05BA, 0x05BA}, + RuneRange{0x05C5, 0x05CF}, + RuneRange{0x05EB, 0x05EF}, + RuneRange{0x05F5, 0x060B}, + RuneRange{0x060D, 0x061A}, + RuneRange{0x061C, 0x061E}, + RuneRange{0x0620, 0x0620}, + RuneRange{0x063B, 0x063F}, + RuneRange{0x0656, 0x065F}, + RuneRange{0x06EE, 0x06EF}, + RuneRange{0x06FF, 0x06FF}, + RuneRange{0x070E, 0x070E}, + RuneRange{0x072D, 0x072F}, + RuneRange{0x074B, 0x077F}, + RuneRange{0x07B2, 0x0900}, + RuneRange{0x0904, 0x0904}, + RuneRange{0x093A, 0x093B}, + RuneRange{0x094E, 0x094F}, + RuneRange{0x0955, 0x0957}, + RuneRange{0x0971, 0x0980}, + RuneRange{0x0984, 0x0984}, + RuneRange{0x098D, 0x098E}, + RuneRange{0x0991, 0x0992}, + RuneRange{0x09A9, 0x09A9}, + RuneRange{0x09B1, 0x09B1}, + RuneRange{0x09B3, 0x09B5}, + RuneRange{0x09BA, 0x09BB}, + RuneRange{0x09BD, 0x09BD}, + RuneRange{0x09C5, 0x09C6}, + RuneRange{0x09C9, 0x09CA}, + RuneRange{0x09CE, 0x09D6}, + RuneRange{0x09D8, 0x09DB}, + RuneRange{0x09DE, 0x09DE}, + RuneRange{0x09E4, 0x09E5}, + RuneRange{0x09FB, 0x0A01}, + RuneRange{0x0A03, 0x0A04}, + RuneRange{0x0A0B, 0x0A0E}, + RuneRange{0x0A11, 0x0A12}, + RuneRange{0x0A29, 0x0A29}, + RuneRange{0x0A31, 0x0A31}, + RuneRange{0x0A34, 0x0A34}, + RuneRange{0x0A37, 0x0A37}, + RuneRange{0x0A3A, 0x0A3B}, + RuneRange{0x0A3D, 0x0A3D}, + RuneRange{0x0A43, 0x0A46}, + RuneRange{0x0A49, 0x0A4A}, + RuneRange{0x0A4E, 0x0A58}, + RuneRange{0x0A5D, 0x0A5D}, + RuneRange{0x0A5F, 0x0A65}, + RuneRange{0x0A75, 0x0A80}, + RuneRange{0x0A84, 0x0A84}, + RuneRange{0x0A8C, 0x0A8C}, + RuneRange{0x0A8E, 0x0A8E}, + RuneRange{0x0A92, 0x0A92}, + RuneRange{0x0AA9, 0x0AA9}, + RuneRange{0x0AB1, 0x0AB1}, + RuneRange{0x0AB4, 0x0AB4}, + RuneRange{0x0ABA, 0x0ABB}, + RuneRange{0x0AC6, 0x0AC6}, + RuneRange{0x0ACA, 0x0ACA}, + RuneRange{0x0ACE, 0x0ACF}, + RuneRange{0x0AD1, 0x0ADF}, + RuneRange{0x0AE1, 0x0AE5}, + RuneRange{0x0AF0, 0x0B00}, + RuneRange{0x0B04, 0x0B04}, + RuneRange{0x0B0D, 0x0B0E}, + RuneRange{0x0B11, 0x0B12}, + RuneRange{0x0B29, 0x0B29}, + RuneRange{0x0B31, 0x0B31}, + RuneRange{0x0B34, 0x0B35}, + RuneRange{0x0B3A, 0x0B3B}, + RuneRange{0x0B44, 0x0B46}, + RuneRange{0x0B49, 0x0B4A}, + RuneRange{0x0B4E, 0x0B55}, + RuneRange{0x0B58, 0x0B5B}, + RuneRange{0x0B5E, 0x0B5E}, + RuneRange{0x0B62, 0x0B65}, + RuneRange{0x0B71, 0x0B81}, + RuneRange{0x0B84, 0x0B84}, + RuneRange{0x0B8B, 0x0B8D}, + RuneRange{0x0B91, 0x0B91}, + RuneRange{0x0B96, 0x0B98}, + RuneRange{0x0B9B, 0x0B9B}, + RuneRange{0x0B9D, 0x0B9D}, + RuneRange{0x0BA0, 0x0BA2}, + RuneRange{0x0BA5, 0x0BA7}, + RuneRange{0x0BAB, 0x0BAD}, + RuneRange{0x0BB6, 0x0BB6}, + RuneRange{0x0BBA, 0x0BBD}, + RuneRange{0x0BC3, 0x0BC5}, + RuneRange{0x0BC9, 0x0BC9}, + RuneRange{0x0BCE, 0x0BD6}, + RuneRange{0x0BD8, 0x0BE6}, + RuneRange{0x0BF3, 0x0C00}, + RuneRange{0x0C04, 0x0C04}, + RuneRange{0x0C0D, 0x0C0D}, + RuneRange{0x0C11, 0x0C11}, + RuneRange{0x0C29, 0x0C29}, + RuneRange{0x0C34, 0x0C34}, + RuneRange{0x0C3A, 0x0C3D}, + RuneRange{0x0C45, 0x0C45}, + RuneRange{0x0C49, 0x0C49}, + RuneRange{0x0C4E, 0x0C54}, + RuneRange{0x0C57, 0x0C5F}, + RuneRange{0x0C62, 0x0C65}, + RuneRange{0x0C70, 0x0C81}, + RuneRange{0x0C84, 0x0C84}, + RuneRange{0x0C8D, 0x0C8D}, + RuneRange{0x0C91, 0x0C91}, + RuneRange{0x0CA9, 0x0CA9}, + RuneRange{0x0CB4, 0x0CB4}, + RuneRange{0x0CBA, 0x0CBD}, + RuneRange{0x0CC5, 0x0CC5}, + RuneRange{0x0CC9, 0x0CC9}, + RuneRange{0x0CCE, 0x0CD4}, + RuneRange{0x0CD7, 0x0CDD}, + RuneRange{0x0CDF, 0x0CDF}, + RuneRange{0x0CE2, 0x0CE5}, + RuneRange{0x0CF0, 0x0D01}, + RuneRange{0x0D04, 0x0D04}, + RuneRange{0x0D0D, 0x0D0D}, + RuneRange{0x0D11, 0x0D11}, + RuneRange{0x0D29, 0x0D29}, + RuneRange{0x0D3A, 0x0D3D}, + RuneRange{0x0D44, 0x0D45}, + RuneRange{0x0D49, 0x0D49}, + RuneRange{0x0D4E, 0x0D56}, + RuneRange{0x0D58, 0x0D5F}, + RuneRange{0x0D62, 0x0D65}, + RuneRange{0x0D70, 0x0D81}, + RuneRange{0x0D84, 0x0D84}, + RuneRange{0x0D97, 0x0D99}, + RuneRange{0x0DB2, 0x0DB2}, + RuneRange{0x0DBC, 0x0DBC}, + RuneRange{0x0DBE, 0x0DBF}, + RuneRange{0x0DC7, 0x0DC9}, + RuneRange{0x0DCB, 0x0DCE}, + RuneRange{0x0DD5, 0x0DD5}, + RuneRange{0x0DD7, 0x0DD7}, + RuneRange{0x0DE0, 0x0DF1}, + RuneRange{0x0DF5, 0x0E00}, + RuneRange{0x0E3B, 0x0E3E}, + RuneRange{0x0E5C, 0x0E80}, + RuneRange{0x0E83, 0x0E83}, + RuneRange{0x0E85, 0x0E86}, + RuneRange{0x0E89, 0x0E89}, + RuneRange{0x0E8B, 0x0E8C}, + RuneRange{0x0E8E, 0x0E93}, + RuneRange{0x0E98, 0x0E98}, + RuneRange{0x0EA0, 0x0EA0}, + RuneRange{0x0EA4, 0x0EA4}, + RuneRange{0x0EA6, 0x0EA6}, + RuneRange{0x0EA8, 0x0EA9}, + RuneRange{0x0EAC, 0x0EAC}, + RuneRange{0x0EBA, 0x0EBA}, + RuneRange{0x0EBE, 0x0EBF}, + RuneRange{0x0EC5, 0x0EC5}, + RuneRange{0x0EC7, 0x0EC7}, + RuneRange{0x0ECE, 0x0ECF}, + RuneRange{0x0EDA, 0x0EDB}, + RuneRange{0x0EDE, 0x0EFF}, + RuneRange{0x0F48, 0x0F48}, + RuneRange{0x0F6B, 0x0F70}, + RuneRange{0x0F8C, 0x0F8F}, + RuneRange{0x0F98, 0x0F98}, + RuneRange{0x0FBD, 0x0FBD}, + RuneRange{0x0FCD, 0x0FCE}, + RuneRange{0x0FD0, 0x0FFF}, + RuneRange{0x1022, 0x1022}, + RuneRange{0x1028, 0x1028}, + RuneRange{0x102B, 0x102B}, + RuneRange{0x1033, 0x1035}, + RuneRange{0x103A, 0x103F}, + RuneRange{0x105A, 0x109F}, + RuneRange{0x10C6, 0x10CF}, + RuneRange{0x10F9, 0x10FA}, + RuneRange{0x10FC, 0x10FF}, + RuneRange{0x115A, 0x115E}, + RuneRange{0x11A3, 0x11A7}, + RuneRange{0x11FA, 0x11FF}, + RuneRange{0x1207, 0x1207}, + RuneRange{0x1247, 0x1247}, + RuneRange{0x1249, 0x1249}, + RuneRange{0x124E, 0x124F}, + RuneRange{0x1257, 0x1257}, + RuneRange{0x1259, 0x1259}, + RuneRange{0x125E, 0x125F}, + RuneRange{0x1287, 0x1287}, + RuneRange{0x1289, 0x1289}, + RuneRange{0x128E, 0x128F}, + RuneRange{0x12AF, 0x12AF}, + RuneRange{0x12B1, 0x12B1}, + RuneRange{0x12B6, 0x12B7}, + RuneRange{0x12BF, 0x12BF}, + RuneRange{0x12C1, 0x12C1}, + RuneRange{0x12C6, 0x12C7}, + RuneRange{0x12CF, 0x12CF}, + RuneRange{0x12D7, 0x12D7}, + RuneRange{0x12EF, 0x12EF}, + RuneRange{0x130F, 0x130F}, + RuneRange{0x1311, 0x1311}, + RuneRange{0x1316, 0x1317}, + RuneRange{0x131F, 0x131F}, + RuneRange{0x1347, 0x1347}, + RuneRange{0x135B, 0x1360}, + RuneRange{0x137D, 0x139F}, + RuneRange{0x13F5, 0x1400}, + RuneRange{0x1677, 0x167F}, + RuneRange{0x169D, 0x169F}, + RuneRange{0x16F1, 0x16FF}, + RuneRange{0x170D, 0x170D}, + RuneRange{0x1715, 0x171F}, + RuneRange{0x1737, 0x173F}, + RuneRange{0x1754, 0x175F}, + RuneRange{0x176D, 0x176D}, + RuneRange{0x1771, 0x1771}, + RuneRange{0x1774, 0x177F}, + RuneRange{0x17DD, 0x17DF}, + RuneRange{0x17EA, 0x17FF}, + RuneRange{0x180F, 0x180F}, + RuneRange{0x181A, 0x181F}, + RuneRange{0x1878, 0x187F}, + RuneRange{0x18AA, 0x1DFF}, + RuneRange{0x1E9C, 0x1E9F}, + RuneRange{0x1EFA, 0x1EFF}, + RuneRange{0x1F16, 0x1F17}, + RuneRange{0x1F1E, 0x1F1F}, + RuneRange{0x1F46, 0x1F47}, + RuneRange{0x1F4E, 0x1F4F}, + RuneRange{0x1F58, 0x1F58}, + RuneRange{0x1F5A, 0x1F5A}, + RuneRange{0x1F5C, 0x1F5C}, + RuneRange{0x1F5E, 0x1F5E}, + RuneRange{0x1F7E, 0x1F7F}, + RuneRange{0x1FB5, 0x1FB5}, + RuneRange{0x1FC5, 0x1FC5}, + RuneRange{0x1FD4, 0x1FD5}, + RuneRange{0x1FDC, 0x1FDC}, + RuneRange{0x1FF0, 0x1FF1}, + RuneRange{0x1FF5, 0x1FF5}, + RuneRange{0x1FFF, 0x1FFF}, + RuneRange{0x2053, 0x2056}, + RuneRange{0x2058, 0x205E}, + RuneRange{0x2064, 0x2069}, + RuneRange{0x2072, 0x2073}, + RuneRange{0x208F, 0x209F}, + RuneRange{0x20B2, 0x20CF}, + RuneRange{0x20EB, 0x20FF}, + RuneRange{0x213B, 0x213C}, + RuneRange{0x214C, 0x2152}, + RuneRange{0x2184, 0x218F}, + RuneRange{0x23CF, 0x23FF}, + RuneRange{0x2427, 0x243F}, + RuneRange{0x244B, 0x245F}, + RuneRange{0x24FF, 0x24FF}, + RuneRange{0x2614, 0x2615}, + RuneRange{0x2618, 0x2618}, + RuneRange{0x267E, 0x267F}, + RuneRange{0x268A, 0x2700}, + RuneRange{0x2705, 0x2705}, + RuneRange{0x270A, 0x270B}, + RuneRange{0x2728, 0x2728}, + RuneRange{0x274C, 0x274C}, + RuneRange{0x274E, 0x274E}, + RuneRange{0x2753, 0x2755}, + RuneRange{0x2757, 0x2757}, + RuneRange{0x275F, 0x2760}, + RuneRange{0x2795, 0x2797}, + RuneRange{0x27B0, 0x27B0}, + RuneRange{0x27BF, 0x27CF}, + RuneRange{0x27EC, 0x27EF}, + RuneRange{0x2B00, 0x2E7F}, + RuneRange{0x2E9A, 0x2E9A}, + RuneRange{0x2EF4, 0x2EFF}, + RuneRange{0x2FD6, 0x2FEF}, + RuneRange{0x2FFC, 0x2FFF}, + RuneRange{0x3040, 0x3040}, + RuneRange{0x3097, 0x3098}, + RuneRange{0x3100, 0x3104}, + RuneRange{0x312D, 0x3130}, + RuneRange{0x318F, 0x318F}, + RuneRange{0x31B8, 0x31EF}, + RuneRange{0x321D, 0x321F}, + RuneRange{0x3244, 0x3250}, + RuneRange{0x327C, 0x327E}, + RuneRange{0x32CC, 0x32CF}, + RuneRange{0x32FF, 0x32FF}, + RuneRange{0x3377, 0x337A}, + RuneRange{0x33DE, 0x33DF}, + RuneRange{0x33FF, 0x33FF}, + RuneRange{0x4DB6, 0x4DFF}, + RuneRange{0x9FA6, 0x9FFF}, + RuneRange{0xA48D, 0xA48F}, + RuneRange{0xA4C7, 0xABFF}, + RuneRange{0xD7A4, 0xD7FF}, + RuneRange{0xFA2E, 0xFA2F}, + RuneRange{0xFA6B, 0xFAFF}, + RuneRange{0xFB07, 0xFB12}, + RuneRange{0xFB18, 0xFB1C}, + RuneRange{0xFB37, 0xFB37}, + RuneRange{0xFB3D, 0xFB3D}, + RuneRange{0xFB3F, 0xFB3F}, + RuneRange{0xFB42, 0xFB42}, + RuneRange{0xFB45, 0xFB45}, + RuneRange{0xFBB2, 0xFBD2}, + RuneRange{0xFD40, 0xFD4F}, + RuneRange{0xFD90, 0xFD91}, + RuneRange{0xFDC8, 0xFDCF}, + RuneRange{0xFDFD, 0xFDFF}, + RuneRange{0xFE10, 0xFE1F}, + RuneRange{0xFE24, 0xFE2F}, + RuneRange{0xFE47, 0xFE48}, + RuneRange{0xFE53, 0xFE53}, + RuneRange{0xFE67, 0xFE67}, + RuneRange{0xFE6C, 0xFE6F}, + RuneRange{0xFE75, 0xFE75}, + RuneRange{0xFEFD, 0xFEFE}, + RuneRange{0xFF00, 0xFF00}, + RuneRange{0xFFBF, 0xFFC1}, + RuneRange{0xFFC8, 0xFFC9}, + RuneRange{0xFFD0, 0xFFD1}, + RuneRange{0xFFD8, 0xFFD9}, + RuneRange{0xFFDD, 0xFFDF}, + RuneRange{0xFFE7, 0xFFE7}, + RuneRange{0xFFEF, 0xFFF8}, + RuneRange{0x10000, 0x102FF}, + RuneRange{0x1031F, 0x1031F}, + RuneRange{0x10324, 0x1032F}, + RuneRange{0x1034B, 0x103FF}, + RuneRange{0x10426, 0x10427}, + RuneRange{0x1044E, 0x1CFFF}, + RuneRange{0x1D0F6, 0x1D0FF}, + RuneRange{0x1D127, 0x1D129}, + RuneRange{0x1D1DE, 0x1D3FF}, + RuneRange{0x1D455, 0x1D455}, + RuneRange{0x1D49D, 0x1D49D}, + RuneRange{0x1D4A0, 0x1D4A1}, + RuneRange{0x1D4A3, 0x1D4A4}, + RuneRange{0x1D4A7, 0x1D4A8}, + RuneRange{0x1D4AD, 0x1D4AD}, + RuneRange{0x1D4BA, 0x1D4BA}, + RuneRange{0x1D4BC, 0x1D4BC}, + RuneRange{0x1D4C1, 0x1D4C1}, + RuneRange{0x1D4C4, 0x1D4C4}, + RuneRange{0x1D506, 0x1D506}, + RuneRange{0x1D50B, 0x1D50C}, + RuneRange{0x1D515, 0x1D515}, + RuneRange{0x1D51D, 0x1D51D}, + RuneRange{0x1D53A, 0x1D53A}, + RuneRange{0x1D53F, 0x1D53F}, + RuneRange{0x1D545, 0x1D545}, + RuneRange{0x1D547, 0x1D549}, + RuneRange{0x1D551, 0x1D551}, + RuneRange{0x1D6A4, 0x1D6A7}, + RuneRange{0x1D7CA, 0x1D7CD}, + RuneRange{0x1D800, 0x1FFFD}, + RuneRange{0x2A6D7, 0x2F7FF}, + RuneRange{0x2FA1E, 0x2FFFD}, + RuneRange{0x30000, 0x3FFFD}, + RuneRange{0x40000, 0x4FFFD}, + RuneRange{0x50000, 0x5FFFD}, + RuneRange{0x60000, 0x6FFFD}, + RuneRange{0x70000, 0x7FFFD}, + RuneRange{0x80000, 0x8FFFD}, + RuneRange{0x90000, 0x9FFFD}, + RuneRange{0xA0000, 0xAFFFD}, + RuneRange{0xB0000, 0xBFFFD}, + RuneRange{0xC0000, 0xCFFFD}, + RuneRange{0xD0000, 0xDFFFD}, + RuneRange{0xE0000, 0xE0000}, + RuneRange{0xE0002, 0xE001F}, + RuneRange{0xE0080, 0xEFFFD}, +} + +// TableA1 represents RFC-3454 Table A.1. +var TableA1 Set = tableA1 + +var tableB1 = Mapping{ + 0x00AD: []rune{}, // Map to nothing + 0x034F: []rune{}, // Map to nothing + 0x180B: []rune{}, // Map to nothing + 0x180C: []rune{}, // Map to nothing + 0x180D: []rune{}, // Map to nothing + 0x200B: []rune{}, // Map to nothing + 0x200C: []rune{}, // Map to nothing + 0x200D: []rune{}, // Map to nothing + 0x2060: []rune{}, // Map to nothing + 0xFE00: []rune{}, // Map to nothing + 0xFE01: []rune{}, // Map to nothing + 0xFE02: []rune{}, // Map to nothing + 0xFE03: []rune{}, // Map to nothing + 0xFE04: []rune{}, // Map to nothing + 0xFE05: []rune{}, // Map to nothing + 0xFE06: []rune{}, // Map to nothing + 0xFE07: []rune{}, // Map to nothing + 0xFE08: []rune{}, // Map to nothing + 0xFE09: []rune{}, // Map to nothing + 0xFE0A: []rune{}, // Map to nothing + 0xFE0B: []rune{}, // Map to nothing + 0xFE0C: []rune{}, // Map to nothing + 0xFE0D: []rune{}, // Map to nothing + 0xFE0E: []rune{}, // Map to nothing + 0xFE0F: []rune{}, // Map to nothing + 0xFEFF: []rune{}, // Map to nothing +} + +// TableB1 represents RFC-3454 Table B.1. +var TableB1 Mapping = tableB1 + +var tableB2 = Mapping{ + 0x0041: []rune{0x0061}, // Case map + 0x0042: []rune{0x0062}, // Case map + 0x0043: []rune{0x0063}, // Case map + 0x0044: []rune{0x0064}, // Case map + 0x0045: []rune{0x0065}, // Case map + 0x0046: []rune{0x0066}, // Case map + 0x0047: []rune{0x0067}, // Case map + 0x0048: []rune{0x0068}, // Case map + 0x0049: []rune{0x0069}, // Case map + 0x004A: []rune{0x006A}, // Case map + 0x004B: []rune{0x006B}, // Case map + 0x004C: []rune{0x006C}, // Case map + 0x004D: []rune{0x006D}, // Case map + 0x004E: []rune{0x006E}, // Case map + 0x004F: []rune{0x006F}, // Case map + 0x0050: []rune{0x0070}, // Case map + 0x0051: []rune{0x0071}, // Case map + 0x0052: []rune{0x0072}, // Case map + 0x0053: []rune{0x0073}, // Case map + 0x0054: []rune{0x0074}, // Case map + 0x0055: []rune{0x0075}, // Case map + 0x0056: []rune{0x0076}, // Case map + 0x0057: []rune{0x0077}, // Case map + 0x0058: []rune{0x0078}, // Case map + 0x0059: []rune{0x0079}, // Case map + 0x005A: []rune{0x007A}, // Case map + 0x00B5: []rune{0x03BC}, // Case map + 0x00C0: []rune{0x00E0}, // Case map + 0x00C1: []rune{0x00E1}, // Case map + 0x00C2: []rune{0x00E2}, // Case map + 0x00C3: []rune{0x00E3}, // Case map + 0x00C4: []rune{0x00E4}, // Case map + 0x00C5: []rune{0x00E5}, // Case map + 0x00C6: []rune{0x00E6}, // Case map + 0x00C7: []rune{0x00E7}, // Case map + 0x00C8: []rune{0x00E8}, // Case map + 0x00C9: []rune{0x00E9}, // Case map + 0x00CA: []rune{0x00EA}, // Case map + 0x00CB: []rune{0x00EB}, // Case map + 0x00CC: []rune{0x00EC}, // Case map + 0x00CD: []rune{0x00ED}, // Case map + 0x00CE: []rune{0x00EE}, // Case map + 0x00CF: []rune{0x00EF}, // Case map + 0x00D0: []rune{0x00F0}, // Case map + 0x00D1: []rune{0x00F1}, // Case map + 0x00D2: []rune{0x00F2}, // Case map + 0x00D3: []rune{0x00F3}, // Case map + 0x00D4: []rune{0x00F4}, // Case map + 0x00D5: []rune{0x00F5}, // Case map + 0x00D6: []rune{0x00F6}, // Case map + 0x00D8: []rune{0x00F8}, // Case map + 0x00D9: []rune{0x00F9}, // Case map + 0x00DA: []rune{0x00FA}, // Case map + 0x00DB: []rune{0x00FB}, // Case map + 0x00DC: []rune{0x00FC}, // Case map + 0x00DD: []rune{0x00FD}, // Case map + 0x00DE: []rune{0x00FE}, // Case map + 0x00DF: []rune{0x0073, 0x0073}, // Case map + 0x0100: []rune{0x0101}, // Case map + 0x0102: []rune{0x0103}, // Case map + 0x0104: []rune{0x0105}, // Case map + 0x0106: []rune{0x0107}, // Case map + 0x0108: []rune{0x0109}, // Case map + 0x010A: []rune{0x010B}, // Case map + 0x010C: []rune{0x010D}, // Case map + 0x010E: []rune{0x010F}, // Case map + 0x0110: []rune{0x0111}, // Case map + 0x0112: []rune{0x0113}, // Case map + 0x0114: []rune{0x0115}, // Case map + 0x0116: []rune{0x0117}, // Case map + 0x0118: []rune{0x0119}, // Case map + 0x011A: []rune{0x011B}, // Case map + 0x011C: []rune{0x011D}, // Case map + 0x011E: []rune{0x011F}, // Case map + 0x0120: []rune{0x0121}, // Case map + 0x0122: []rune{0x0123}, // Case map + 0x0124: []rune{0x0125}, // Case map + 0x0126: []rune{0x0127}, // Case map + 0x0128: []rune{0x0129}, // Case map + 0x012A: []rune{0x012B}, // Case map + 0x012C: []rune{0x012D}, // Case map + 0x012E: []rune{0x012F}, // Case map + 0x0130: []rune{0x0069, 0x0307}, // Case map + 0x0132: []rune{0x0133}, // Case map + 0x0134: []rune{0x0135}, // Case map + 0x0136: []rune{0x0137}, // Case map + 0x0139: []rune{0x013A}, // Case map + 0x013B: []rune{0x013C}, // Case map + 0x013D: []rune{0x013E}, // Case map + 0x013F: []rune{0x0140}, // Case map + 0x0141: []rune{0x0142}, // Case map + 0x0143: []rune{0x0144}, // Case map + 0x0145: []rune{0x0146}, // Case map + 0x0147: []rune{0x0148}, // Case map + 0x0149: []rune{0x02BC, 0x006E}, // Case map + 0x014A: []rune{0x014B}, // Case map + 0x014C: []rune{0x014D}, // Case map + 0x014E: []rune{0x014F}, // Case map + 0x0150: []rune{0x0151}, // Case map + 0x0152: []rune{0x0153}, // Case map + 0x0154: []rune{0x0155}, // Case map + 0x0156: []rune{0x0157}, // Case map + 0x0158: []rune{0x0159}, // Case map + 0x015A: []rune{0x015B}, // Case map + 0x015C: []rune{0x015D}, // Case map + 0x015E: []rune{0x015F}, // Case map + 0x0160: []rune{0x0161}, // Case map + 0x0162: []rune{0x0163}, // Case map + 0x0164: []rune{0x0165}, // Case map + 0x0166: []rune{0x0167}, // Case map + 0x0168: []rune{0x0169}, // Case map + 0x016A: []rune{0x016B}, // Case map + 0x016C: []rune{0x016D}, // Case map + 0x016E: []rune{0x016F}, // Case map + 0x0170: []rune{0x0171}, // Case map + 0x0172: []rune{0x0173}, // Case map + 0x0174: []rune{0x0175}, // Case map + 0x0176: []rune{0x0177}, // Case map + 0x0178: []rune{0x00FF}, // Case map + 0x0179: []rune{0x017A}, // Case map + 0x017B: []rune{0x017C}, // Case map + 0x017D: []rune{0x017E}, // Case map + 0x017F: []rune{0x0073}, // Case map + 0x0181: []rune{0x0253}, // Case map + 0x0182: []rune{0x0183}, // Case map + 0x0184: []rune{0x0185}, // Case map + 0x0186: []rune{0x0254}, // Case map + 0x0187: []rune{0x0188}, // Case map + 0x0189: []rune{0x0256}, // Case map + 0x018A: []rune{0x0257}, // Case map + 0x018B: []rune{0x018C}, // Case map + 0x018E: []rune{0x01DD}, // Case map + 0x018F: []rune{0x0259}, // Case map + 0x0190: []rune{0x025B}, // Case map + 0x0191: []rune{0x0192}, // Case map + 0x0193: []rune{0x0260}, // Case map + 0x0194: []rune{0x0263}, // Case map + 0x0196: []rune{0x0269}, // Case map + 0x0197: []rune{0x0268}, // Case map + 0x0198: []rune{0x0199}, // Case map + 0x019C: []rune{0x026F}, // Case map + 0x019D: []rune{0x0272}, // Case map + 0x019F: []rune{0x0275}, // Case map + 0x01A0: []rune{0x01A1}, // Case map + 0x01A2: []rune{0x01A3}, // Case map + 0x01A4: []rune{0x01A5}, // Case map + 0x01A6: []rune{0x0280}, // Case map + 0x01A7: []rune{0x01A8}, // Case map + 0x01A9: []rune{0x0283}, // Case map + 0x01AC: []rune{0x01AD}, // Case map + 0x01AE: []rune{0x0288}, // Case map + 0x01AF: []rune{0x01B0}, // Case map + 0x01B1: []rune{0x028A}, // Case map + 0x01B2: []rune{0x028B}, // Case map + 0x01B3: []rune{0x01B4}, // Case map + 0x01B5: []rune{0x01B6}, // Case map + 0x01B7: []rune{0x0292}, // Case map + 0x01B8: []rune{0x01B9}, // Case map + 0x01BC: []rune{0x01BD}, // Case map + 0x01C4: []rune{0x01C6}, // Case map + 0x01C5: []rune{0x01C6}, // Case map + 0x01C7: []rune{0x01C9}, // Case map + 0x01C8: []rune{0x01C9}, // Case map + 0x01CA: []rune{0x01CC}, // Case map + 0x01CB: []rune{0x01CC}, // Case map + 0x01CD: []rune{0x01CE}, // Case map + 0x01CF: []rune{0x01D0}, // Case map + 0x01D1: []rune{0x01D2}, // Case map + 0x01D3: []rune{0x01D4}, // Case map + 0x01D5: []rune{0x01D6}, // Case map + 0x01D7: []rune{0x01D8}, // Case map + 0x01D9: []rune{0x01DA}, // Case map + 0x01DB: []rune{0x01DC}, // Case map + 0x01DE: []rune{0x01DF}, // Case map + 0x01E0: []rune{0x01E1}, // Case map + 0x01E2: []rune{0x01E3}, // Case map + 0x01E4: []rune{0x01E5}, // Case map + 0x01E6: []rune{0x01E7}, // Case map + 0x01E8: []rune{0x01E9}, // Case map + 0x01EA: []rune{0x01EB}, // Case map + 0x01EC: []rune{0x01ED}, // Case map + 0x01EE: []rune{0x01EF}, // Case map + 0x01F0: []rune{0x006A, 0x030C}, // Case map + 0x01F1: []rune{0x01F3}, // Case map + 0x01F2: []rune{0x01F3}, // Case map + 0x01F4: []rune{0x01F5}, // Case map + 0x01F6: []rune{0x0195}, // Case map + 0x01F7: []rune{0x01BF}, // Case map + 0x01F8: []rune{0x01F9}, // Case map + 0x01FA: []rune{0x01FB}, // Case map + 0x01FC: []rune{0x01FD}, // Case map + 0x01FE: []rune{0x01FF}, // Case map + 0x0200: []rune{0x0201}, // Case map + 0x0202: []rune{0x0203}, // Case map + 0x0204: []rune{0x0205}, // Case map + 0x0206: []rune{0x0207}, // Case map + 0x0208: []rune{0x0209}, // Case map + 0x020A: []rune{0x020B}, // Case map + 0x020C: []rune{0x020D}, // Case map + 0x020E: []rune{0x020F}, // Case map + 0x0210: []rune{0x0211}, // Case map + 0x0212: []rune{0x0213}, // Case map + 0x0214: []rune{0x0215}, // Case map + 0x0216: []rune{0x0217}, // Case map + 0x0218: []rune{0x0219}, // Case map + 0x021A: []rune{0x021B}, // Case map + 0x021C: []rune{0x021D}, // Case map + 0x021E: []rune{0x021F}, // Case map + 0x0220: []rune{0x019E}, // Case map + 0x0222: []rune{0x0223}, // Case map + 0x0224: []rune{0x0225}, // Case map + 0x0226: []rune{0x0227}, // Case map + 0x0228: []rune{0x0229}, // Case map + 0x022A: []rune{0x022B}, // Case map + 0x022C: []rune{0x022D}, // Case map + 0x022E: []rune{0x022F}, // Case map + 0x0230: []rune{0x0231}, // Case map + 0x0232: []rune{0x0233}, // Case map + 0x0345: []rune{0x03B9}, // Case map + 0x037A: []rune{0x0020, 0x03B9}, // Additional folding + 0x0386: []rune{0x03AC}, // Case map + 0x0388: []rune{0x03AD}, // Case map + 0x0389: []rune{0x03AE}, // Case map + 0x038A: []rune{0x03AF}, // Case map + 0x038C: []rune{0x03CC}, // Case map + 0x038E: []rune{0x03CD}, // Case map + 0x038F: []rune{0x03CE}, // Case map + 0x0390: []rune{0x03B9, 0x0308, 0x0301}, // Case map + 0x0391: []rune{0x03B1}, // Case map + 0x0392: []rune{0x03B2}, // Case map + 0x0393: []rune{0x03B3}, // Case map + 0x0394: []rune{0x03B4}, // Case map + 0x0395: []rune{0x03B5}, // Case map + 0x0396: []rune{0x03B6}, // Case map + 0x0397: []rune{0x03B7}, // Case map + 0x0398: []rune{0x03B8}, // Case map + 0x0399: []rune{0x03B9}, // Case map + 0x039A: []rune{0x03BA}, // Case map + 0x039B: []rune{0x03BB}, // Case map + 0x039C: []rune{0x03BC}, // Case map + 0x039D: []rune{0x03BD}, // Case map + 0x039E: []rune{0x03BE}, // Case map + 0x039F: []rune{0x03BF}, // Case map + 0x03A0: []rune{0x03C0}, // Case map + 0x03A1: []rune{0x03C1}, // Case map + 0x03A3: []rune{0x03C3}, // Case map + 0x03A4: []rune{0x03C4}, // Case map + 0x03A5: []rune{0x03C5}, // Case map + 0x03A6: []rune{0x03C6}, // Case map + 0x03A7: []rune{0x03C7}, // Case map + 0x03A8: []rune{0x03C8}, // Case map + 0x03A9: []rune{0x03C9}, // Case map + 0x03AA: []rune{0x03CA}, // Case map + 0x03AB: []rune{0x03CB}, // Case map + 0x03B0: []rune{0x03C5, 0x0308, 0x0301}, // Case map + 0x03C2: []rune{0x03C3}, // Case map + 0x03D0: []rune{0x03B2}, // Case map + 0x03D1: []rune{0x03B8}, // Case map + 0x03D2: []rune{0x03C5}, // Additional folding + 0x03D3: []rune{0x03CD}, // Additional folding + 0x03D4: []rune{0x03CB}, // Additional folding + 0x03D5: []rune{0x03C6}, // Case map + 0x03D6: []rune{0x03C0}, // Case map + 0x03D8: []rune{0x03D9}, // Case map + 0x03DA: []rune{0x03DB}, // Case map + 0x03DC: []rune{0x03DD}, // Case map + 0x03DE: []rune{0x03DF}, // Case map + 0x03E0: []rune{0x03E1}, // Case map + 0x03E2: []rune{0x03E3}, // Case map + 0x03E4: []rune{0x03E5}, // Case map + 0x03E6: []rune{0x03E7}, // Case map + 0x03E8: []rune{0x03E9}, // Case map + 0x03EA: []rune{0x03EB}, // Case map + 0x03EC: []rune{0x03ED}, // Case map + 0x03EE: []rune{0x03EF}, // Case map + 0x03F0: []rune{0x03BA}, // Case map + 0x03F1: []rune{0x03C1}, // Case map + 0x03F2: []rune{0x03C3}, // Case map + 0x03F4: []rune{0x03B8}, // Case map + 0x03F5: []rune{0x03B5}, // Case map + 0x0400: []rune{0x0450}, // Case map + 0x0401: []rune{0x0451}, // Case map + 0x0402: []rune{0x0452}, // Case map + 0x0403: []rune{0x0453}, // Case map + 0x0404: []rune{0x0454}, // Case map + 0x0405: []rune{0x0455}, // Case map + 0x0406: []rune{0x0456}, // Case map + 0x0407: []rune{0x0457}, // Case map + 0x0408: []rune{0x0458}, // Case map + 0x0409: []rune{0x0459}, // Case map + 0x040A: []rune{0x045A}, // Case map + 0x040B: []rune{0x045B}, // Case map + 0x040C: []rune{0x045C}, // Case map + 0x040D: []rune{0x045D}, // Case map + 0x040E: []rune{0x045E}, // Case map + 0x040F: []rune{0x045F}, // Case map + 0x0410: []rune{0x0430}, // Case map + 0x0411: []rune{0x0431}, // Case map + 0x0412: []rune{0x0432}, // Case map + 0x0413: []rune{0x0433}, // Case map + 0x0414: []rune{0x0434}, // Case map + 0x0415: []rune{0x0435}, // Case map + 0x0416: []rune{0x0436}, // Case map + 0x0417: []rune{0x0437}, // Case map + 0x0418: []rune{0x0438}, // Case map + 0x0419: []rune{0x0439}, // Case map + 0x041A: []rune{0x043A}, // Case map + 0x041B: []rune{0x043B}, // Case map + 0x041C: []rune{0x043C}, // Case map + 0x041D: []rune{0x043D}, // Case map + 0x041E: []rune{0x043E}, // Case map + 0x041F: []rune{0x043F}, // Case map + 0x0420: []rune{0x0440}, // Case map + 0x0421: []rune{0x0441}, // Case map + 0x0422: []rune{0x0442}, // Case map + 0x0423: []rune{0x0443}, // Case map + 0x0424: []rune{0x0444}, // Case map + 0x0425: []rune{0x0445}, // Case map + 0x0426: []rune{0x0446}, // Case map + 0x0427: []rune{0x0447}, // Case map + 0x0428: []rune{0x0448}, // Case map + 0x0429: []rune{0x0449}, // Case map + 0x042A: []rune{0x044A}, // Case map + 0x042B: []rune{0x044B}, // Case map + 0x042C: []rune{0x044C}, // Case map + 0x042D: []rune{0x044D}, // Case map + 0x042E: []rune{0x044E}, // Case map + 0x042F: []rune{0x044F}, // Case map + 0x0460: []rune{0x0461}, // Case map + 0x0462: []rune{0x0463}, // Case map + 0x0464: []rune{0x0465}, // Case map + 0x0466: []rune{0x0467}, // Case map + 0x0468: []rune{0x0469}, // Case map + 0x046A: []rune{0x046B}, // Case map + 0x046C: []rune{0x046D}, // Case map + 0x046E: []rune{0x046F}, // Case map + 0x0470: []rune{0x0471}, // Case map + 0x0472: []rune{0x0473}, // Case map + 0x0474: []rune{0x0475}, // Case map + 0x0476: []rune{0x0477}, // Case map + 0x0478: []rune{0x0479}, // Case map + 0x047A: []rune{0x047B}, // Case map + 0x047C: []rune{0x047D}, // Case map + 0x047E: []rune{0x047F}, // Case map + 0x0480: []rune{0x0481}, // Case map + 0x048A: []rune{0x048B}, // Case map + 0x048C: []rune{0x048D}, // Case map + 0x048E: []rune{0x048F}, // Case map + 0x0490: []rune{0x0491}, // Case map + 0x0492: []rune{0x0493}, // Case map + 0x0494: []rune{0x0495}, // Case map + 0x0496: []rune{0x0497}, // Case map + 0x0498: []rune{0x0499}, // Case map + 0x049A: []rune{0x049B}, // Case map + 0x049C: []rune{0x049D}, // Case map + 0x049E: []rune{0x049F}, // Case map + 0x04A0: []rune{0x04A1}, // Case map + 0x04A2: []rune{0x04A3}, // Case map + 0x04A4: []rune{0x04A5}, // Case map + 0x04A6: []rune{0x04A7}, // Case map + 0x04A8: []rune{0x04A9}, // Case map + 0x04AA: []rune{0x04AB}, // Case map + 0x04AC: []rune{0x04AD}, // Case map + 0x04AE: []rune{0x04AF}, // Case map + 0x04B0: []rune{0x04B1}, // Case map + 0x04B2: []rune{0x04B3}, // Case map + 0x04B4: []rune{0x04B5}, // Case map + 0x04B6: []rune{0x04B7}, // Case map + 0x04B8: []rune{0x04B9}, // Case map + 0x04BA: []rune{0x04BB}, // Case map + 0x04BC: []rune{0x04BD}, // Case map + 0x04BE: []rune{0x04BF}, // Case map + 0x04C1: []rune{0x04C2}, // Case map + 0x04C3: []rune{0x04C4}, // Case map + 0x04C5: []rune{0x04C6}, // Case map + 0x04C7: []rune{0x04C8}, // Case map + 0x04C9: []rune{0x04CA}, // Case map + 0x04CB: []rune{0x04CC}, // Case map + 0x04CD: []rune{0x04CE}, // Case map + 0x04D0: []rune{0x04D1}, // Case map + 0x04D2: []rune{0x04D3}, // Case map + 0x04D4: []rune{0x04D5}, // Case map + 0x04D6: []rune{0x04D7}, // Case map + 0x04D8: []rune{0x04D9}, // Case map + 0x04DA: []rune{0x04DB}, // Case map + 0x04DC: []rune{0x04DD}, // Case map + 0x04DE: []rune{0x04DF}, // Case map + 0x04E0: []rune{0x04E1}, // Case map + 0x04E2: []rune{0x04E3}, // Case map + 0x04E4: []rune{0x04E5}, // Case map + 0x04E6: []rune{0x04E7}, // Case map + 0x04E8: []rune{0x04E9}, // Case map + 0x04EA: []rune{0x04EB}, // Case map + 0x04EC: []rune{0x04ED}, // Case map + 0x04EE: []rune{0x04EF}, // Case map + 0x04F0: []rune{0x04F1}, // Case map + 0x04F2: []rune{0x04F3}, // Case map + 0x04F4: []rune{0x04F5}, // Case map + 0x04F8: []rune{0x04F9}, // Case map + 0x0500: []rune{0x0501}, // Case map + 0x0502: []rune{0x0503}, // Case map + 0x0504: []rune{0x0505}, // Case map + 0x0506: []rune{0x0507}, // Case map + 0x0508: []rune{0x0509}, // Case map + 0x050A: []rune{0x050B}, // Case map + 0x050C: []rune{0x050D}, // Case map + 0x050E: []rune{0x050F}, // Case map + 0x0531: []rune{0x0561}, // Case map + 0x0532: []rune{0x0562}, // Case map + 0x0533: []rune{0x0563}, // Case map + 0x0534: []rune{0x0564}, // Case map + 0x0535: []rune{0x0565}, // Case map + 0x0536: []rune{0x0566}, // Case map + 0x0537: []rune{0x0567}, // Case map + 0x0538: []rune{0x0568}, // Case map + 0x0539: []rune{0x0569}, // Case map + 0x053A: []rune{0x056A}, // Case map + 0x053B: []rune{0x056B}, // Case map + 0x053C: []rune{0x056C}, // Case map + 0x053D: []rune{0x056D}, // Case map + 0x053E: []rune{0x056E}, // Case map + 0x053F: []rune{0x056F}, // Case map + 0x0540: []rune{0x0570}, // Case map + 0x0541: []rune{0x0571}, // Case map + 0x0542: []rune{0x0572}, // Case map + 0x0543: []rune{0x0573}, // Case map + 0x0544: []rune{0x0574}, // Case map + 0x0545: []rune{0x0575}, // Case map + 0x0546: []rune{0x0576}, // Case map + 0x0547: []rune{0x0577}, // Case map + 0x0548: []rune{0x0578}, // Case map + 0x0549: []rune{0x0579}, // Case map + 0x054A: []rune{0x057A}, // Case map + 0x054B: []rune{0x057B}, // Case map + 0x054C: []rune{0x057C}, // Case map + 0x054D: []rune{0x057D}, // Case map + 0x054E: []rune{0x057E}, // Case map + 0x054F: []rune{0x057F}, // Case map + 0x0550: []rune{0x0580}, // Case map + 0x0551: []rune{0x0581}, // Case map + 0x0552: []rune{0x0582}, // Case map + 0x0553: []rune{0x0583}, // Case map + 0x0554: []rune{0x0584}, // Case map + 0x0555: []rune{0x0585}, // Case map + 0x0556: []rune{0x0586}, // Case map + 0x0587: []rune{0x0565, 0x0582}, // Case map + 0x1E00: []rune{0x1E01}, // Case map + 0x1E02: []rune{0x1E03}, // Case map + 0x1E04: []rune{0x1E05}, // Case map + 0x1E06: []rune{0x1E07}, // Case map + 0x1E08: []rune{0x1E09}, // Case map + 0x1E0A: []rune{0x1E0B}, // Case map + 0x1E0C: []rune{0x1E0D}, // Case map + 0x1E0E: []rune{0x1E0F}, // Case map + 0x1E10: []rune{0x1E11}, // Case map + 0x1E12: []rune{0x1E13}, // Case map + 0x1E14: []rune{0x1E15}, // Case map + 0x1E16: []rune{0x1E17}, // Case map + 0x1E18: []rune{0x1E19}, // Case map + 0x1E1A: []rune{0x1E1B}, // Case map + 0x1E1C: []rune{0x1E1D}, // Case map + 0x1E1E: []rune{0x1E1F}, // Case map + 0x1E20: []rune{0x1E21}, // Case map + 0x1E22: []rune{0x1E23}, // Case map + 0x1E24: []rune{0x1E25}, // Case map + 0x1E26: []rune{0x1E27}, // Case map + 0x1E28: []rune{0x1E29}, // Case map + 0x1E2A: []rune{0x1E2B}, // Case map + 0x1E2C: []rune{0x1E2D}, // Case map + 0x1E2E: []rune{0x1E2F}, // Case map + 0x1E30: []rune{0x1E31}, // Case map + 0x1E32: []rune{0x1E33}, // Case map + 0x1E34: []rune{0x1E35}, // Case map + 0x1E36: []rune{0x1E37}, // Case map + 0x1E38: []rune{0x1E39}, // Case map + 0x1E3A: []rune{0x1E3B}, // Case map + 0x1E3C: []rune{0x1E3D}, // Case map + 0x1E3E: []rune{0x1E3F}, // Case map + 0x1E40: []rune{0x1E41}, // Case map + 0x1E42: []rune{0x1E43}, // Case map + 0x1E44: []rune{0x1E45}, // Case map + 0x1E46: []rune{0x1E47}, // Case map + 0x1E48: []rune{0x1E49}, // Case map + 0x1E4A: []rune{0x1E4B}, // Case map + 0x1E4C: []rune{0x1E4D}, // Case map + 0x1E4E: []rune{0x1E4F}, // Case map + 0x1E50: []rune{0x1E51}, // Case map + 0x1E52: []rune{0x1E53}, // Case map + 0x1E54: []rune{0x1E55}, // Case map + 0x1E56: []rune{0x1E57}, // Case map + 0x1E58: []rune{0x1E59}, // Case map + 0x1E5A: []rune{0x1E5B}, // Case map + 0x1E5C: []rune{0x1E5D}, // Case map + 0x1E5E: []rune{0x1E5F}, // Case map + 0x1E60: []rune{0x1E61}, // Case map + 0x1E62: []rune{0x1E63}, // Case map + 0x1E64: []rune{0x1E65}, // Case map + 0x1E66: []rune{0x1E67}, // Case map + 0x1E68: []rune{0x1E69}, // Case map + 0x1E6A: []rune{0x1E6B}, // Case map + 0x1E6C: []rune{0x1E6D}, // Case map + 0x1E6E: []rune{0x1E6F}, // Case map + 0x1E70: []rune{0x1E71}, // Case map + 0x1E72: []rune{0x1E73}, // Case map + 0x1E74: []rune{0x1E75}, // Case map + 0x1E76: []rune{0x1E77}, // Case map + 0x1E78: []rune{0x1E79}, // Case map + 0x1E7A: []rune{0x1E7B}, // Case map + 0x1E7C: []rune{0x1E7D}, // Case map + 0x1E7E: []rune{0x1E7F}, // Case map + 0x1E80: []rune{0x1E81}, // Case map + 0x1E82: []rune{0x1E83}, // Case map + 0x1E84: []rune{0x1E85}, // Case map + 0x1E86: []rune{0x1E87}, // Case map + 0x1E88: []rune{0x1E89}, // Case map + 0x1E8A: []rune{0x1E8B}, // Case map + 0x1E8C: []rune{0x1E8D}, // Case map + 0x1E8E: []rune{0x1E8F}, // Case map + 0x1E90: []rune{0x1E91}, // Case map + 0x1E92: []rune{0x1E93}, // Case map + 0x1E94: []rune{0x1E95}, // Case map + 0x1E96: []rune{0x0068, 0x0331}, // Case map + 0x1E97: []rune{0x0074, 0x0308}, // Case map + 0x1E98: []rune{0x0077, 0x030A}, // Case map + 0x1E99: []rune{0x0079, 0x030A}, // Case map + 0x1E9A: []rune{0x0061, 0x02BE}, // Case map + 0x1E9B: []rune{0x1E61}, // Case map + 0x1EA0: []rune{0x1EA1}, // Case map + 0x1EA2: []rune{0x1EA3}, // Case map + 0x1EA4: []rune{0x1EA5}, // Case map + 0x1EA6: []rune{0x1EA7}, // Case map + 0x1EA8: []rune{0x1EA9}, // Case map + 0x1EAA: []rune{0x1EAB}, // Case map + 0x1EAC: []rune{0x1EAD}, // Case map + 0x1EAE: []rune{0x1EAF}, // Case map + 0x1EB0: []rune{0x1EB1}, // Case map + 0x1EB2: []rune{0x1EB3}, // Case map + 0x1EB4: []rune{0x1EB5}, // Case map + 0x1EB6: []rune{0x1EB7}, // Case map + 0x1EB8: []rune{0x1EB9}, // Case map + 0x1EBA: []rune{0x1EBB}, // Case map + 0x1EBC: []rune{0x1EBD}, // Case map + 0x1EBE: []rune{0x1EBF}, // Case map + 0x1EC0: []rune{0x1EC1}, // Case map + 0x1EC2: []rune{0x1EC3}, // Case map + 0x1EC4: []rune{0x1EC5}, // Case map + 0x1EC6: []rune{0x1EC7}, // Case map + 0x1EC8: []rune{0x1EC9}, // Case map + 0x1ECA: []rune{0x1ECB}, // Case map + 0x1ECC: []rune{0x1ECD}, // Case map + 0x1ECE: []rune{0x1ECF}, // Case map + 0x1ED0: []rune{0x1ED1}, // Case map + 0x1ED2: []rune{0x1ED3}, // Case map + 0x1ED4: []rune{0x1ED5}, // Case map + 0x1ED6: []rune{0x1ED7}, // Case map + 0x1ED8: []rune{0x1ED9}, // Case map + 0x1EDA: []rune{0x1EDB}, // Case map + 0x1EDC: []rune{0x1EDD}, // Case map + 0x1EDE: []rune{0x1EDF}, // Case map + 0x1EE0: []rune{0x1EE1}, // Case map + 0x1EE2: []rune{0x1EE3}, // Case map + 0x1EE4: []rune{0x1EE5}, // Case map + 0x1EE6: []rune{0x1EE7}, // Case map + 0x1EE8: []rune{0x1EE9}, // Case map + 0x1EEA: []rune{0x1EEB}, // Case map + 0x1EEC: []rune{0x1EED}, // Case map + 0x1EEE: []rune{0x1EEF}, // Case map + 0x1EF0: []rune{0x1EF1}, // Case map + 0x1EF2: []rune{0x1EF3}, // Case map + 0x1EF4: []rune{0x1EF5}, // Case map + 0x1EF6: []rune{0x1EF7}, // Case map + 0x1EF8: []rune{0x1EF9}, // Case map + 0x1F08: []rune{0x1F00}, // Case map + 0x1F09: []rune{0x1F01}, // Case map + 0x1F0A: []rune{0x1F02}, // Case map + 0x1F0B: []rune{0x1F03}, // Case map + 0x1F0C: []rune{0x1F04}, // Case map + 0x1F0D: []rune{0x1F05}, // Case map + 0x1F0E: []rune{0x1F06}, // Case map + 0x1F0F: []rune{0x1F07}, // Case map + 0x1F18: []rune{0x1F10}, // Case map + 0x1F19: []rune{0x1F11}, // Case map + 0x1F1A: []rune{0x1F12}, // Case map + 0x1F1B: []rune{0x1F13}, // Case map + 0x1F1C: []rune{0x1F14}, // Case map + 0x1F1D: []rune{0x1F15}, // Case map + 0x1F28: []rune{0x1F20}, // Case map + 0x1F29: []rune{0x1F21}, // Case map + 0x1F2A: []rune{0x1F22}, // Case map + 0x1F2B: []rune{0x1F23}, // Case map + 0x1F2C: []rune{0x1F24}, // Case map + 0x1F2D: []rune{0x1F25}, // Case map + 0x1F2E: []rune{0x1F26}, // Case map + 0x1F2F: []rune{0x1F27}, // Case map + 0x1F38: []rune{0x1F30}, // Case map + 0x1F39: []rune{0x1F31}, // Case map + 0x1F3A: []rune{0x1F32}, // Case map + 0x1F3B: []rune{0x1F33}, // Case map + 0x1F3C: []rune{0x1F34}, // Case map + 0x1F3D: []rune{0x1F35}, // Case map + 0x1F3E: []rune{0x1F36}, // Case map + 0x1F3F: []rune{0x1F37}, // Case map + 0x1F48: []rune{0x1F40}, // Case map + 0x1F49: []rune{0x1F41}, // Case map + 0x1F4A: []rune{0x1F42}, // Case map + 0x1F4B: []rune{0x1F43}, // Case map + 0x1F4C: []rune{0x1F44}, // Case map + 0x1F4D: []rune{0x1F45}, // Case map + 0x1F50: []rune{0x03C5, 0x0313}, // Case map + 0x1F52: []rune{0x03C5, 0x0313, 0x0300}, // Case map + 0x1F54: []rune{0x03C5, 0x0313, 0x0301}, // Case map + 0x1F56: []rune{0x03C5, 0x0313, 0x0342}, // Case map + 0x1F59: []rune{0x1F51}, // Case map + 0x1F5B: []rune{0x1F53}, // Case map + 0x1F5D: []rune{0x1F55}, // Case map + 0x1F5F: []rune{0x1F57}, // Case map + 0x1F68: []rune{0x1F60}, // Case map + 0x1F69: []rune{0x1F61}, // Case map + 0x1F6A: []rune{0x1F62}, // Case map + 0x1F6B: []rune{0x1F63}, // Case map + 0x1F6C: []rune{0x1F64}, // Case map + 0x1F6D: []rune{0x1F65}, // Case map + 0x1F6E: []rune{0x1F66}, // Case map + 0x1F6F: []rune{0x1F67}, // Case map + 0x1F80: []rune{0x1F00, 0x03B9}, // Case map + 0x1F81: []rune{0x1F01, 0x03B9}, // Case map + 0x1F82: []rune{0x1F02, 0x03B9}, // Case map + 0x1F83: []rune{0x1F03, 0x03B9}, // Case map + 0x1F84: []rune{0x1F04, 0x03B9}, // Case map + 0x1F85: []rune{0x1F05, 0x03B9}, // Case map + 0x1F86: []rune{0x1F06, 0x03B9}, // Case map + 0x1F87: []rune{0x1F07, 0x03B9}, // Case map + 0x1F88: []rune{0x1F00, 0x03B9}, // Case map + 0x1F89: []rune{0x1F01, 0x03B9}, // Case map + 0x1F8A: []rune{0x1F02, 0x03B9}, // Case map + 0x1F8B: []rune{0x1F03, 0x03B9}, // Case map + 0x1F8C: []rune{0x1F04, 0x03B9}, // Case map + 0x1F8D: []rune{0x1F05, 0x03B9}, // Case map + 0x1F8E: []rune{0x1F06, 0x03B9}, // Case map + 0x1F8F: []rune{0x1F07, 0x03B9}, // Case map + 0x1F90: []rune{0x1F20, 0x03B9}, // Case map + 0x1F91: []rune{0x1F21, 0x03B9}, // Case map + 0x1F92: []rune{0x1F22, 0x03B9}, // Case map + 0x1F93: []rune{0x1F23, 0x03B9}, // Case map + 0x1F94: []rune{0x1F24, 0x03B9}, // Case map + 0x1F95: []rune{0x1F25, 0x03B9}, // Case map + 0x1F96: []rune{0x1F26, 0x03B9}, // Case map + 0x1F97: []rune{0x1F27, 0x03B9}, // Case map + 0x1F98: []rune{0x1F20, 0x03B9}, // Case map + 0x1F99: []rune{0x1F21, 0x03B9}, // Case map + 0x1F9A: []rune{0x1F22, 0x03B9}, // Case map + 0x1F9B: []rune{0x1F23, 0x03B9}, // Case map + 0x1F9C: []rune{0x1F24, 0x03B9}, // Case map + 0x1F9D: []rune{0x1F25, 0x03B9}, // Case map + 0x1F9E: []rune{0x1F26, 0x03B9}, // Case map + 0x1F9F: []rune{0x1F27, 0x03B9}, // Case map + 0x1FA0: []rune{0x1F60, 0x03B9}, // Case map + 0x1FA1: []rune{0x1F61, 0x03B9}, // Case map + 0x1FA2: []rune{0x1F62, 0x03B9}, // Case map + 0x1FA3: []rune{0x1F63, 0x03B9}, // Case map + 0x1FA4: []rune{0x1F64, 0x03B9}, // Case map + 0x1FA5: []rune{0x1F65, 0x03B9}, // Case map + 0x1FA6: []rune{0x1F66, 0x03B9}, // Case map + 0x1FA7: []rune{0x1F67, 0x03B9}, // Case map + 0x1FA8: []rune{0x1F60, 0x03B9}, // Case map + 0x1FA9: []rune{0x1F61, 0x03B9}, // Case map + 0x1FAA: []rune{0x1F62, 0x03B9}, // Case map + 0x1FAB: []rune{0x1F63, 0x03B9}, // Case map + 0x1FAC: []rune{0x1F64, 0x03B9}, // Case map + 0x1FAD: []rune{0x1F65, 0x03B9}, // Case map + 0x1FAE: []rune{0x1F66, 0x03B9}, // Case map + 0x1FAF: []rune{0x1F67, 0x03B9}, // Case map + 0x1FB2: []rune{0x1F70, 0x03B9}, // Case map + 0x1FB3: []rune{0x03B1, 0x03B9}, // Case map + 0x1FB4: []rune{0x03AC, 0x03B9}, // Case map + 0x1FB6: []rune{0x03B1, 0x0342}, // Case map + 0x1FB7: []rune{0x03B1, 0x0342, 0x03B9}, // Case map + 0x1FB8: []rune{0x1FB0}, // Case map + 0x1FB9: []rune{0x1FB1}, // Case map + 0x1FBA: []rune{0x1F70}, // Case map + 0x1FBB: []rune{0x1F71}, // Case map + 0x1FBC: []rune{0x03B1, 0x03B9}, // Case map + 0x1FBE: []rune{0x03B9}, // Case map + 0x1FC2: []rune{0x1F74, 0x03B9}, // Case map + 0x1FC3: []rune{0x03B7, 0x03B9}, // Case map + 0x1FC4: []rune{0x03AE, 0x03B9}, // Case map + 0x1FC6: []rune{0x03B7, 0x0342}, // Case map + 0x1FC7: []rune{0x03B7, 0x0342, 0x03B9}, // Case map + 0x1FC8: []rune{0x1F72}, // Case map + 0x1FC9: []rune{0x1F73}, // Case map + 0x1FCA: []rune{0x1F74}, // Case map + 0x1FCB: []rune{0x1F75}, // Case map + 0x1FCC: []rune{0x03B7, 0x03B9}, // Case map + 0x1FD2: []rune{0x03B9, 0x0308, 0x0300}, // Case map + 0x1FD3: []rune{0x03B9, 0x0308, 0x0301}, // Case map + 0x1FD6: []rune{0x03B9, 0x0342}, // Case map + 0x1FD7: []rune{0x03B9, 0x0308, 0x0342}, // Case map + 0x1FD8: []rune{0x1FD0}, // Case map + 0x1FD9: []rune{0x1FD1}, // Case map + 0x1FDA: []rune{0x1F76}, // Case map + 0x1FDB: []rune{0x1F77}, // Case map + 0x1FE2: []rune{0x03C5, 0x0308, 0x0300}, // Case map + 0x1FE3: []rune{0x03C5, 0x0308, 0x0301}, // Case map + 0x1FE4: []rune{0x03C1, 0x0313}, // Case map + 0x1FE6: []rune{0x03C5, 0x0342}, // Case map + 0x1FE7: []rune{0x03C5, 0x0308, 0x0342}, // Case map + 0x1FE8: []rune{0x1FE0}, // Case map + 0x1FE9: []rune{0x1FE1}, // Case map + 0x1FEA: []rune{0x1F7A}, // Case map + 0x1FEB: []rune{0x1F7B}, // Case map + 0x1FEC: []rune{0x1FE5}, // Case map + 0x1FF2: []rune{0x1F7C, 0x03B9}, // Case map + 0x1FF3: []rune{0x03C9, 0x03B9}, // Case map + 0x1FF4: []rune{0x03CE, 0x03B9}, // Case map + 0x1FF6: []rune{0x03C9, 0x0342}, // Case map + 0x1FF7: []rune{0x03C9, 0x0342, 0x03B9}, // Case map + 0x1FF8: []rune{0x1F78}, // Case map + 0x1FF9: []rune{0x1F79}, // Case map + 0x1FFA: []rune{0x1F7C}, // Case map + 0x1FFB: []rune{0x1F7D}, // Case map + 0x1FFC: []rune{0x03C9, 0x03B9}, // Case map + 0x20A8: []rune{0x0072, 0x0073}, // Additional folding + 0x2102: []rune{0x0063}, // Additional folding + 0x2103: []rune{0x00B0, 0x0063}, // Additional folding + 0x2107: []rune{0x025B}, // Additional folding + 0x2109: []rune{0x00B0, 0x0066}, // Additional folding + 0x210B: []rune{0x0068}, // Additional folding + 0x210C: []rune{0x0068}, // Additional folding + 0x210D: []rune{0x0068}, // Additional folding + 0x2110: []rune{0x0069}, // Additional folding + 0x2111: []rune{0x0069}, // Additional folding + 0x2112: []rune{0x006C}, // Additional folding + 0x2115: []rune{0x006E}, // Additional folding + 0x2116: []rune{0x006E, 0x006F}, // Additional folding + 0x2119: []rune{0x0070}, // Additional folding + 0x211A: []rune{0x0071}, // Additional folding + 0x211B: []rune{0x0072}, // Additional folding + 0x211C: []rune{0x0072}, // Additional folding + 0x211D: []rune{0x0072}, // Additional folding + 0x2120: []rune{0x0073, 0x006D}, // Additional folding + 0x2121: []rune{0x0074, 0x0065, 0x006C}, // Additional folding + 0x2122: []rune{0x0074, 0x006D}, // Additional folding + 0x2124: []rune{0x007A}, // Additional folding + 0x2126: []rune{0x03C9}, // Case map + 0x2128: []rune{0x007A}, // Additional folding + 0x212A: []rune{0x006B}, // Case map + 0x212B: []rune{0x00E5}, // Case map + 0x212C: []rune{0x0062}, // Additional folding + 0x212D: []rune{0x0063}, // Additional folding + 0x2130: []rune{0x0065}, // Additional folding + 0x2131: []rune{0x0066}, // Additional folding + 0x2133: []rune{0x006D}, // Additional folding + 0x213E: []rune{0x03B3}, // Additional folding + 0x213F: []rune{0x03C0}, // Additional folding + 0x2145: []rune{0x0064}, // Additional folding + 0x2160: []rune{0x2170}, // Case map + 0x2161: []rune{0x2171}, // Case map + 0x2162: []rune{0x2172}, // Case map + 0x2163: []rune{0x2173}, // Case map + 0x2164: []rune{0x2174}, // Case map + 0x2165: []rune{0x2175}, // Case map + 0x2166: []rune{0x2176}, // Case map + 0x2167: []rune{0x2177}, // Case map + 0x2168: []rune{0x2178}, // Case map + 0x2169: []rune{0x2179}, // Case map + 0x216A: []rune{0x217A}, // Case map + 0x216B: []rune{0x217B}, // Case map + 0x216C: []rune{0x217C}, // Case map + 0x216D: []rune{0x217D}, // Case map + 0x216E: []rune{0x217E}, // Case map + 0x216F: []rune{0x217F}, // Case map + 0x24B6: []rune{0x24D0}, // Case map + 0x24B7: []rune{0x24D1}, // Case map + 0x24B8: []rune{0x24D2}, // Case map + 0x24B9: []rune{0x24D3}, // Case map + 0x24BA: []rune{0x24D4}, // Case map + 0x24BB: []rune{0x24D5}, // Case map + 0x24BC: []rune{0x24D6}, // Case map + 0x24BD: []rune{0x24D7}, // Case map + 0x24BE: []rune{0x24D8}, // Case map + 0x24BF: []rune{0x24D9}, // Case map + 0x24C0: []rune{0x24DA}, // Case map + 0x24C1: []rune{0x24DB}, // Case map + 0x24C2: []rune{0x24DC}, // Case map + 0x24C3: []rune{0x24DD}, // Case map + 0x24C4: []rune{0x24DE}, // Case map + 0x24C5: []rune{0x24DF}, // Case map + 0x24C6: []rune{0x24E0}, // Case map + 0x24C7: []rune{0x24E1}, // Case map + 0x24C8: []rune{0x24E2}, // Case map + 0x24C9: []rune{0x24E3}, // Case map + 0x24CA: []rune{0x24E4}, // Case map + 0x24CB: []rune{0x24E5}, // Case map + 0x24CC: []rune{0x24E6}, // Case map + 0x24CD: []rune{0x24E7}, // Case map + 0x24CE: []rune{0x24E8}, // Case map + 0x24CF: []rune{0x24E9}, // Case map + 0x3371: []rune{0x0068, 0x0070, 0x0061}, // Additional folding + 0x3373: []rune{0x0061, 0x0075}, // Additional folding + 0x3375: []rune{0x006F, 0x0076}, // Additional folding + 0x3380: []rune{0x0070, 0x0061}, // Additional folding + 0x3381: []rune{0x006E, 0x0061}, // Additional folding + 0x3382: []rune{0x03BC, 0x0061}, // Additional folding + 0x3383: []rune{0x006D, 0x0061}, // Additional folding + 0x3384: []rune{0x006B, 0x0061}, // Additional folding + 0x3385: []rune{0x006B, 0x0062}, // Additional folding + 0x3386: []rune{0x006D, 0x0062}, // Additional folding + 0x3387: []rune{0x0067, 0x0062}, // Additional folding + 0x338A: []rune{0x0070, 0x0066}, // Additional folding + 0x338B: []rune{0x006E, 0x0066}, // Additional folding + 0x338C: []rune{0x03BC, 0x0066}, // Additional folding + 0x3390: []rune{0x0068, 0x007A}, // Additional folding + 0x3391: []rune{0x006B, 0x0068, 0x007A}, // Additional folding + 0x3392: []rune{0x006D, 0x0068, 0x007A}, // Additional folding + 0x3393: []rune{0x0067, 0x0068, 0x007A}, // Additional folding + 0x3394: []rune{0x0074, 0x0068, 0x007A}, // Additional folding + 0x33A9: []rune{0x0070, 0x0061}, // Additional folding + 0x33AA: []rune{0x006B, 0x0070, 0x0061}, // Additional folding + 0x33AB: []rune{0x006D, 0x0070, 0x0061}, // Additional folding + 0x33AC: []rune{0x0067, 0x0070, 0x0061}, // Additional folding + 0x33B4: []rune{0x0070, 0x0076}, // Additional folding + 0x33B5: []rune{0x006E, 0x0076}, // Additional folding + 0x33B6: []rune{0x03BC, 0x0076}, // Additional folding + 0x33B7: []rune{0x006D, 0x0076}, // Additional folding + 0x33B8: []rune{0x006B, 0x0076}, // Additional folding + 0x33B9: []rune{0x006D, 0x0076}, // Additional folding + 0x33BA: []rune{0x0070, 0x0077}, // Additional folding + 0x33BB: []rune{0x006E, 0x0077}, // Additional folding + 0x33BC: []rune{0x03BC, 0x0077}, // Additional folding + 0x33BD: []rune{0x006D, 0x0077}, // Additional folding + 0x33BE: []rune{0x006B, 0x0077}, // Additional folding + 0x33BF: []rune{0x006D, 0x0077}, // Additional folding + 0x33C0: []rune{0x006B, 0x03C9}, // Additional folding + 0x33C1: []rune{0x006D, 0x03C9}, // Additional folding + 0x33C3: []rune{0x0062, 0x0071}, // Additional folding + 0x33C6: []rune{0x0063, 0x2215, 0x006B, 0x0067}, // Additional folding + 0x33C7: []rune{0x0063, 0x006F, 0x002E}, // Additional folding + 0x33C8: []rune{0x0064, 0x0062}, // Additional folding + 0x33C9: []rune{0x0067, 0x0079}, // Additional folding + 0x33CB: []rune{0x0068, 0x0070}, // Additional folding + 0x33CD: []rune{0x006B, 0x006B}, // Additional folding + 0x33CE: []rune{0x006B, 0x006D}, // Additional folding + 0x33D7: []rune{0x0070, 0x0068}, // Additional folding + 0x33D9: []rune{0x0070, 0x0070, 0x006D}, // Additional folding + 0x33DA: []rune{0x0070, 0x0072}, // Additional folding + 0x33DC: []rune{0x0073, 0x0076}, // Additional folding + 0x33DD: []rune{0x0077, 0x0062}, // Additional folding + 0xFB00: []rune{0x0066, 0x0066}, // Case map + 0xFB01: []rune{0x0066, 0x0069}, // Case map + 0xFB02: []rune{0x0066, 0x006C}, // Case map + 0xFB03: []rune{0x0066, 0x0066, 0x0069}, // Case map + 0xFB04: []rune{0x0066, 0x0066, 0x006C}, // Case map + 0xFB05: []rune{0x0073, 0x0074}, // Case map + 0xFB06: []rune{0x0073, 0x0074}, // Case map + 0xFB13: []rune{0x0574, 0x0576}, // Case map + 0xFB14: []rune{0x0574, 0x0565}, // Case map + 0xFB15: []rune{0x0574, 0x056B}, // Case map + 0xFB16: []rune{0x057E, 0x0576}, // Case map + 0xFB17: []rune{0x0574, 0x056D}, // Case map + 0xFF21: []rune{0xFF41}, // Case map + 0xFF22: []rune{0xFF42}, // Case map + 0xFF23: []rune{0xFF43}, // Case map + 0xFF24: []rune{0xFF44}, // Case map + 0xFF25: []rune{0xFF45}, // Case map + 0xFF26: []rune{0xFF46}, // Case map + 0xFF27: []rune{0xFF47}, // Case map + 0xFF28: []rune{0xFF48}, // Case map + 0xFF29: []rune{0xFF49}, // Case map + 0xFF2A: []rune{0xFF4A}, // Case map + 0xFF2B: []rune{0xFF4B}, // Case map + 0xFF2C: []rune{0xFF4C}, // Case map + 0xFF2D: []rune{0xFF4D}, // Case map + 0xFF2E: []rune{0xFF4E}, // Case map + 0xFF2F: []rune{0xFF4F}, // Case map + 0xFF30: []rune{0xFF50}, // Case map + 0xFF31: []rune{0xFF51}, // Case map + 0xFF32: []rune{0xFF52}, // Case map + 0xFF33: []rune{0xFF53}, // Case map + 0xFF34: []rune{0xFF54}, // Case map + 0xFF35: []rune{0xFF55}, // Case map + 0xFF36: []rune{0xFF56}, // Case map + 0xFF37: []rune{0xFF57}, // Case map + 0xFF38: []rune{0xFF58}, // Case map + 0xFF39: []rune{0xFF59}, // Case map + 0xFF3A: []rune{0xFF5A}, // Case map + 0x10400: []rune{0x10428}, // Case map + 0x10401: []rune{0x10429}, // Case map + 0x10402: []rune{0x1042A}, // Case map + 0x10403: []rune{0x1042B}, // Case map + 0x10404: []rune{0x1042C}, // Case map + 0x10405: []rune{0x1042D}, // Case map + 0x10406: []rune{0x1042E}, // Case map + 0x10407: []rune{0x1042F}, // Case map + 0x10408: []rune{0x10430}, // Case map + 0x10409: []rune{0x10431}, // Case map + 0x1040A: []rune{0x10432}, // Case map + 0x1040B: []rune{0x10433}, // Case map + 0x1040C: []rune{0x10434}, // Case map + 0x1040D: []rune{0x10435}, // Case map + 0x1040E: []rune{0x10436}, // Case map + 0x1040F: []rune{0x10437}, // Case map + 0x10410: []rune{0x10438}, // Case map + 0x10411: []rune{0x10439}, // Case map + 0x10412: []rune{0x1043A}, // Case map + 0x10413: []rune{0x1043B}, // Case map + 0x10414: []rune{0x1043C}, // Case map + 0x10415: []rune{0x1043D}, // Case map + 0x10416: []rune{0x1043E}, // Case map + 0x10417: []rune{0x1043F}, // Case map + 0x10418: []rune{0x10440}, // Case map + 0x10419: []rune{0x10441}, // Case map + 0x1041A: []rune{0x10442}, // Case map + 0x1041B: []rune{0x10443}, // Case map + 0x1041C: []rune{0x10444}, // Case map + 0x1041D: []rune{0x10445}, // Case map + 0x1041E: []rune{0x10446}, // Case map + 0x1041F: []rune{0x10447}, // Case map + 0x10420: []rune{0x10448}, // Case map + 0x10421: []rune{0x10449}, // Case map + 0x10422: []rune{0x1044A}, // Case map + 0x10423: []rune{0x1044B}, // Case map + 0x10424: []rune{0x1044C}, // Case map + 0x10425: []rune{0x1044D}, // Case map + 0x1D400: []rune{0x0061}, // Additional folding + 0x1D401: []rune{0x0062}, // Additional folding + 0x1D402: []rune{0x0063}, // Additional folding + 0x1D403: []rune{0x0064}, // Additional folding + 0x1D404: []rune{0x0065}, // Additional folding + 0x1D405: []rune{0x0066}, // Additional folding + 0x1D406: []rune{0x0067}, // Additional folding + 0x1D407: []rune{0x0068}, // Additional folding + 0x1D408: []rune{0x0069}, // Additional folding + 0x1D409: []rune{0x006A}, // Additional folding + 0x1D40A: []rune{0x006B}, // Additional folding + 0x1D40B: []rune{0x006C}, // Additional folding + 0x1D40C: []rune{0x006D}, // Additional folding + 0x1D40D: []rune{0x006E}, // Additional folding + 0x1D40E: []rune{0x006F}, // Additional folding + 0x1D40F: []rune{0x0070}, // Additional folding + 0x1D410: []rune{0x0071}, // Additional folding + 0x1D411: []rune{0x0072}, // Additional folding + 0x1D412: []rune{0x0073}, // Additional folding + 0x1D413: []rune{0x0074}, // Additional folding + 0x1D414: []rune{0x0075}, // Additional folding + 0x1D415: []rune{0x0076}, // Additional folding + 0x1D416: []rune{0x0077}, // Additional folding + 0x1D417: []rune{0x0078}, // Additional folding + 0x1D418: []rune{0x0079}, // Additional folding + 0x1D419: []rune{0x007A}, // Additional folding + 0x1D434: []rune{0x0061}, // Additional folding + 0x1D435: []rune{0x0062}, // Additional folding + 0x1D436: []rune{0x0063}, // Additional folding + 0x1D437: []rune{0x0064}, // Additional folding + 0x1D438: []rune{0x0065}, // Additional folding + 0x1D439: []rune{0x0066}, // Additional folding + 0x1D43A: []rune{0x0067}, // Additional folding + 0x1D43B: []rune{0x0068}, // Additional folding + 0x1D43C: []rune{0x0069}, // Additional folding + 0x1D43D: []rune{0x006A}, // Additional folding + 0x1D43E: []rune{0x006B}, // Additional folding + 0x1D43F: []rune{0x006C}, // Additional folding + 0x1D440: []rune{0x006D}, // Additional folding + 0x1D441: []rune{0x006E}, // Additional folding + 0x1D442: []rune{0x006F}, // Additional folding + 0x1D443: []rune{0x0070}, // Additional folding + 0x1D444: []rune{0x0071}, // Additional folding + 0x1D445: []rune{0x0072}, // Additional folding + 0x1D446: []rune{0x0073}, // Additional folding + 0x1D447: []rune{0x0074}, // Additional folding + 0x1D448: []rune{0x0075}, // Additional folding + 0x1D449: []rune{0x0076}, // Additional folding + 0x1D44A: []rune{0x0077}, // Additional folding + 0x1D44B: []rune{0x0078}, // Additional folding + 0x1D44C: []rune{0x0079}, // Additional folding + 0x1D44D: []rune{0x007A}, // Additional folding + 0x1D468: []rune{0x0061}, // Additional folding + 0x1D469: []rune{0x0062}, // Additional folding + 0x1D46A: []rune{0x0063}, // Additional folding + 0x1D46B: []rune{0x0064}, // Additional folding + 0x1D46C: []rune{0x0065}, // Additional folding + 0x1D46D: []rune{0x0066}, // Additional folding + 0x1D46E: []rune{0x0067}, // Additional folding + 0x1D46F: []rune{0x0068}, // Additional folding + 0x1D470: []rune{0x0069}, // Additional folding + 0x1D471: []rune{0x006A}, // Additional folding + 0x1D472: []rune{0x006B}, // Additional folding + 0x1D473: []rune{0x006C}, // Additional folding + 0x1D474: []rune{0x006D}, // Additional folding + 0x1D475: []rune{0x006E}, // Additional folding + 0x1D476: []rune{0x006F}, // Additional folding + 0x1D477: []rune{0x0070}, // Additional folding + 0x1D478: []rune{0x0071}, // Additional folding + 0x1D479: []rune{0x0072}, // Additional folding + 0x1D47A: []rune{0x0073}, // Additional folding + 0x1D47B: []rune{0x0074}, // Additional folding + 0x1D47C: []rune{0x0075}, // Additional folding + 0x1D47D: []rune{0x0076}, // Additional folding + 0x1D47E: []rune{0x0077}, // Additional folding + 0x1D47F: []rune{0x0078}, // Additional folding + 0x1D480: []rune{0x0079}, // Additional folding + 0x1D481: []rune{0x007A}, // Additional folding + 0x1D49C: []rune{0x0061}, // Additional folding + 0x1D49E: []rune{0x0063}, // Additional folding + 0x1D49F: []rune{0x0064}, // Additional folding + 0x1D4A2: []rune{0x0067}, // Additional folding + 0x1D4A5: []rune{0x006A}, // Additional folding + 0x1D4A6: []rune{0x006B}, // Additional folding + 0x1D4A9: []rune{0x006E}, // Additional folding + 0x1D4AA: []rune{0x006F}, // Additional folding + 0x1D4AB: []rune{0x0070}, // Additional folding + 0x1D4AC: []rune{0x0071}, // Additional folding + 0x1D4AE: []rune{0x0073}, // Additional folding + 0x1D4AF: []rune{0x0074}, // Additional folding + 0x1D4B0: []rune{0x0075}, // Additional folding + 0x1D4B1: []rune{0x0076}, // Additional folding + 0x1D4B2: []rune{0x0077}, // Additional folding + 0x1D4B3: []rune{0x0078}, // Additional folding + 0x1D4B4: []rune{0x0079}, // Additional folding + 0x1D4B5: []rune{0x007A}, // Additional folding + 0x1D4D0: []rune{0x0061}, // Additional folding + 0x1D4D1: []rune{0x0062}, // Additional folding + 0x1D4D2: []rune{0x0063}, // Additional folding + 0x1D4D3: []rune{0x0064}, // Additional folding + 0x1D4D4: []rune{0x0065}, // Additional folding + 0x1D4D5: []rune{0x0066}, // Additional folding + 0x1D4D6: []rune{0x0067}, // Additional folding + 0x1D4D7: []rune{0x0068}, // Additional folding + 0x1D4D8: []rune{0x0069}, // Additional folding + 0x1D4D9: []rune{0x006A}, // Additional folding + 0x1D4DA: []rune{0x006B}, // Additional folding + 0x1D4DB: []rune{0x006C}, // Additional folding + 0x1D4DC: []rune{0x006D}, // Additional folding + 0x1D4DD: []rune{0x006E}, // Additional folding + 0x1D4DE: []rune{0x006F}, // Additional folding + 0x1D4DF: []rune{0x0070}, // Additional folding + 0x1D4E0: []rune{0x0071}, // Additional folding + 0x1D4E1: []rune{0x0072}, // Additional folding + 0x1D4E2: []rune{0x0073}, // Additional folding + 0x1D4E3: []rune{0x0074}, // Additional folding + 0x1D4E4: []rune{0x0075}, // Additional folding + 0x1D4E5: []rune{0x0076}, // Additional folding + 0x1D4E6: []rune{0x0077}, // Additional folding + 0x1D4E7: []rune{0x0078}, // Additional folding + 0x1D4E8: []rune{0x0079}, // Additional folding + 0x1D4E9: []rune{0x007A}, // Additional folding + 0x1D504: []rune{0x0061}, // Additional folding + 0x1D505: []rune{0x0062}, // Additional folding + 0x1D507: []rune{0x0064}, // Additional folding + 0x1D508: []rune{0x0065}, // Additional folding + 0x1D509: []rune{0x0066}, // Additional folding + 0x1D50A: []rune{0x0067}, // Additional folding + 0x1D50D: []rune{0x006A}, // Additional folding + 0x1D50E: []rune{0x006B}, // Additional folding + 0x1D50F: []rune{0x006C}, // Additional folding + 0x1D510: []rune{0x006D}, // Additional folding + 0x1D511: []rune{0x006E}, // Additional folding + 0x1D512: []rune{0x006F}, // Additional folding + 0x1D513: []rune{0x0070}, // Additional folding + 0x1D514: []rune{0x0071}, // Additional folding + 0x1D516: []rune{0x0073}, // Additional folding + 0x1D517: []rune{0x0074}, // Additional folding + 0x1D518: []rune{0x0075}, // Additional folding + 0x1D519: []rune{0x0076}, // Additional folding + 0x1D51A: []rune{0x0077}, // Additional folding + 0x1D51B: []rune{0x0078}, // Additional folding + 0x1D51C: []rune{0x0079}, // Additional folding + 0x1D538: []rune{0x0061}, // Additional folding + 0x1D539: []rune{0x0062}, // Additional folding + 0x1D53B: []rune{0x0064}, // Additional folding + 0x1D53C: []rune{0x0065}, // Additional folding + 0x1D53D: []rune{0x0066}, // Additional folding + 0x1D53E: []rune{0x0067}, // Additional folding + 0x1D540: []rune{0x0069}, // Additional folding + 0x1D541: []rune{0x006A}, // Additional folding + 0x1D542: []rune{0x006B}, // Additional folding + 0x1D543: []rune{0x006C}, // Additional folding + 0x1D544: []rune{0x006D}, // Additional folding + 0x1D546: []rune{0x006F}, // Additional folding + 0x1D54A: []rune{0x0073}, // Additional folding + 0x1D54B: []rune{0x0074}, // Additional folding + 0x1D54C: []rune{0x0075}, // Additional folding + 0x1D54D: []rune{0x0076}, // Additional folding + 0x1D54E: []rune{0x0077}, // Additional folding + 0x1D54F: []rune{0x0078}, // Additional folding + 0x1D550: []rune{0x0079}, // Additional folding + 0x1D56C: []rune{0x0061}, // Additional folding + 0x1D56D: []rune{0x0062}, // Additional folding + 0x1D56E: []rune{0x0063}, // Additional folding + 0x1D56F: []rune{0x0064}, // Additional folding + 0x1D570: []rune{0x0065}, // Additional folding + 0x1D571: []rune{0x0066}, // Additional folding + 0x1D572: []rune{0x0067}, // Additional folding + 0x1D573: []rune{0x0068}, // Additional folding + 0x1D574: []rune{0x0069}, // Additional folding + 0x1D575: []rune{0x006A}, // Additional folding + 0x1D576: []rune{0x006B}, // Additional folding + 0x1D577: []rune{0x006C}, // Additional folding + 0x1D578: []rune{0x006D}, // Additional folding + 0x1D579: []rune{0x006E}, // Additional folding + 0x1D57A: []rune{0x006F}, // Additional folding + 0x1D57B: []rune{0x0070}, // Additional folding + 0x1D57C: []rune{0x0071}, // Additional folding + 0x1D57D: []rune{0x0072}, // Additional folding + 0x1D57E: []rune{0x0073}, // Additional folding + 0x1D57F: []rune{0x0074}, // Additional folding + 0x1D580: []rune{0x0075}, // Additional folding + 0x1D581: []rune{0x0076}, // Additional folding + 0x1D582: []rune{0x0077}, // Additional folding + 0x1D583: []rune{0x0078}, // Additional folding + 0x1D584: []rune{0x0079}, // Additional folding + 0x1D585: []rune{0x007A}, // Additional folding + 0x1D5A0: []rune{0x0061}, // Additional folding + 0x1D5A1: []rune{0x0062}, // Additional folding + 0x1D5A2: []rune{0x0063}, // Additional folding + 0x1D5A3: []rune{0x0064}, // Additional folding + 0x1D5A4: []rune{0x0065}, // Additional folding + 0x1D5A5: []rune{0x0066}, // Additional folding + 0x1D5A6: []rune{0x0067}, // Additional folding + 0x1D5A7: []rune{0x0068}, // Additional folding + 0x1D5A8: []rune{0x0069}, // Additional folding + 0x1D5A9: []rune{0x006A}, // Additional folding + 0x1D5AA: []rune{0x006B}, // Additional folding + 0x1D5AB: []rune{0x006C}, // Additional folding + 0x1D5AC: []rune{0x006D}, // Additional folding + 0x1D5AD: []rune{0x006E}, // Additional folding + 0x1D5AE: []rune{0x006F}, // Additional folding + 0x1D5AF: []rune{0x0070}, // Additional folding + 0x1D5B0: []rune{0x0071}, // Additional folding + 0x1D5B1: []rune{0x0072}, // Additional folding + 0x1D5B2: []rune{0x0073}, // Additional folding + 0x1D5B3: []rune{0x0074}, // Additional folding + 0x1D5B4: []rune{0x0075}, // Additional folding + 0x1D5B5: []rune{0x0076}, // Additional folding + 0x1D5B6: []rune{0x0077}, // Additional folding + 0x1D5B7: []rune{0x0078}, // Additional folding + 0x1D5B8: []rune{0x0079}, // Additional folding + 0x1D5B9: []rune{0x007A}, // Additional folding + 0x1D5D4: []rune{0x0061}, // Additional folding + 0x1D5D5: []rune{0x0062}, // Additional folding + 0x1D5D6: []rune{0x0063}, // Additional folding + 0x1D5D7: []rune{0x0064}, // Additional folding + 0x1D5D8: []rune{0x0065}, // Additional folding + 0x1D5D9: []rune{0x0066}, // Additional folding + 0x1D5DA: []rune{0x0067}, // Additional folding + 0x1D5DB: []rune{0x0068}, // Additional folding + 0x1D5DC: []rune{0x0069}, // Additional folding + 0x1D5DD: []rune{0x006A}, // Additional folding + 0x1D5DE: []rune{0x006B}, // Additional folding + 0x1D5DF: []rune{0x006C}, // Additional folding + 0x1D5E0: []rune{0x006D}, // Additional folding + 0x1D5E1: []rune{0x006E}, // Additional folding + 0x1D5E2: []rune{0x006F}, // Additional folding + 0x1D5E3: []rune{0x0070}, // Additional folding + 0x1D5E4: []rune{0x0071}, // Additional folding + 0x1D5E5: []rune{0x0072}, // Additional folding + 0x1D5E6: []rune{0x0073}, // Additional folding + 0x1D5E7: []rune{0x0074}, // Additional folding + 0x1D5E8: []rune{0x0075}, // Additional folding + 0x1D5E9: []rune{0x0076}, // Additional folding + 0x1D5EA: []rune{0x0077}, // Additional folding + 0x1D5EB: []rune{0x0078}, // Additional folding + 0x1D5EC: []rune{0x0079}, // Additional folding + 0x1D5ED: []rune{0x007A}, // Additional folding + 0x1D608: []rune{0x0061}, // Additional folding + 0x1D609: []rune{0x0062}, // Additional folding + 0x1D60A: []rune{0x0063}, // Additional folding + 0x1D60B: []rune{0x0064}, // Additional folding + 0x1D60C: []rune{0x0065}, // Additional folding + 0x1D60D: []rune{0x0066}, // Additional folding + 0x1D60E: []rune{0x0067}, // Additional folding + 0x1D60F: []rune{0x0068}, // Additional folding + 0x1D610: []rune{0x0069}, // Additional folding + 0x1D611: []rune{0x006A}, // Additional folding + 0x1D612: []rune{0x006B}, // Additional folding + 0x1D613: []rune{0x006C}, // Additional folding + 0x1D614: []rune{0x006D}, // Additional folding + 0x1D615: []rune{0x006E}, // Additional folding + 0x1D616: []rune{0x006F}, // Additional folding + 0x1D617: []rune{0x0070}, // Additional folding + 0x1D618: []rune{0x0071}, // Additional folding + 0x1D619: []rune{0x0072}, // Additional folding + 0x1D61A: []rune{0x0073}, // Additional folding + 0x1D61B: []rune{0x0074}, // Additional folding + 0x1D61C: []rune{0x0075}, // Additional folding + 0x1D61D: []rune{0x0076}, // Additional folding + 0x1D61E: []rune{0x0077}, // Additional folding + 0x1D61F: []rune{0x0078}, // Additional folding + 0x1D620: []rune{0x0079}, // Additional folding + 0x1D621: []rune{0x007A}, // Additional folding + 0x1D63C: []rune{0x0061}, // Additional folding + 0x1D63D: []rune{0x0062}, // Additional folding + 0x1D63E: []rune{0x0063}, // Additional folding + 0x1D63F: []rune{0x0064}, // Additional folding + 0x1D640: []rune{0x0065}, // Additional folding + 0x1D641: []rune{0x0066}, // Additional folding + 0x1D642: []rune{0x0067}, // Additional folding + 0x1D643: []rune{0x0068}, // Additional folding + 0x1D644: []rune{0x0069}, // Additional folding + 0x1D645: []rune{0x006A}, // Additional folding + 0x1D646: []rune{0x006B}, // Additional folding + 0x1D647: []rune{0x006C}, // Additional folding + 0x1D648: []rune{0x006D}, // Additional folding + 0x1D649: []rune{0x006E}, // Additional folding + 0x1D64A: []rune{0x006F}, // Additional folding + 0x1D64B: []rune{0x0070}, // Additional folding + 0x1D64C: []rune{0x0071}, // Additional folding + 0x1D64D: []rune{0x0072}, // Additional folding + 0x1D64E: []rune{0x0073}, // Additional folding + 0x1D64F: []rune{0x0074}, // Additional folding + 0x1D650: []rune{0x0075}, // Additional folding + 0x1D651: []rune{0x0076}, // Additional folding + 0x1D652: []rune{0x0077}, // Additional folding + 0x1D653: []rune{0x0078}, // Additional folding + 0x1D654: []rune{0x0079}, // Additional folding + 0x1D655: []rune{0x007A}, // Additional folding + 0x1D670: []rune{0x0061}, // Additional folding + 0x1D671: []rune{0x0062}, // Additional folding + 0x1D672: []rune{0x0063}, // Additional folding + 0x1D673: []rune{0x0064}, // Additional folding + 0x1D674: []rune{0x0065}, // Additional folding + 0x1D675: []rune{0x0066}, // Additional folding + 0x1D676: []rune{0x0067}, // Additional folding + 0x1D677: []rune{0x0068}, // Additional folding + 0x1D678: []rune{0x0069}, // Additional folding + 0x1D679: []rune{0x006A}, // Additional folding + 0x1D67A: []rune{0x006B}, // Additional folding + 0x1D67B: []rune{0x006C}, // Additional folding + 0x1D67C: []rune{0x006D}, // Additional folding + 0x1D67D: []rune{0x006E}, // Additional folding + 0x1D67E: []rune{0x006F}, // Additional folding + 0x1D67F: []rune{0x0070}, // Additional folding + 0x1D680: []rune{0x0071}, // Additional folding + 0x1D681: []rune{0x0072}, // Additional folding + 0x1D682: []rune{0x0073}, // Additional folding + 0x1D683: []rune{0x0074}, // Additional folding + 0x1D684: []rune{0x0075}, // Additional folding + 0x1D685: []rune{0x0076}, // Additional folding + 0x1D686: []rune{0x0077}, // Additional folding + 0x1D687: []rune{0x0078}, // Additional folding + 0x1D688: []rune{0x0079}, // Additional folding + 0x1D689: []rune{0x007A}, // Additional folding + 0x1D6A8: []rune{0x03B1}, // Additional folding + 0x1D6A9: []rune{0x03B2}, // Additional folding + 0x1D6AA: []rune{0x03B3}, // Additional folding + 0x1D6AB: []rune{0x03B4}, // Additional folding + 0x1D6AC: []rune{0x03B5}, // Additional folding + 0x1D6AD: []rune{0x03B6}, // Additional folding + 0x1D6AE: []rune{0x03B7}, // Additional folding + 0x1D6AF: []rune{0x03B8}, // Additional folding + 0x1D6B0: []rune{0x03B9}, // Additional folding + 0x1D6B1: []rune{0x03BA}, // Additional folding + 0x1D6B2: []rune{0x03BB}, // Additional folding + 0x1D6B3: []rune{0x03BC}, // Additional folding + 0x1D6B4: []rune{0x03BD}, // Additional folding + 0x1D6B5: []rune{0x03BE}, // Additional folding + 0x1D6B6: []rune{0x03BF}, // Additional folding + 0x1D6B7: []rune{0x03C0}, // Additional folding + 0x1D6B8: []rune{0x03C1}, // Additional folding + 0x1D6B9: []rune{0x03B8}, // Additional folding + 0x1D6BA: []rune{0x03C3}, // Additional folding + 0x1D6BB: []rune{0x03C4}, // Additional folding + 0x1D6BC: []rune{0x03C5}, // Additional folding + 0x1D6BD: []rune{0x03C6}, // Additional folding + 0x1D6BE: []rune{0x03C7}, // Additional folding + 0x1D6BF: []rune{0x03C8}, // Additional folding + 0x1D6C0: []rune{0x03C9}, // Additional folding + 0x1D6D3: []rune{0x03C3}, // Additional folding + 0x1D6E2: []rune{0x03B1}, // Additional folding + 0x1D6E3: []rune{0x03B2}, // Additional folding + 0x1D6E4: []rune{0x03B3}, // Additional folding + 0x1D6E5: []rune{0x03B4}, // Additional folding + 0x1D6E6: []rune{0x03B5}, // Additional folding + 0x1D6E7: []rune{0x03B6}, // Additional folding + 0x1D6E8: []rune{0x03B7}, // Additional folding + 0x1D6E9: []rune{0x03B8}, // Additional folding + 0x1D6EA: []rune{0x03B9}, // Additional folding + 0x1D6EB: []rune{0x03BA}, // Additional folding + 0x1D6EC: []rune{0x03BB}, // Additional folding + 0x1D6ED: []rune{0x03BC}, // Additional folding + 0x1D6EE: []rune{0x03BD}, // Additional folding + 0x1D6EF: []rune{0x03BE}, // Additional folding + 0x1D6F0: []rune{0x03BF}, // Additional folding + 0x1D6F1: []rune{0x03C0}, // Additional folding + 0x1D6F2: []rune{0x03C1}, // Additional folding + 0x1D6F3: []rune{0x03B8}, // Additional folding + 0x1D6F4: []rune{0x03C3}, // Additional folding + 0x1D6F5: []rune{0x03C4}, // Additional folding + 0x1D6F6: []rune{0x03C5}, // Additional folding + 0x1D6F7: []rune{0x03C6}, // Additional folding + 0x1D6F8: []rune{0x03C7}, // Additional folding + 0x1D6F9: []rune{0x03C8}, // Additional folding + 0x1D6FA: []rune{0x03C9}, // Additional folding + 0x1D70D: []rune{0x03C3}, // Additional folding + 0x1D71C: []rune{0x03B1}, // Additional folding + 0x1D71D: []rune{0x03B2}, // Additional folding + 0x1D71E: []rune{0x03B3}, // Additional folding + 0x1D71F: []rune{0x03B4}, // Additional folding + 0x1D720: []rune{0x03B5}, // Additional folding + 0x1D721: []rune{0x03B6}, // Additional folding + 0x1D722: []rune{0x03B7}, // Additional folding + 0x1D723: []rune{0x03B8}, // Additional folding + 0x1D724: []rune{0x03B9}, // Additional folding + 0x1D725: []rune{0x03BA}, // Additional folding + 0x1D726: []rune{0x03BB}, // Additional folding + 0x1D727: []rune{0x03BC}, // Additional folding + 0x1D728: []rune{0x03BD}, // Additional folding + 0x1D729: []rune{0x03BE}, // Additional folding + 0x1D72A: []rune{0x03BF}, // Additional folding + 0x1D72B: []rune{0x03C0}, // Additional folding + 0x1D72C: []rune{0x03C1}, // Additional folding + 0x1D72D: []rune{0x03B8}, // Additional folding + 0x1D72E: []rune{0x03C3}, // Additional folding + 0x1D72F: []rune{0x03C4}, // Additional folding + 0x1D730: []rune{0x03C5}, // Additional folding + 0x1D731: []rune{0x03C6}, // Additional folding + 0x1D732: []rune{0x03C7}, // Additional folding + 0x1D733: []rune{0x03C8}, // Additional folding + 0x1D734: []rune{0x03C9}, // Additional folding + 0x1D747: []rune{0x03C3}, // Additional folding + 0x1D756: []rune{0x03B1}, // Additional folding + 0x1D757: []rune{0x03B2}, // Additional folding + 0x1D758: []rune{0x03B3}, // Additional folding + 0x1D759: []rune{0x03B4}, // Additional folding + 0x1D75A: []rune{0x03B5}, // Additional folding + 0x1D75B: []rune{0x03B6}, // Additional folding + 0x1D75C: []rune{0x03B7}, // Additional folding + 0x1D75D: []rune{0x03B8}, // Additional folding + 0x1D75E: []rune{0x03B9}, // Additional folding + 0x1D75F: []rune{0x03BA}, // Additional folding + 0x1D760: []rune{0x03BB}, // Additional folding + 0x1D761: []rune{0x03BC}, // Additional folding + 0x1D762: []rune{0x03BD}, // Additional folding + 0x1D763: []rune{0x03BE}, // Additional folding + 0x1D764: []rune{0x03BF}, // Additional folding + 0x1D765: []rune{0x03C0}, // Additional folding + 0x1D766: []rune{0x03C1}, // Additional folding + 0x1D767: []rune{0x03B8}, // Additional folding + 0x1D768: []rune{0x03C3}, // Additional folding + 0x1D769: []rune{0x03C4}, // Additional folding + 0x1D76A: []rune{0x03C5}, // Additional folding + 0x1D76B: []rune{0x03C6}, // Additional folding + 0x1D76C: []rune{0x03C7}, // Additional folding + 0x1D76D: []rune{0x03C8}, // Additional folding + 0x1D76E: []rune{0x03C9}, // Additional folding + 0x1D781: []rune{0x03C3}, // Additional folding + 0x1D790: []rune{0x03B1}, // Additional folding + 0x1D791: []rune{0x03B2}, // Additional folding + 0x1D792: []rune{0x03B3}, // Additional folding + 0x1D793: []rune{0x03B4}, // Additional folding + 0x1D794: []rune{0x03B5}, // Additional folding + 0x1D795: []rune{0x03B6}, // Additional folding + 0x1D796: []rune{0x03B7}, // Additional folding + 0x1D797: []rune{0x03B8}, // Additional folding + 0x1D798: []rune{0x03B9}, // Additional folding + 0x1D799: []rune{0x03BA}, // Additional folding + 0x1D79A: []rune{0x03BB}, // Additional folding + 0x1D79B: []rune{0x03BC}, // Additional folding + 0x1D79C: []rune{0x03BD}, // Additional folding + 0x1D79D: []rune{0x03BE}, // Additional folding + 0x1D79E: []rune{0x03BF}, // Additional folding + 0x1D79F: []rune{0x03C0}, // Additional folding + 0x1D7A0: []rune{0x03C1}, // Additional folding + 0x1D7A1: []rune{0x03B8}, // Additional folding + 0x1D7A2: []rune{0x03C3}, // Additional folding + 0x1D7A3: []rune{0x03C4}, // Additional folding + 0x1D7A4: []rune{0x03C5}, // Additional folding + 0x1D7A5: []rune{0x03C6}, // Additional folding + 0x1D7A6: []rune{0x03C7}, // Additional folding + 0x1D7A7: []rune{0x03C8}, // Additional folding + 0x1D7A8: []rune{0x03C9}, // Additional folding + 0x1D7BB: []rune{0x03C3}, // Additional folding +} + +// TableB2 represents RFC-3454 Table B.2. +var TableB2 Mapping = tableB2 + +var tableB3 = Mapping{ + 0x0041: []rune{0x0061}, // Case map + 0x0042: []rune{0x0062}, // Case map + 0x0043: []rune{0x0063}, // Case map + 0x0044: []rune{0x0064}, // Case map + 0x0045: []rune{0x0065}, // Case map + 0x0046: []rune{0x0066}, // Case map + 0x0047: []rune{0x0067}, // Case map + 0x0048: []rune{0x0068}, // Case map + 0x0049: []rune{0x0069}, // Case map + 0x004A: []rune{0x006A}, // Case map + 0x004B: []rune{0x006B}, // Case map + 0x004C: []rune{0x006C}, // Case map + 0x004D: []rune{0x006D}, // Case map + 0x004E: []rune{0x006E}, // Case map + 0x004F: []rune{0x006F}, // Case map + 0x0050: []rune{0x0070}, // Case map + 0x0051: []rune{0x0071}, // Case map + 0x0052: []rune{0x0072}, // Case map + 0x0053: []rune{0x0073}, // Case map + 0x0054: []rune{0x0074}, // Case map + 0x0055: []rune{0x0075}, // Case map + 0x0056: []rune{0x0076}, // Case map + 0x0057: []rune{0x0077}, // Case map + 0x0058: []rune{0x0078}, // Case map + 0x0059: []rune{0x0079}, // Case map + 0x005A: []rune{0x007A}, // Case map + 0x00B5: []rune{0x03BC}, // Case map + 0x00C0: []rune{0x00E0}, // Case map + 0x00C1: []rune{0x00E1}, // Case map + 0x00C2: []rune{0x00E2}, // Case map + 0x00C3: []rune{0x00E3}, // Case map + 0x00C4: []rune{0x00E4}, // Case map + 0x00C5: []rune{0x00E5}, // Case map + 0x00C6: []rune{0x00E6}, // Case map + 0x00C7: []rune{0x00E7}, // Case map + 0x00C8: []rune{0x00E8}, // Case map + 0x00C9: []rune{0x00E9}, // Case map + 0x00CA: []rune{0x00EA}, // Case map + 0x00CB: []rune{0x00EB}, // Case map + 0x00CC: []rune{0x00EC}, // Case map + 0x00CD: []rune{0x00ED}, // Case map + 0x00CE: []rune{0x00EE}, // Case map + 0x00CF: []rune{0x00EF}, // Case map + 0x00D0: []rune{0x00F0}, // Case map + 0x00D1: []rune{0x00F1}, // Case map + 0x00D2: []rune{0x00F2}, // Case map + 0x00D3: []rune{0x00F3}, // Case map + 0x00D4: []rune{0x00F4}, // Case map + 0x00D5: []rune{0x00F5}, // Case map + 0x00D6: []rune{0x00F6}, // Case map + 0x00D8: []rune{0x00F8}, // Case map + 0x00D9: []rune{0x00F9}, // Case map + 0x00DA: []rune{0x00FA}, // Case map + 0x00DB: []rune{0x00FB}, // Case map + 0x00DC: []rune{0x00FC}, // Case map + 0x00DD: []rune{0x00FD}, // Case map + 0x00DE: []rune{0x00FE}, // Case map + 0x00DF: []rune{0x0073, 0x0073}, // Case map + 0x0100: []rune{0x0101}, // Case map + 0x0102: []rune{0x0103}, // Case map + 0x0104: []rune{0x0105}, // Case map + 0x0106: []rune{0x0107}, // Case map + 0x0108: []rune{0x0109}, // Case map + 0x010A: []rune{0x010B}, // Case map + 0x010C: []rune{0x010D}, // Case map + 0x010E: []rune{0x010F}, // Case map + 0x0110: []rune{0x0111}, // Case map + 0x0112: []rune{0x0113}, // Case map + 0x0114: []rune{0x0115}, // Case map + 0x0116: []rune{0x0117}, // Case map + 0x0118: []rune{0x0119}, // Case map + 0x011A: []rune{0x011B}, // Case map + 0x011C: []rune{0x011D}, // Case map + 0x011E: []rune{0x011F}, // Case map + 0x0120: []rune{0x0121}, // Case map + 0x0122: []rune{0x0123}, // Case map + 0x0124: []rune{0x0125}, // Case map + 0x0126: []rune{0x0127}, // Case map + 0x0128: []rune{0x0129}, // Case map + 0x012A: []rune{0x012B}, // Case map + 0x012C: []rune{0x012D}, // Case map + 0x012E: []rune{0x012F}, // Case map + 0x0130: []rune{0x0069, 0x0307}, // Case map + 0x0132: []rune{0x0133}, // Case map + 0x0134: []rune{0x0135}, // Case map + 0x0136: []rune{0x0137}, // Case map + 0x0139: []rune{0x013A}, // Case map + 0x013B: []rune{0x013C}, // Case map + 0x013D: []rune{0x013E}, // Case map + 0x013F: []rune{0x0140}, // Case map + 0x0141: []rune{0x0142}, // Case map + 0x0143: []rune{0x0144}, // Case map + 0x0145: []rune{0x0146}, // Case map + 0x0147: []rune{0x0148}, // Case map + 0x0149: []rune{0x02BC, 0x006E}, // Case map + 0x014A: []rune{0x014B}, // Case map + 0x014C: []rune{0x014D}, // Case map + 0x014E: []rune{0x014F}, // Case map + 0x0150: []rune{0x0151}, // Case map + 0x0152: []rune{0x0153}, // Case map + 0x0154: []rune{0x0155}, // Case map + 0x0156: []rune{0x0157}, // Case map + 0x0158: []rune{0x0159}, // Case map + 0x015A: []rune{0x015B}, // Case map + 0x015C: []rune{0x015D}, // Case map + 0x015E: []rune{0x015F}, // Case map + 0x0160: []rune{0x0161}, // Case map + 0x0162: []rune{0x0163}, // Case map + 0x0164: []rune{0x0165}, // Case map + 0x0166: []rune{0x0167}, // Case map + 0x0168: []rune{0x0169}, // Case map + 0x016A: []rune{0x016B}, // Case map + 0x016C: []rune{0x016D}, // Case map + 0x016E: []rune{0x016F}, // Case map + 0x0170: []rune{0x0171}, // Case map + 0x0172: []rune{0x0173}, // Case map + 0x0174: []rune{0x0175}, // Case map + 0x0176: []rune{0x0177}, // Case map + 0x0178: []rune{0x00FF}, // Case map + 0x0179: []rune{0x017A}, // Case map + 0x017B: []rune{0x017C}, // Case map + 0x017D: []rune{0x017E}, // Case map + 0x017F: []rune{0x0073}, // Case map + 0x0181: []rune{0x0253}, // Case map + 0x0182: []rune{0x0183}, // Case map + 0x0184: []rune{0x0185}, // Case map + 0x0186: []rune{0x0254}, // Case map + 0x0187: []rune{0x0188}, // Case map + 0x0189: []rune{0x0256}, // Case map + 0x018A: []rune{0x0257}, // Case map + 0x018B: []rune{0x018C}, // Case map + 0x018E: []rune{0x01DD}, // Case map + 0x018F: []rune{0x0259}, // Case map + 0x0190: []rune{0x025B}, // Case map + 0x0191: []rune{0x0192}, // Case map + 0x0193: []rune{0x0260}, // Case map + 0x0194: []rune{0x0263}, // Case map + 0x0196: []rune{0x0269}, // Case map + 0x0197: []rune{0x0268}, // Case map + 0x0198: []rune{0x0199}, // Case map + 0x019C: []rune{0x026F}, // Case map + 0x019D: []rune{0x0272}, // Case map + 0x019F: []rune{0x0275}, // Case map + 0x01A0: []rune{0x01A1}, // Case map + 0x01A2: []rune{0x01A3}, // Case map + 0x01A4: []rune{0x01A5}, // Case map + 0x01A6: []rune{0x0280}, // Case map + 0x01A7: []rune{0x01A8}, // Case map + 0x01A9: []rune{0x0283}, // Case map + 0x01AC: []rune{0x01AD}, // Case map + 0x01AE: []rune{0x0288}, // Case map + 0x01AF: []rune{0x01B0}, // Case map + 0x01B1: []rune{0x028A}, // Case map + 0x01B2: []rune{0x028B}, // Case map + 0x01B3: []rune{0x01B4}, // Case map + 0x01B5: []rune{0x01B6}, // Case map + 0x01B7: []rune{0x0292}, // Case map + 0x01B8: []rune{0x01B9}, // Case map + 0x01BC: []rune{0x01BD}, // Case map + 0x01C4: []rune{0x01C6}, // Case map + 0x01C5: []rune{0x01C6}, // Case map + 0x01C7: []rune{0x01C9}, // Case map + 0x01C8: []rune{0x01C9}, // Case map + 0x01CA: []rune{0x01CC}, // Case map + 0x01CB: []rune{0x01CC}, // Case map + 0x01CD: []rune{0x01CE}, // Case map + 0x01CF: []rune{0x01D0}, // Case map + 0x01D1: []rune{0x01D2}, // Case map + 0x01D3: []rune{0x01D4}, // Case map + 0x01D5: []rune{0x01D6}, // Case map + 0x01D7: []rune{0x01D8}, // Case map + 0x01D9: []rune{0x01DA}, // Case map + 0x01DB: []rune{0x01DC}, // Case map + 0x01DE: []rune{0x01DF}, // Case map + 0x01E0: []rune{0x01E1}, // Case map + 0x01E2: []rune{0x01E3}, // Case map + 0x01E4: []rune{0x01E5}, // Case map + 0x01E6: []rune{0x01E7}, // Case map + 0x01E8: []rune{0x01E9}, // Case map + 0x01EA: []rune{0x01EB}, // Case map + 0x01EC: []rune{0x01ED}, // Case map + 0x01EE: []rune{0x01EF}, // Case map + 0x01F0: []rune{0x006A, 0x030C}, // Case map + 0x01F1: []rune{0x01F3}, // Case map + 0x01F2: []rune{0x01F3}, // Case map + 0x01F4: []rune{0x01F5}, // Case map + 0x01F6: []rune{0x0195}, // Case map + 0x01F7: []rune{0x01BF}, // Case map + 0x01F8: []rune{0x01F9}, // Case map + 0x01FA: []rune{0x01FB}, // Case map + 0x01FC: []rune{0x01FD}, // Case map + 0x01FE: []rune{0x01FF}, // Case map + 0x0200: []rune{0x0201}, // Case map + 0x0202: []rune{0x0203}, // Case map + 0x0204: []rune{0x0205}, // Case map + 0x0206: []rune{0x0207}, // Case map + 0x0208: []rune{0x0209}, // Case map + 0x020A: []rune{0x020B}, // Case map + 0x020C: []rune{0x020D}, // Case map + 0x020E: []rune{0x020F}, // Case map + 0x0210: []rune{0x0211}, // Case map + 0x0212: []rune{0x0213}, // Case map + 0x0214: []rune{0x0215}, // Case map + 0x0216: []rune{0x0217}, // Case map + 0x0218: []rune{0x0219}, // Case map + 0x021A: []rune{0x021B}, // Case map + 0x021C: []rune{0x021D}, // Case map + 0x021E: []rune{0x021F}, // Case map + 0x0220: []rune{0x019E}, // Case map + 0x0222: []rune{0x0223}, // Case map + 0x0224: []rune{0x0225}, // Case map + 0x0226: []rune{0x0227}, // Case map + 0x0228: []rune{0x0229}, // Case map + 0x022A: []rune{0x022B}, // Case map + 0x022C: []rune{0x022D}, // Case map + 0x022E: []rune{0x022F}, // Case map + 0x0230: []rune{0x0231}, // Case map + 0x0232: []rune{0x0233}, // Case map + 0x0345: []rune{0x03B9}, // Case map + 0x0386: []rune{0x03AC}, // Case map + 0x0388: []rune{0x03AD}, // Case map + 0x0389: []rune{0x03AE}, // Case map + 0x038A: []rune{0x03AF}, // Case map + 0x038C: []rune{0x03CC}, // Case map + 0x038E: []rune{0x03CD}, // Case map + 0x038F: []rune{0x03CE}, // Case map + 0x0390: []rune{0x03B9, 0x0308, 0x0301}, // Case map + 0x0391: []rune{0x03B1}, // Case map + 0x0392: []rune{0x03B2}, // Case map + 0x0393: []rune{0x03B3}, // Case map + 0x0394: []rune{0x03B4}, // Case map + 0x0395: []rune{0x03B5}, // Case map + 0x0396: []rune{0x03B6}, // Case map + 0x0397: []rune{0x03B7}, // Case map + 0x0398: []rune{0x03B8}, // Case map + 0x0399: []rune{0x03B9}, // Case map + 0x039A: []rune{0x03BA}, // Case map + 0x039B: []rune{0x03BB}, // Case map + 0x039C: []rune{0x03BC}, // Case map + 0x039D: []rune{0x03BD}, // Case map + 0x039E: []rune{0x03BE}, // Case map + 0x039F: []rune{0x03BF}, // Case map + 0x03A0: []rune{0x03C0}, // Case map + 0x03A1: []rune{0x03C1}, // Case map + 0x03A3: []rune{0x03C3}, // Case map + 0x03A4: []rune{0x03C4}, // Case map + 0x03A5: []rune{0x03C5}, // Case map + 0x03A6: []rune{0x03C6}, // Case map + 0x03A7: []rune{0x03C7}, // Case map + 0x03A8: []rune{0x03C8}, // Case map + 0x03A9: []rune{0x03C9}, // Case map + 0x03AA: []rune{0x03CA}, // Case map + 0x03AB: []rune{0x03CB}, // Case map + 0x03B0: []rune{0x03C5, 0x0308, 0x0301}, // Case map + 0x03C2: []rune{0x03C3}, // Case map + 0x03D0: []rune{0x03B2}, // Case map + 0x03D1: []rune{0x03B8}, // Case map + 0x03D5: []rune{0x03C6}, // Case map + 0x03D6: []rune{0x03C0}, // Case map + 0x03D8: []rune{0x03D9}, // Case map + 0x03DA: []rune{0x03DB}, // Case map + 0x03DC: []rune{0x03DD}, // Case map + 0x03DE: []rune{0x03DF}, // Case map + 0x03E0: []rune{0x03E1}, // Case map + 0x03E2: []rune{0x03E3}, // Case map + 0x03E4: []rune{0x03E5}, // Case map + 0x03E6: []rune{0x03E7}, // Case map + 0x03E8: []rune{0x03E9}, // Case map + 0x03EA: []rune{0x03EB}, // Case map + 0x03EC: []rune{0x03ED}, // Case map + 0x03EE: []rune{0x03EF}, // Case map + 0x03F0: []rune{0x03BA}, // Case map + 0x03F1: []rune{0x03C1}, // Case map + 0x03F2: []rune{0x03C3}, // Case map + 0x03F4: []rune{0x03B8}, // Case map + 0x03F5: []rune{0x03B5}, // Case map + 0x0400: []rune{0x0450}, // Case map + 0x0401: []rune{0x0451}, // Case map + 0x0402: []rune{0x0452}, // Case map + 0x0403: []rune{0x0453}, // Case map + 0x0404: []rune{0x0454}, // Case map + 0x0405: []rune{0x0455}, // Case map + 0x0406: []rune{0x0456}, // Case map + 0x0407: []rune{0x0457}, // Case map + 0x0408: []rune{0x0458}, // Case map + 0x0409: []rune{0x0459}, // Case map + 0x040A: []rune{0x045A}, // Case map + 0x040B: []rune{0x045B}, // Case map + 0x040C: []rune{0x045C}, // Case map + 0x040D: []rune{0x045D}, // Case map + 0x040E: []rune{0x045E}, // Case map + 0x040F: []rune{0x045F}, // Case map + 0x0410: []rune{0x0430}, // Case map + 0x0411: []rune{0x0431}, // Case map + 0x0412: []rune{0x0432}, // Case map + 0x0413: []rune{0x0433}, // Case map + 0x0414: []rune{0x0434}, // Case map + 0x0415: []rune{0x0435}, // Case map + 0x0416: []rune{0x0436}, // Case map + 0x0417: []rune{0x0437}, // Case map + 0x0418: []rune{0x0438}, // Case map + 0x0419: []rune{0x0439}, // Case map + 0x041A: []rune{0x043A}, // Case map + 0x041B: []rune{0x043B}, // Case map + 0x041C: []rune{0x043C}, // Case map + 0x041D: []rune{0x043D}, // Case map + 0x041E: []rune{0x043E}, // Case map + 0x041F: []rune{0x043F}, // Case map + 0x0420: []rune{0x0440}, // Case map + 0x0421: []rune{0x0441}, // Case map + 0x0422: []rune{0x0442}, // Case map + 0x0423: []rune{0x0443}, // Case map + 0x0424: []rune{0x0444}, // Case map + 0x0425: []rune{0x0445}, // Case map + 0x0426: []rune{0x0446}, // Case map + 0x0427: []rune{0x0447}, // Case map + 0x0428: []rune{0x0448}, // Case map + 0x0429: []rune{0x0449}, // Case map + 0x042A: []rune{0x044A}, // Case map + 0x042B: []rune{0x044B}, // Case map + 0x042C: []rune{0x044C}, // Case map + 0x042D: []rune{0x044D}, // Case map + 0x042E: []rune{0x044E}, // Case map + 0x042F: []rune{0x044F}, // Case map + 0x0460: []rune{0x0461}, // Case map + 0x0462: []rune{0x0463}, // Case map + 0x0464: []rune{0x0465}, // Case map + 0x0466: []rune{0x0467}, // Case map + 0x0468: []rune{0x0469}, // Case map + 0x046A: []rune{0x046B}, // Case map + 0x046C: []rune{0x046D}, // Case map + 0x046E: []rune{0x046F}, // Case map + 0x0470: []rune{0x0471}, // Case map + 0x0472: []rune{0x0473}, // Case map + 0x0474: []rune{0x0475}, // Case map + 0x0476: []rune{0x0477}, // Case map + 0x0478: []rune{0x0479}, // Case map + 0x047A: []rune{0x047B}, // Case map + 0x047C: []rune{0x047D}, // Case map + 0x047E: []rune{0x047F}, // Case map + 0x0480: []rune{0x0481}, // Case map + 0x048A: []rune{0x048B}, // Case map + 0x048C: []rune{0x048D}, // Case map + 0x048E: []rune{0x048F}, // Case map + 0x0490: []rune{0x0491}, // Case map + 0x0492: []rune{0x0493}, // Case map + 0x0494: []rune{0x0495}, // Case map + 0x0496: []rune{0x0497}, // Case map + 0x0498: []rune{0x0499}, // Case map + 0x049A: []rune{0x049B}, // Case map + 0x049C: []rune{0x049D}, // Case map + 0x049E: []rune{0x049F}, // Case map + 0x04A0: []rune{0x04A1}, // Case map + 0x04A2: []rune{0x04A3}, // Case map + 0x04A4: []rune{0x04A5}, // Case map + 0x04A6: []rune{0x04A7}, // Case map + 0x04A8: []rune{0x04A9}, // Case map + 0x04AA: []rune{0x04AB}, // Case map + 0x04AC: []rune{0x04AD}, // Case map + 0x04AE: []rune{0x04AF}, // Case map + 0x04B0: []rune{0x04B1}, // Case map + 0x04B2: []rune{0x04B3}, // Case map + 0x04B4: []rune{0x04B5}, // Case map + 0x04B6: []rune{0x04B7}, // Case map + 0x04B8: []rune{0x04B9}, // Case map + 0x04BA: []rune{0x04BB}, // Case map + 0x04BC: []rune{0x04BD}, // Case map + 0x04BE: []rune{0x04BF}, // Case map + 0x04C1: []rune{0x04C2}, // Case map + 0x04C3: []rune{0x04C4}, // Case map + 0x04C5: []rune{0x04C6}, // Case map + 0x04C7: []rune{0x04C8}, // Case map + 0x04C9: []rune{0x04CA}, // Case map + 0x04CB: []rune{0x04CC}, // Case map + 0x04CD: []rune{0x04CE}, // Case map + 0x04D0: []rune{0x04D1}, // Case map + 0x04D2: []rune{0x04D3}, // Case map + 0x04D4: []rune{0x04D5}, // Case map + 0x04D6: []rune{0x04D7}, // Case map + 0x04D8: []rune{0x04D9}, // Case map + 0x04DA: []rune{0x04DB}, // Case map + 0x04DC: []rune{0x04DD}, // Case map + 0x04DE: []rune{0x04DF}, // Case map + 0x04E0: []rune{0x04E1}, // Case map + 0x04E2: []rune{0x04E3}, // Case map + 0x04E4: []rune{0x04E5}, // Case map + 0x04E6: []rune{0x04E7}, // Case map + 0x04E8: []rune{0x04E9}, // Case map + 0x04EA: []rune{0x04EB}, // Case map + 0x04EC: []rune{0x04ED}, // Case map + 0x04EE: []rune{0x04EF}, // Case map + 0x04F0: []rune{0x04F1}, // Case map + 0x04F2: []rune{0x04F3}, // Case map + 0x04F4: []rune{0x04F5}, // Case map + 0x04F8: []rune{0x04F9}, // Case map + 0x0500: []rune{0x0501}, // Case map + 0x0502: []rune{0x0503}, // Case map + 0x0504: []rune{0x0505}, // Case map + 0x0506: []rune{0x0507}, // Case map + 0x0508: []rune{0x0509}, // Case map + 0x050A: []rune{0x050B}, // Case map + 0x050C: []rune{0x050D}, // Case map + 0x050E: []rune{0x050F}, // Case map + 0x0531: []rune{0x0561}, // Case map + 0x0532: []rune{0x0562}, // Case map + 0x0533: []rune{0x0563}, // Case map + 0x0534: []rune{0x0564}, // Case map + 0x0535: []rune{0x0565}, // Case map + 0x0536: []rune{0x0566}, // Case map + 0x0537: []rune{0x0567}, // Case map + 0x0538: []rune{0x0568}, // Case map + 0x0539: []rune{0x0569}, // Case map + 0x053A: []rune{0x056A}, // Case map + 0x053B: []rune{0x056B}, // Case map + 0x053C: []rune{0x056C}, // Case map + 0x053D: []rune{0x056D}, // Case map + 0x053E: []rune{0x056E}, // Case map + 0x053F: []rune{0x056F}, // Case map + 0x0540: []rune{0x0570}, // Case map + 0x0541: []rune{0x0571}, // Case map + 0x0542: []rune{0x0572}, // Case map + 0x0543: []rune{0x0573}, // Case map + 0x0544: []rune{0x0574}, // Case map + 0x0545: []rune{0x0575}, // Case map + 0x0546: []rune{0x0576}, // Case map + 0x0547: []rune{0x0577}, // Case map + 0x0548: []rune{0x0578}, // Case map + 0x0549: []rune{0x0579}, // Case map + 0x054A: []rune{0x057A}, // Case map + 0x054B: []rune{0x057B}, // Case map + 0x054C: []rune{0x057C}, // Case map + 0x054D: []rune{0x057D}, // Case map + 0x054E: []rune{0x057E}, // Case map + 0x054F: []rune{0x057F}, // Case map + 0x0550: []rune{0x0580}, // Case map + 0x0551: []rune{0x0581}, // Case map + 0x0552: []rune{0x0582}, // Case map + 0x0553: []rune{0x0583}, // Case map + 0x0554: []rune{0x0584}, // Case map + 0x0555: []rune{0x0585}, // Case map + 0x0556: []rune{0x0586}, // Case map + 0x0587: []rune{0x0565, 0x0582}, // Case map + 0x1E00: []rune{0x1E01}, // Case map + 0x1E02: []rune{0x1E03}, // Case map + 0x1E04: []rune{0x1E05}, // Case map + 0x1E06: []rune{0x1E07}, // Case map + 0x1E08: []rune{0x1E09}, // Case map + 0x1E0A: []rune{0x1E0B}, // Case map + 0x1E0C: []rune{0x1E0D}, // Case map + 0x1E0E: []rune{0x1E0F}, // Case map + 0x1E10: []rune{0x1E11}, // Case map + 0x1E12: []rune{0x1E13}, // Case map + 0x1E14: []rune{0x1E15}, // Case map + 0x1E16: []rune{0x1E17}, // Case map + 0x1E18: []rune{0x1E19}, // Case map + 0x1E1A: []rune{0x1E1B}, // Case map + 0x1E1C: []rune{0x1E1D}, // Case map + 0x1E1E: []rune{0x1E1F}, // Case map + 0x1E20: []rune{0x1E21}, // Case map + 0x1E22: []rune{0x1E23}, // Case map + 0x1E24: []rune{0x1E25}, // Case map + 0x1E26: []rune{0x1E27}, // Case map + 0x1E28: []rune{0x1E29}, // Case map + 0x1E2A: []rune{0x1E2B}, // Case map + 0x1E2C: []rune{0x1E2D}, // Case map + 0x1E2E: []rune{0x1E2F}, // Case map + 0x1E30: []rune{0x1E31}, // Case map + 0x1E32: []rune{0x1E33}, // Case map + 0x1E34: []rune{0x1E35}, // Case map + 0x1E36: []rune{0x1E37}, // Case map + 0x1E38: []rune{0x1E39}, // Case map + 0x1E3A: []rune{0x1E3B}, // Case map + 0x1E3C: []rune{0x1E3D}, // Case map + 0x1E3E: []rune{0x1E3F}, // Case map + 0x1E40: []rune{0x1E41}, // Case map + 0x1E42: []rune{0x1E43}, // Case map + 0x1E44: []rune{0x1E45}, // Case map + 0x1E46: []rune{0x1E47}, // Case map + 0x1E48: []rune{0x1E49}, // Case map + 0x1E4A: []rune{0x1E4B}, // Case map + 0x1E4C: []rune{0x1E4D}, // Case map + 0x1E4E: []rune{0x1E4F}, // Case map + 0x1E50: []rune{0x1E51}, // Case map + 0x1E52: []rune{0x1E53}, // Case map + 0x1E54: []rune{0x1E55}, // Case map + 0x1E56: []rune{0x1E57}, // Case map + 0x1E58: []rune{0x1E59}, // Case map + 0x1E5A: []rune{0x1E5B}, // Case map + 0x1E5C: []rune{0x1E5D}, // Case map + 0x1E5E: []rune{0x1E5F}, // Case map + 0x1E60: []rune{0x1E61}, // Case map + 0x1E62: []rune{0x1E63}, // Case map + 0x1E64: []rune{0x1E65}, // Case map + 0x1E66: []rune{0x1E67}, // Case map + 0x1E68: []rune{0x1E69}, // Case map + 0x1E6A: []rune{0x1E6B}, // Case map + 0x1E6C: []rune{0x1E6D}, // Case map + 0x1E6E: []rune{0x1E6F}, // Case map + 0x1E70: []rune{0x1E71}, // Case map + 0x1E72: []rune{0x1E73}, // Case map + 0x1E74: []rune{0x1E75}, // Case map + 0x1E76: []rune{0x1E77}, // Case map + 0x1E78: []rune{0x1E79}, // Case map + 0x1E7A: []rune{0x1E7B}, // Case map + 0x1E7C: []rune{0x1E7D}, // Case map + 0x1E7E: []rune{0x1E7F}, // Case map + 0x1E80: []rune{0x1E81}, // Case map + 0x1E82: []rune{0x1E83}, // Case map + 0x1E84: []rune{0x1E85}, // Case map + 0x1E86: []rune{0x1E87}, // Case map + 0x1E88: []rune{0x1E89}, // Case map + 0x1E8A: []rune{0x1E8B}, // Case map + 0x1E8C: []rune{0x1E8D}, // Case map + 0x1E8E: []rune{0x1E8F}, // Case map + 0x1E90: []rune{0x1E91}, // Case map + 0x1E92: []rune{0x1E93}, // Case map + 0x1E94: []rune{0x1E95}, // Case map + 0x1E96: []rune{0x0068, 0x0331}, // Case map + 0x1E97: []rune{0x0074, 0x0308}, // Case map + 0x1E98: []rune{0x0077, 0x030A}, // Case map + 0x1E99: []rune{0x0079, 0x030A}, // Case map + 0x1E9A: []rune{0x0061, 0x02BE}, // Case map + 0x1E9B: []rune{0x1E61}, // Case map + 0x1EA0: []rune{0x1EA1}, // Case map + 0x1EA2: []rune{0x1EA3}, // Case map + 0x1EA4: []rune{0x1EA5}, // Case map + 0x1EA6: []rune{0x1EA7}, // Case map + 0x1EA8: []rune{0x1EA9}, // Case map + 0x1EAA: []rune{0x1EAB}, // Case map + 0x1EAC: []rune{0x1EAD}, // Case map + 0x1EAE: []rune{0x1EAF}, // Case map + 0x1EB0: []rune{0x1EB1}, // Case map + 0x1EB2: []rune{0x1EB3}, // Case map + 0x1EB4: []rune{0x1EB5}, // Case map + 0x1EB6: []rune{0x1EB7}, // Case map + 0x1EB8: []rune{0x1EB9}, // Case map + 0x1EBA: []rune{0x1EBB}, // Case map + 0x1EBC: []rune{0x1EBD}, // Case map + 0x1EBE: []rune{0x1EBF}, // Case map + 0x1EC0: []rune{0x1EC1}, // Case map + 0x1EC2: []rune{0x1EC3}, // Case map + 0x1EC4: []rune{0x1EC5}, // Case map + 0x1EC6: []rune{0x1EC7}, // Case map + 0x1EC8: []rune{0x1EC9}, // Case map + 0x1ECA: []rune{0x1ECB}, // Case map + 0x1ECC: []rune{0x1ECD}, // Case map + 0x1ECE: []rune{0x1ECF}, // Case map + 0x1ED0: []rune{0x1ED1}, // Case map + 0x1ED2: []rune{0x1ED3}, // Case map + 0x1ED4: []rune{0x1ED5}, // Case map + 0x1ED6: []rune{0x1ED7}, // Case map + 0x1ED8: []rune{0x1ED9}, // Case map + 0x1EDA: []rune{0x1EDB}, // Case map + 0x1EDC: []rune{0x1EDD}, // Case map + 0x1EDE: []rune{0x1EDF}, // Case map + 0x1EE0: []rune{0x1EE1}, // Case map + 0x1EE2: []rune{0x1EE3}, // Case map + 0x1EE4: []rune{0x1EE5}, // Case map + 0x1EE6: []rune{0x1EE7}, // Case map + 0x1EE8: []rune{0x1EE9}, // Case map + 0x1EEA: []rune{0x1EEB}, // Case map + 0x1EEC: []rune{0x1EED}, // Case map + 0x1EEE: []rune{0x1EEF}, // Case map + 0x1EF0: []rune{0x1EF1}, // Case map + 0x1EF2: []rune{0x1EF3}, // Case map + 0x1EF4: []rune{0x1EF5}, // Case map + 0x1EF6: []rune{0x1EF7}, // Case map + 0x1EF8: []rune{0x1EF9}, // Case map + 0x1F08: []rune{0x1F00}, // Case map + 0x1F09: []rune{0x1F01}, // Case map + 0x1F0A: []rune{0x1F02}, // Case map + 0x1F0B: []rune{0x1F03}, // Case map + 0x1F0C: []rune{0x1F04}, // Case map + 0x1F0D: []rune{0x1F05}, // Case map + 0x1F0E: []rune{0x1F06}, // Case map + 0x1F0F: []rune{0x1F07}, // Case map + 0x1F18: []rune{0x1F10}, // Case map + 0x1F19: []rune{0x1F11}, // Case map + 0x1F1A: []rune{0x1F12}, // Case map + 0x1F1B: []rune{0x1F13}, // Case map + 0x1F1C: []rune{0x1F14}, // Case map + 0x1F1D: []rune{0x1F15}, // Case map + 0x1F28: []rune{0x1F20}, // Case map + 0x1F29: []rune{0x1F21}, // Case map + 0x1F2A: []rune{0x1F22}, // Case map + 0x1F2B: []rune{0x1F23}, // Case map + 0x1F2C: []rune{0x1F24}, // Case map + 0x1F2D: []rune{0x1F25}, // Case map + 0x1F2E: []rune{0x1F26}, // Case map + 0x1F2F: []rune{0x1F27}, // Case map + 0x1F38: []rune{0x1F30}, // Case map + 0x1F39: []rune{0x1F31}, // Case map + 0x1F3A: []rune{0x1F32}, // Case map + 0x1F3B: []rune{0x1F33}, // Case map + 0x1F3C: []rune{0x1F34}, // Case map + 0x1F3D: []rune{0x1F35}, // Case map + 0x1F3E: []rune{0x1F36}, // Case map + 0x1F3F: []rune{0x1F37}, // Case map + 0x1F48: []rune{0x1F40}, // Case map + 0x1F49: []rune{0x1F41}, // Case map + 0x1F4A: []rune{0x1F42}, // Case map + 0x1F4B: []rune{0x1F43}, // Case map + 0x1F4C: []rune{0x1F44}, // Case map + 0x1F4D: []rune{0x1F45}, // Case map + 0x1F50: []rune{0x03C5, 0x0313}, // Case map + 0x1F52: []rune{0x03C5, 0x0313, 0x0300}, // Case map + 0x1F54: []rune{0x03C5, 0x0313, 0x0301}, // Case map + 0x1F56: []rune{0x03C5, 0x0313, 0x0342}, // Case map + 0x1F59: []rune{0x1F51}, // Case map + 0x1F5B: []rune{0x1F53}, // Case map + 0x1F5D: []rune{0x1F55}, // Case map + 0x1F5F: []rune{0x1F57}, // Case map + 0x1F68: []rune{0x1F60}, // Case map + 0x1F69: []rune{0x1F61}, // Case map + 0x1F6A: []rune{0x1F62}, // Case map + 0x1F6B: []rune{0x1F63}, // Case map + 0x1F6C: []rune{0x1F64}, // Case map + 0x1F6D: []rune{0x1F65}, // Case map + 0x1F6E: []rune{0x1F66}, // Case map + 0x1F6F: []rune{0x1F67}, // Case map + 0x1F80: []rune{0x1F00, 0x03B9}, // Case map + 0x1F81: []rune{0x1F01, 0x03B9}, // Case map + 0x1F82: []rune{0x1F02, 0x03B9}, // Case map + 0x1F83: []rune{0x1F03, 0x03B9}, // Case map + 0x1F84: []rune{0x1F04, 0x03B9}, // Case map + 0x1F85: []rune{0x1F05, 0x03B9}, // Case map + 0x1F86: []rune{0x1F06, 0x03B9}, // Case map + 0x1F87: []rune{0x1F07, 0x03B9}, // Case map + 0x1F88: []rune{0x1F00, 0x03B9}, // Case map + 0x1F89: []rune{0x1F01, 0x03B9}, // Case map + 0x1F8A: []rune{0x1F02, 0x03B9}, // Case map + 0x1F8B: []rune{0x1F03, 0x03B9}, // Case map + 0x1F8C: []rune{0x1F04, 0x03B9}, // Case map + 0x1F8D: []rune{0x1F05, 0x03B9}, // Case map + 0x1F8E: []rune{0x1F06, 0x03B9}, // Case map + 0x1F8F: []rune{0x1F07, 0x03B9}, // Case map + 0x1F90: []rune{0x1F20, 0x03B9}, // Case map + 0x1F91: []rune{0x1F21, 0x03B9}, // Case map + 0x1F92: []rune{0x1F22, 0x03B9}, // Case map + 0x1F93: []rune{0x1F23, 0x03B9}, // Case map + 0x1F94: []rune{0x1F24, 0x03B9}, // Case map + 0x1F95: []rune{0x1F25, 0x03B9}, // Case map + 0x1F96: []rune{0x1F26, 0x03B9}, // Case map + 0x1F97: []rune{0x1F27, 0x03B9}, // Case map + 0x1F98: []rune{0x1F20, 0x03B9}, // Case map + 0x1F99: []rune{0x1F21, 0x03B9}, // Case map + 0x1F9A: []rune{0x1F22, 0x03B9}, // Case map + 0x1F9B: []rune{0x1F23, 0x03B9}, // Case map + 0x1F9C: []rune{0x1F24, 0x03B9}, // Case map + 0x1F9D: []rune{0x1F25, 0x03B9}, // Case map + 0x1F9E: []rune{0x1F26, 0x03B9}, // Case map + 0x1F9F: []rune{0x1F27, 0x03B9}, // Case map + 0x1FA0: []rune{0x1F60, 0x03B9}, // Case map + 0x1FA1: []rune{0x1F61, 0x03B9}, // Case map + 0x1FA2: []rune{0x1F62, 0x03B9}, // Case map + 0x1FA3: []rune{0x1F63, 0x03B9}, // Case map + 0x1FA4: []rune{0x1F64, 0x03B9}, // Case map + 0x1FA5: []rune{0x1F65, 0x03B9}, // Case map + 0x1FA6: []rune{0x1F66, 0x03B9}, // Case map + 0x1FA7: []rune{0x1F67, 0x03B9}, // Case map + 0x1FA8: []rune{0x1F60, 0x03B9}, // Case map + 0x1FA9: []rune{0x1F61, 0x03B9}, // Case map + 0x1FAA: []rune{0x1F62, 0x03B9}, // Case map + 0x1FAB: []rune{0x1F63, 0x03B9}, // Case map + 0x1FAC: []rune{0x1F64, 0x03B9}, // Case map + 0x1FAD: []rune{0x1F65, 0x03B9}, // Case map + 0x1FAE: []rune{0x1F66, 0x03B9}, // Case map + 0x1FAF: []rune{0x1F67, 0x03B9}, // Case map + 0x1FB2: []rune{0x1F70, 0x03B9}, // Case map + 0x1FB3: []rune{0x03B1, 0x03B9}, // Case map + 0x1FB4: []rune{0x03AC, 0x03B9}, // Case map + 0x1FB6: []rune{0x03B1, 0x0342}, // Case map + 0x1FB7: []rune{0x03B1, 0x0342, 0x03B9}, // Case map + 0x1FB8: []rune{0x1FB0}, // Case map + 0x1FB9: []rune{0x1FB1}, // Case map + 0x1FBA: []rune{0x1F70}, // Case map + 0x1FBB: []rune{0x1F71}, // Case map + 0x1FBC: []rune{0x03B1, 0x03B9}, // Case map + 0x1FBE: []rune{0x03B9}, // Case map + 0x1FC2: []rune{0x1F74, 0x03B9}, // Case map + 0x1FC3: []rune{0x03B7, 0x03B9}, // Case map + 0x1FC4: []rune{0x03AE, 0x03B9}, // Case map + 0x1FC6: []rune{0x03B7, 0x0342}, // Case map + 0x1FC7: []rune{0x03B7, 0x0342, 0x03B9}, // Case map + 0x1FC8: []rune{0x1F72}, // Case map + 0x1FC9: []rune{0x1F73}, // Case map + 0x1FCA: []rune{0x1F74}, // Case map + 0x1FCB: []rune{0x1F75}, // Case map + 0x1FCC: []rune{0x03B7, 0x03B9}, // Case map + 0x1FD2: []rune{0x03B9, 0x0308, 0x0300}, // Case map + 0x1FD3: []rune{0x03B9, 0x0308, 0x0301}, // Case map + 0x1FD6: []rune{0x03B9, 0x0342}, // Case map + 0x1FD7: []rune{0x03B9, 0x0308, 0x0342}, // Case map + 0x1FD8: []rune{0x1FD0}, // Case map + 0x1FD9: []rune{0x1FD1}, // Case map + 0x1FDA: []rune{0x1F76}, // Case map + 0x1FDB: []rune{0x1F77}, // Case map + 0x1FE2: []rune{0x03C5, 0x0308, 0x0300}, // Case map + 0x1FE3: []rune{0x03C5, 0x0308, 0x0301}, // Case map + 0x1FE4: []rune{0x03C1, 0x0313}, // Case map + 0x1FE6: []rune{0x03C5, 0x0342}, // Case map + 0x1FE7: []rune{0x03C5, 0x0308, 0x0342}, // Case map + 0x1FE8: []rune{0x1FE0}, // Case map + 0x1FE9: []rune{0x1FE1}, // Case map + 0x1FEA: []rune{0x1F7A}, // Case map + 0x1FEB: []rune{0x1F7B}, // Case map + 0x1FEC: []rune{0x1FE5}, // Case map + 0x1FF2: []rune{0x1F7C, 0x03B9}, // Case map + 0x1FF3: []rune{0x03C9, 0x03B9}, // Case map + 0x1FF4: []rune{0x03CE, 0x03B9}, // Case map + 0x1FF6: []rune{0x03C9, 0x0342}, // Case map + 0x1FF7: []rune{0x03C9, 0x0342, 0x03B9}, // Case map + 0x1FF8: []rune{0x1F78}, // Case map + 0x1FF9: []rune{0x1F79}, // Case map + 0x1FFA: []rune{0x1F7C}, // Case map + 0x1FFB: []rune{0x1F7D}, // Case map + 0x1FFC: []rune{0x03C9, 0x03B9}, // Case map + 0x2126: []rune{0x03C9}, // Case map + 0x212A: []rune{0x006B}, // Case map + 0x212B: []rune{0x00E5}, // Case map + 0x2160: []rune{0x2170}, // Case map + 0x2161: []rune{0x2171}, // Case map + 0x2162: []rune{0x2172}, // Case map + 0x2163: []rune{0x2173}, // Case map + 0x2164: []rune{0x2174}, // Case map + 0x2165: []rune{0x2175}, // Case map + 0x2166: []rune{0x2176}, // Case map + 0x2167: []rune{0x2177}, // Case map + 0x2168: []rune{0x2178}, // Case map + 0x2169: []rune{0x2179}, // Case map + 0x216A: []rune{0x217A}, // Case map + 0x216B: []rune{0x217B}, // Case map + 0x216C: []rune{0x217C}, // Case map + 0x216D: []rune{0x217D}, // Case map + 0x216E: []rune{0x217E}, // Case map + 0x216F: []rune{0x217F}, // Case map + 0x24B6: []rune{0x24D0}, // Case map + 0x24B7: []rune{0x24D1}, // Case map + 0x24B8: []rune{0x24D2}, // Case map + 0x24B9: []rune{0x24D3}, // Case map + 0x24BA: []rune{0x24D4}, // Case map + 0x24BB: []rune{0x24D5}, // Case map + 0x24BC: []rune{0x24D6}, // Case map + 0x24BD: []rune{0x24D7}, // Case map + 0x24BE: []rune{0x24D8}, // Case map + 0x24BF: []rune{0x24D9}, // Case map + 0x24C0: []rune{0x24DA}, // Case map + 0x24C1: []rune{0x24DB}, // Case map + 0x24C2: []rune{0x24DC}, // Case map + 0x24C3: []rune{0x24DD}, // Case map + 0x24C4: []rune{0x24DE}, // Case map + 0x24C5: []rune{0x24DF}, // Case map + 0x24C6: []rune{0x24E0}, // Case map + 0x24C7: []rune{0x24E1}, // Case map + 0x24C8: []rune{0x24E2}, // Case map + 0x24C9: []rune{0x24E3}, // Case map + 0x24CA: []rune{0x24E4}, // Case map + 0x24CB: []rune{0x24E5}, // Case map + 0x24CC: []rune{0x24E6}, // Case map + 0x24CD: []rune{0x24E7}, // Case map + 0x24CE: []rune{0x24E8}, // Case map + 0x24CF: []rune{0x24E9}, // Case map + 0xFB00: []rune{0x0066, 0x0066}, // Case map + 0xFB01: []rune{0x0066, 0x0069}, // Case map + 0xFB02: []rune{0x0066, 0x006C}, // Case map + 0xFB03: []rune{0x0066, 0x0066, 0x0069}, // Case map + 0xFB04: []rune{0x0066, 0x0066, 0x006C}, // Case map + 0xFB05: []rune{0x0073, 0x0074}, // Case map + 0xFB06: []rune{0x0073, 0x0074}, // Case map + 0xFB13: []rune{0x0574, 0x0576}, // Case map + 0xFB14: []rune{0x0574, 0x0565}, // Case map + 0xFB15: []rune{0x0574, 0x056B}, // Case map + 0xFB16: []rune{0x057E, 0x0576}, // Case map + 0xFB17: []rune{0x0574, 0x056D}, // Case map + 0xFF21: []rune{0xFF41}, // Case map + 0xFF22: []rune{0xFF42}, // Case map + 0xFF23: []rune{0xFF43}, // Case map + 0xFF24: []rune{0xFF44}, // Case map + 0xFF25: []rune{0xFF45}, // Case map + 0xFF26: []rune{0xFF46}, // Case map + 0xFF27: []rune{0xFF47}, // Case map + 0xFF28: []rune{0xFF48}, // Case map + 0xFF29: []rune{0xFF49}, // Case map + 0xFF2A: []rune{0xFF4A}, // Case map + 0xFF2B: []rune{0xFF4B}, // Case map + 0xFF2C: []rune{0xFF4C}, // Case map + 0xFF2D: []rune{0xFF4D}, // Case map + 0xFF2E: []rune{0xFF4E}, // Case map + 0xFF2F: []rune{0xFF4F}, // Case map + 0xFF30: []rune{0xFF50}, // Case map + 0xFF31: []rune{0xFF51}, // Case map + 0xFF32: []rune{0xFF52}, // Case map + 0xFF33: []rune{0xFF53}, // Case map + 0xFF34: []rune{0xFF54}, // Case map + 0xFF35: []rune{0xFF55}, // Case map + 0xFF36: []rune{0xFF56}, // Case map + 0xFF37: []rune{0xFF57}, // Case map + 0xFF38: []rune{0xFF58}, // Case map + 0xFF39: []rune{0xFF59}, // Case map + 0xFF3A: []rune{0xFF5A}, // Case map + 0x10400: []rune{0x10428}, // Case map + 0x10401: []rune{0x10429}, // Case map + 0x10402: []rune{0x1042A}, // Case map + 0x10403: []rune{0x1042B}, // Case map + 0x10404: []rune{0x1042C}, // Case map + 0x10405: []rune{0x1042D}, // Case map + 0x10406: []rune{0x1042E}, // Case map + 0x10407: []rune{0x1042F}, // Case map + 0x10408: []rune{0x10430}, // Case map + 0x10409: []rune{0x10431}, // Case map + 0x1040A: []rune{0x10432}, // Case map + 0x1040B: []rune{0x10433}, // Case map + 0x1040C: []rune{0x10434}, // Case map + 0x1040D: []rune{0x10435}, // Case map + 0x1040E: []rune{0x10436}, // Case map + 0x1040F: []rune{0x10437}, // Case map + 0x10410: []rune{0x10438}, // Case map + 0x10411: []rune{0x10439}, // Case map + 0x10412: []rune{0x1043A}, // Case map + 0x10413: []rune{0x1043B}, // Case map + 0x10414: []rune{0x1043C}, // Case map + 0x10415: []rune{0x1043D}, // Case map + 0x10416: []rune{0x1043E}, // Case map + 0x10417: []rune{0x1043F}, // Case map + 0x10418: []rune{0x10440}, // Case map + 0x10419: []rune{0x10441}, // Case map + 0x1041A: []rune{0x10442}, // Case map + 0x1041B: []rune{0x10443}, // Case map + 0x1041C: []rune{0x10444}, // Case map + 0x1041D: []rune{0x10445}, // Case map + 0x1041E: []rune{0x10446}, // Case map + 0x1041F: []rune{0x10447}, // Case map + 0x10420: []rune{0x10448}, // Case map + 0x10421: []rune{0x10449}, // Case map + 0x10422: []rune{0x1044A}, // Case map + 0x10423: []rune{0x1044B}, // Case map + 0x10424: []rune{0x1044C}, // Case map + 0x10425: []rune{0x1044D}, // Case map +} + +// TableB3 represents RFC-3454 Table B.3. +var TableB3 Mapping = tableB3 + +var tableC1_1 = Set{ + RuneRange{0x0020, 0x0020}, // SPACE +} + +// TableC1_1 represents RFC-3454 Table C.1.1. +var TableC1_1 Set = tableC1_1 + +var tableC1_2 = Set{ + RuneRange{0x00A0, 0x00A0}, // NO-BREAK SPACE + RuneRange{0x1680, 0x1680}, // OGHAM SPACE MARK + RuneRange{0x2000, 0x2000}, // EN QUAD + RuneRange{0x2001, 0x2001}, // EM QUAD + RuneRange{0x2002, 0x2002}, // EN SPACE + RuneRange{0x2003, 0x2003}, // EM SPACE + RuneRange{0x2004, 0x2004}, // THREE-PER-EM SPACE + RuneRange{0x2005, 0x2005}, // FOUR-PER-EM SPACE + RuneRange{0x2006, 0x2006}, // SIX-PER-EM SPACE + RuneRange{0x2007, 0x2007}, // FIGURE SPACE + RuneRange{0x2008, 0x2008}, // PUNCTUATION SPACE + RuneRange{0x2009, 0x2009}, // THIN SPACE + RuneRange{0x200A, 0x200A}, // HAIR SPACE + RuneRange{0x200B, 0x200B}, // ZERO WIDTH SPACE + RuneRange{0x202F, 0x202F}, // NARROW NO-BREAK SPACE + RuneRange{0x205F, 0x205F}, // MEDIUM MATHEMATICAL SPACE + RuneRange{0x3000, 0x3000}, // IDEOGRAPHIC SPACE +} + +// TableC1_2 represents RFC-3454 Table C.1.2. +var TableC1_2 Set = tableC1_2 + +var tableC2_1 = Set{ + RuneRange{0x0000, 0x001F}, // [CONTROL CHARACTERS] + RuneRange{0x007F, 0x007F}, // DELETE +} + +// TableC2_1 represents RFC-3454 Table C.2.1. +var TableC2_1 Set = tableC2_1 + +var tableC2_2 = Set{ + RuneRange{0x0080, 0x009F}, // [CONTROL CHARACTERS] + RuneRange{0x06DD, 0x06DD}, // ARABIC END OF AYAH + RuneRange{0x070F, 0x070F}, // SYRIAC ABBREVIATION MARK + RuneRange{0x180E, 0x180E}, // MONGOLIAN VOWEL SEPARATOR + RuneRange{0x200C, 0x200C}, // ZERO WIDTH NON-JOINER + RuneRange{0x200D, 0x200D}, // ZERO WIDTH JOINER + RuneRange{0x2028, 0x2028}, // LINE SEPARATOR + RuneRange{0x2029, 0x2029}, // PARAGRAPH SEPARATOR + RuneRange{0x2060, 0x2060}, // WORD JOINER + RuneRange{0x2061, 0x2061}, // FUNCTION APPLICATION + RuneRange{0x2062, 0x2062}, // INVISIBLE TIMES + RuneRange{0x2063, 0x2063}, // INVISIBLE SEPARATOR + RuneRange{0x206A, 0x206F}, // [CONTROL CHARACTERS] + RuneRange{0xFEFF, 0xFEFF}, // ZERO WIDTH NO-BREAK SPACE + RuneRange{0xFFF9, 0xFFFC}, // [CONTROL CHARACTERS] + RuneRange{0x1D173, 0x1D17A}, // [MUSICAL CONTROL CHARACTERS] +} + +// TableC2_2 represents RFC-3454 Table C.2.2. +var TableC2_2 Set = tableC2_2 + +var tableC3 = Set{ + RuneRange{0xE000, 0xF8FF}, // [PRIVATE USE, PLANE 0] + RuneRange{0xF0000, 0xFFFFD}, // [PRIVATE USE, PLANE 15] + RuneRange{0x100000, 0x10FFFD}, // [PRIVATE USE, PLANE 16] +} + +// TableC3 represents RFC-3454 Table C.3. +var TableC3 Set = tableC3 + +var tableC4 = Set{ + RuneRange{0xFDD0, 0xFDEF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xFFFE, 0xFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x1FFFE, 0x1FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x2FFFE, 0x2FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x3FFFE, 0x3FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x4FFFE, 0x4FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x5FFFE, 0x5FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x6FFFE, 0x6FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x7FFFE, 0x7FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x8FFFE, 0x8FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x9FFFE, 0x9FFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xAFFFE, 0xAFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xBFFFE, 0xBFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xCFFFE, 0xCFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xDFFFE, 0xDFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xEFFFE, 0xEFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0xFFFFE, 0xFFFFF}, // [NONCHARACTER CODE POINTS] + RuneRange{0x10FFFE, 0x10FFFF}, // [NONCHARACTER CODE POINTS] +} + +// TableC4 represents RFC-3454 Table C.4. +var TableC4 Set = tableC4 + +var tableC5 = Set{ + RuneRange{0xD800, 0xDFFF}, // [SURROGATE CODES] +} + +// TableC5 represents RFC-3454 Table C.5. +var TableC5 Set = tableC5 + +var tableC6 = Set{ + RuneRange{0xFFF9, 0xFFF9}, // INTERLINEAR ANNOTATION ANCHOR + RuneRange{0xFFFA, 0xFFFA}, // INTERLINEAR ANNOTATION SEPARATOR + RuneRange{0xFFFB, 0xFFFB}, // INTERLINEAR ANNOTATION TERMINATOR + RuneRange{0xFFFC, 0xFFFC}, // OBJECT REPLACEMENT CHARACTER + RuneRange{0xFFFD, 0xFFFD}, // REPLACEMENT CHARACTER +} + +// TableC6 represents RFC-3454 Table C.6. +var TableC6 Set = tableC6 + +var tableC7 = Set{ + RuneRange{0x2FF0, 0x2FFB}, // [IDEOGRAPHIC DESCRIPTION CHARACTERS] +} + +// TableC7 represents RFC-3454 Table C.7. +var TableC7 Set = tableC7 + +var tableC8 = Set{ + RuneRange{0x0340, 0x0340}, // COMBINING GRAVE TONE MARK + RuneRange{0x0341, 0x0341}, // COMBINING ACUTE TONE MARK + RuneRange{0x200E, 0x200E}, // LEFT-TO-RIGHT MARK + RuneRange{0x200F, 0x200F}, // RIGHT-TO-LEFT MARK + RuneRange{0x202A, 0x202A}, // LEFT-TO-RIGHT EMBEDDING + RuneRange{0x202B, 0x202B}, // RIGHT-TO-LEFT EMBEDDING + RuneRange{0x202C, 0x202C}, // POP DIRECTIONAL FORMATTING + RuneRange{0x202D, 0x202D}, // LEFT-TO-RIGHT OVERRIDE + RuneRange{0x202E, 0x202E}, // RIGHT-TO-LEFT OVERRIDE + RuneRange{0x206A, 0x206A}, // INHIBIT SYMMETRIC SWAPPING + RuneRange{0x206B, 0x206B}, // ACTIVATE SYMMETRIC SWAPPING + RuneRange{0x206C, 0x206C}, // INHIBIT ARABIC FORM SHAPING + RuneRange{0x206D, 0x206D}, // ACTIVATE ARABIC FORM SHAPING + RuneRange{0x206E, 0x206E}, // NATIONAL DIGIT SHAPES + RuneRange{0x206F, 0x206F}, // NOMINAL DIGIT SHAPES +} + +// TableC8 represents RFC-3454 Table C.8. +var TableC8 Set = tableC8 + +var tableC9 = Set{ + RuneRange{0xE0001, 0xE0001}, // LANGUAGE TAG + RuneRange{0xE0020, 0xE007F}, // [TAGGING CHARACTERS] +} + +// TableC9 represents RFC-3454 Table C.9. +var TableC9 Set = tableC9 + +var tableD1 = Set{ + RuneRange{0x05BE, 0x05BE}, + RuneRange{0x05C0, 0x05C0}, + RuneRange{0x05C3, 0x05C3}, + RuneRange{0x05D0, 0x05EA}, + RuneRange{0x05F0, 0x05F4}, + RuneRange{0x061B, 0x061B}, + RuneRange{0x061F, 0x061F}, + RuneRange{0x0621, 0x063A}, + RuneRange{0x0640, 0x064A}, + RuneRange{0x066D, 0x066F}, + RuneRange{0x0671, 0x06D5}, + RuneRange{0x06DD, 0x06DD}, + RuneRange{0x06E5, 0x06E6}, + RuneRange{0x06FA, 0x06FE}, + RuneRange{0x0700, 0x070D}, + RuneRange{0x0710, 0x0710}, + RuneRange{0x0712, 0x072C}, + RuneRange{0x0780, 0x07A5}, + RuneRange{0x07B1, 0x07B1}, + RuneRange{0x200F, 0x200F}, + RuneRange{0xFB1D, 0xFB1D}, + RuneRange{0xFB1F, 0xFB28}, + RuneRange{0xFB2A, 0xFB36}, + RuneRange{0xFB38, 0xFB3C}, + RuneRange{0xFB3E, 0xFB3E}, + RuneRange{0xFB40, 0xFB41}, + RuneRange{0xFB43, 0xFB44}, + RuneRange{0xFB46, 0xFBB1}, + RuneRange{0xFBD3, 0xFD3D}, + RuneRange{0xFD50, 0xFD8F}, + RuneRange{0xFD92, 0xFDC7}, + RuneRange{0xFDF0, 0xFDFC}, + RuneRange{0xFE70, 0xFE74}, + RuneRange{0xFE76, 0xFEFC}, +} + +// TableD1 represents RFC-3454 Table D.1. +var TableD1 Set = tableD1 + +var tableD2 = Set{ + RuneRange{0x0041, 0x005A}, + RuneRange{0x0061, 0x007A}, + RuneRange{0x00AA, 0x00AA}, + RuneRange{0x00B5, 0x00B5}, + RuneRange{0x00BA, 0x00BA}, + RuneRange{0x00C0, 0x00D6}, + RuneRange{0x00D8, 0x00F6}, + RuneRange{0x00F8, 0x0220}, + RuneRange{0x0222, 0x0233}, + RuneRange{0x0250, 0x02AD}, + RuneRange{0x02B0, 0x02B8}, + RuneRange{0x02BB, 0x02C1}, + RuneRange{0x02D0, 0x02D1}, + RuneRange{0x02E0, 0x02E4}, + RuneRange{0x02EE, 0x02EE}, + RuneRange{0x037A, 0x037A}, + RuneRange{0x0386, 0x0386}, + RuneRange{0x0388, 0x038A}, + RuneRange{0x038C, 0x038C}, + RuneRange{0x038E, 0x03A1}, + RuneRange{0x03A3, 0x03CE}, + RuneRange{0x03D0, 0x03F5}, + RuneRange{0x0400, 0x0482}, + RuneRange{0x048A, 0x04CE}, + RuneRange{0x04D0, 0x04F5}, + RuneRange{0x04F8, 0x04F9}, + RuneRange{0x0500, 0x050F}, + RuneRange{0x0531, 0x0556}, + RuneRange{0x0559, 0x055F}, + RuneRange{0x0561, 0x0587}, + RuneRange{0x0589, 0x0589}, + RuneRange{0x0903, 0x0903}, + RuneRange{0x0905, 0x0939}, + RuneRange{0x093D, 0x0940}, + RuneRange{0x0949, 0x094C}, + RuneRange{0x0950, 0x0950}, + RuneRange{0x0958, 0x0961}, + RuneRange{0x0964, 0x0970}, + RuneRange{0x0982, 0x0983}, + RuneRange{0x0985, 0x098C}, + RuneRange{0x098F, 0x0990}, + RuneRange{0x0993, 0x09A8}, + RuneRange{0x09AA, 0x09B0}, + RuneRange{0x09B2, 0x09B2}, + RuneRange{0x09B6, 0x09B9}, + RuneRange{0x09BE, 0x09C0}, + RuneRange{0x09C7, 0x09C8}, + RuneRange{0x09CB, 0x09CC}, + RuneRange{0x09D7, 0x09D7}, + RuneRange{0x09DC, 0x09DD}, + RuneRange{0x09DF, 0x09E1}, + RuneRange{0x09E6, 0x09F1}, + RuneRange{0x09F4, 0x09FA}, + RuneRange{0x0A05, 0x0A0A}, + RuneRange{0x0A0F, 0x0A10}, + RuneRange{0x0A13, 0x0A28}, + RuneRange{0x0A2A, 0x0A30}, + RuneRange{0x0A32, 0x0A33}, + RuneRange{0x0A35, 0x0A36}, + RuneRange{0x0A38, 0x0A39}, + RuneRange{0x0A3E, 0x0A40}, + RuneRange{0x0A59, 0x0A5C}, + RuneRange{0x0A5E, 0x0A5E}, + RuneRange{0x0A66, 0x0A6F}, + RuneRange{0x0A72, 0x0A74}, + RuneRange{0x0A83, 0x0A83}, + RuneRange{0x0A85, 0x0A8B}, + RuneRange{0x0A8D, 0x0A8D}, + RuneRange{0x0A8F, 0x0A91}, + RuneRange{0x0A93, 0x0AA8}, + RuneRange{0x0AAA, 0x0AB0}, + RuneRange{0x0AB2, 0x0AB3}, + RuneRange{0x0AB5, 0x0AB9}, + RuneRange{0x0ABD, 0x0AC0}, + RuneRange{0x0AC9, 0x0AC9}, + RuneRange{0x0ACB, 0x0ACC}, + RuneRange{0x0AD0, 0x0AD0}, + RuneRange{0x0AE0, 0x0AE0}, + RuneRange{0x0AE6, 0x0AEF}, + RuneRange{0x0B02, 0x0B03}, + RuneRange{0x0B05, 0x0B0C}, + RuneRange{0x0B0F, 0x0B10}, + RuneRange{0x0B13, 0x0B28}, + RuneRange{0x0B2A, 0x0B30}, + RuneRange{0x0B32, 0x0B33}, + RuneRange{0x0B36, 0x0B39}, + RuneRange{0x0B3D, 0x0B3E}, + RuneRange{0x0B40, 0x0B40}, + RuneRange{0x0B47, 0x0B48}, + RuneRange{0x0B4B, 0x0B4C}, + RuneRange{0x0B57, 0x0B57}, + RuneRange{0x0B5C, 0x0B5D}, + RuneRange{0x0B5F, 0x0B61}, + RuneRange{0x0B66, 0x0B70}, + RuneRange{0x0B83, 0x0B83}, + RuneRange{0x0B85, 0x0B8A}, + RuneRange{0x0B8E, 0x0B90}, + RuneRange{0x0B92, 0x0B95}, + RuneRange{0x0B99, 0x0B9A}, + RuneRange{0x0B9C, 0x0B9C}, + RuneRange{0x0B9E, 0x0B9F}, + RuneRange{0x0BA3, 0x0BA4}, + RuneRange{0x0BA8, 0x0BAA}, + RuneRange{0x0BAE, 0x0BB5}, + RuneRange{0x0BB7, 0x0BB9}, + RuneRange{0x0BBE, 0x0BBF}, + RuneRange{0x0BC1, 0x0BC2}, + RuneRange{0x0BC6, 0x0BC8}, + RuneRange{0x0BCA, 0x0BCC}, + RuneRange{0x0BD7, 0x0BD7}, + RuneRange{0x0BE7, 0x0BF2}, + RuneRange{0x0C01, 0x0C03}, + RuneRange{0x0C05, 0x0C0C}, + RuneRange{0x0C0E, 0x0C10}, + RuneRange{0x0C12, 0x0C28}, + RuneRange{0x0C2A, 0x0C33}, + RuneRange{0x0C35, 0x0C39}, + RuneRange{0x0C41, 0x0C44}, + RuneRange{0x0C60, 0x0C61}, + RuneRange{0x0C66, 0x0C6F}, + RuneRange{0x0C82, 0x0C83}, + RuneRange{0x0C85, 0x0C8C}, + RuneRange{0x0C8E, 0x0C90}, + RuneRange{0x0C92, 0x0CA8}, + RuneRange{0x0CAA, 0x0CB3}, + RuneRange{0x0CB5, 0x0CB9}, + RuneRange{0x0CBE, 0x0CBE}, + RuneRange{0x0CC0, 0x0CC4}, + RuneRange{0x0CC7, 0x0CC8}, + RuneRange{0x0CCA, 0x0CCB}, + RuneRange{0x0CD5, 0x0CD6}, + RuneRange{0x0CDE, 0x0CDE}, + RuneRange{0x0CE0, 0x0CE1}, + RuneRange{0x0CE6, 0x0CEF}, + RuneRange{0x0D02, 0x0D03}, + RuneRange{0x0D05, 0x0D0C}, + RuneRange{0x0D0E, 0x0D10}, + RuneRange{0x0D12, 0x0D28}, + RuneRange{0x0D2A, 0x0D39}, + RuneRange{0x0D3E, 0x0D40}, + RuneRange{0x0D46, 0x0D48}, + RuneRange{0x0D4A, 0x0D4C}, + RuneRange{0x0D57, 0x0D57}, + RuneRange{0x0D60, 0x0D61}, + RuneRange{0x0D66, 0x0D6F}, + RuneRange{0x0D82, 0x0D83}, + RuneRange{0x0D85, 0x0D96}, + RuneRange{0x0D9A, 0x0DB1}, + RuneRange{0x0DB3, 0x0DBB}, + RuneRange{0x0DBD, 0x0DBD}, + RuneRange{0x0DC0, 0x0DC6}, + RuneRange{0x0DCF, 0x0DD1}, + RuneRange{0x0DD8, 0x0DDF}, + RuneRange{0x0DF2, 0x0DF4}, + RuneRange{0x0E01, 0x0E30}, + RuneRange{0x0E32, 0x0E33}, + RuneRange{0x0E40, 0x0E46}, + RuneRange{0x0E4F, 0x0E5B}, + RuneRange{0x0E81, 0x0E82}, + RuneRange{0x0E84, 0x0E84}, + RuneRange{0x0E87, 0x0E88}, + RuneRange{0x0E8A, 0x0E8A}, + RuneRange{0x0E8D, 0x0E8D}, + RuneRange{0x0E94, 0x0E97}, + RuneRange{0x0E99, 0x0E9F}, + RuneRange{0x0EA1, 0x0EA3}, + RuneRange{0x0EA5, 0x0EA5}, + RuneRange{0x0EA7, 0x0EA7}, + RuneRange{0x0EAA, 0x0EAB}, + RuneRange{0x0EAD, 0x0EB0}, + RuneRange{0x0EB2, 0x0EB3}, + RuneRange{0x0EBD, 0x0EBD}, + RuneRange{0x0EC0, 0x0EC4}, + RuneRange{0x0EC6, 0x0EC6}, + RuneRange{0x0ED0, 0x0ED9}, + RuneRange{0x0EDC, 0x0EDD}, + RuneRange{0x0F00, 0x0F17}, + RuneRange{0x0F1A, 0x0F34}, + RuneRange{0x0F36, 0x0F36}, + RuneRange{0x0F38, 0x0F38}, + RuneRange{0x0F3E, 0x0F47}, + RuneRange{0x0F49, 0x0F6A}, + RuneRange{0x0F7F, 0x0F7F}, + RuneRange{0x0F85, 0x0F85}, + RuneRange{0x0F88, 0x0F8B}, + RuneRange{0x0FBE, 0x0FC5}, + RuneRange{0x0FC7, 0x0FCC}, + RuneRange{0x0FCF, 0x0FCF}, + RuneRange{0x1000, 0x1021}, + RuneRange{0x1023, 0x1027}, + RuneRange{0x1029, 0x102A}, + RuneRange{0x102C, 0x102C}, + RuneRange{0x1031, 0x1031}, + RuneRange{0x1038, 0x1038}, + RuneRange{0x1040, 0x1057}, + RuneRange{0x10A0, 0x10C5}, + RuneRange{0x10D0, 0x10F8}, + RuneRange{0x10FB, 0x10FB}, + RuneRange{0x1100, 0x1159}, + RuneRange{0x115F, 0x11A2}, + RuneRange{0x11A8, 0x11F9}, + RuneRange{0x1200, 0x1206}, + RuneRange{0x1208, 0x1246}, + RuneRange{0x1248, 0x1248}, + RuneRange{0x124A, 0x124D}, + RuneRange{0x1250, 0x1256}, + RuneRange{0x1258, 0x1258}, + RuneRange{0x125A, 0x125D}, + RuneRange{0x1260, 0x1286}, + RuneRange{0x1288, 0x1288}, + RuneRange{0x128A, 0x128D}, + RuneRange{0x1290, 0x12AE}, + RuneRange{0x12B0, 0x12B0}, + RuneRange{0x12B2, 0x12B5}, + RuneRange{0x12B8, 0x12BE}, + RuneRange{0x12C0, 0x12C0}, + RuneRange{0x12C2, 0x12C5}, + RuneRange{0x12C8, 0x12CE}, + RuneRange{0x12D0, 0x12D6}, + RuneRange{0x12D8, 0x12EE}, + RuneRange{0x12F0, 0x130E}, + RuneRange{0x1310, 0x1310}, + RuneRange{0x1312, 0x1315}, + RuneRange{0x1318, 0x131E}, + RuneRange{0x1320, 0x1346}, + RuneRange{0x1348, 0x135A}, + RuneRange{0x1361, 0x137C}, + RuneRange{0x13A0, 0x13F4}, + RuneRange{0x1401, 0x1676}, + RuneRange{0x1681, 0x169A}, + RuneRange{0x16A0, 0x16F0}, + RuneRange{0x1700, 0x170C}, + RuneRange{0x170E, 0x1711}, + RuneRange{0x1720, 0x1731}, + RuneRange{0x1735, 0x1736}, + RuneRange{0x1740, 0x1751}, + RuneRange{0x1760, 0x176C}, + RuneRange{0x176E, 0x1770}, + RuneRange{0x1780, 0x17B6}, + RuneRange{0x17BE, 0x17C5}, + RuneRange{0x17C7, 0x17C8}, + RuneRange{0x17D4, 0x17DA}, + RuneRange{0x17DC, 0x17DC}, + RuneRange{0x17E0, 0x17E9}, + RuneRange{0x1810, 0x1819}, + RuneRange{0x1820, 0x1877}, + RuneRange{0x1880, 0x18A8}, + RuneRange{0x1E00, 0x1E9B}, + RuneRange{0x1EA0, 0x1EF9}, + RuneRange{0x1F00, 0x1F15}, + RuneRange{0x1F18, 0x1F1D}, + RuneRange{0x1F20, 0x1F45}, + RuneRange{0x1F48, 0x1F4D}, + RuneRange{0x1F50, 0x1F57}, + RuneRange{0x1F59, 0x1F59}, + RuneRange{0x1F5B, 0x1F5B}, + RuneRange{0x1F5D, 0x1F5D}, + RuneRange{0x1F5F, 0x1F7D}, + RuneRange{0x1F80, 0x1FB4}, + RuneRange{0x1FB6, 0x1FBC}, + RuneRange{0x1FBE, 0x1FBE}, + RuneRange{0x1FC2, 0x1FC4}, + RuneRange{0x1FC6, 0x1FCC}, + RuneRange{0x1FD0, 0x1FD3}, + RuneRange{0x1FD6, 0x1FDB}, + RuneRange{0x1FE0, 0x1FEC}, + RuneRange{0x1FF2, 0x1FF4}, + RuneRange{0x1FF6, 0x1FFC}, + RuneRange{0x200E, 0x200E}, + RuneRange{0x2071, 0x2071}, + RuneRange{0x207F, 0x207F}, + RuneRange{0x2102, 0x2102}, + RuneRange{0x2107, 0x2107}, + RuneRange{0x210A, 0x2113}, + RuneRange{0x2115, 0x2115}, + RuneRange{0x2119, 0x211D}, + RuneRange{0x2124, 0x2124}, + RuneRange{0x2126, 0x2126}, + RuneRange{0x2128, 0x2128}, + RuneRange{0x212A, 0x212D}, + RuneRange{0x212F, 0x2131}, + RuneRange{0x2133, 0x2139}, + RuneRange{0x213D, 0x213F}, + RuneRange{0x2145, 0x2149}, + RuneRange{0x2160, 0x2183}, + RuneRange{0x2336, 0x237A}, + RuneRange{0x2395, 0x2395}, + RuneRange{0x249C, 0x24E9}, + RuneRange{0x3005, 0x3007}, + RuneRange{0x3021, 0x3029}, + RuneRange{0x3031, 0x3035}, + RuneRange{0x3038, 0x303C}, + RuneRange{0x3041, 0x3096}, + RuneRange{0x309D, 0x309F}, + RuneRange{0x30A1, 0x30FA}, + RuneRange{0x30FC, 0x30FF}, + RuneRange{0x3105, 0x312C}, + RuneRange{0x3131, 0x318E}, + RuneRange{0x3190, 0x31B7}, + RuneRange{0x31F0, 0x321C}, + RuneRange{0x3220, 0x3243}, + RuneRange{0x3260, 0x327B}, + RuneRange{0x327F, 0x32B0}, + RuneRange{0x32C0, 0x32CB}, + RuneRange{0x32D0, 0x32FE}, + RuneRange{0x3300, 0x3376}, + RuneRange{0x337B, 0x33DD}, + RuneRange{0x33E0, 0x33FE}, + RuneRange{0x3400, 0x4DB5}, + RuneRange{0x4E00, 0x9FA5}, + RuneRange{0xA000, 0xA48C}, + RuneRange{0xAC00, 0xD7A3}, + RuneRange{0xD800, 0xFA2D}, + RuneRange{0xFA30, 0xFA6A}, + RuneRange{0xFB00, 0xFB06}, + RuneRange{0xFB13, 0xFB17}, + RuneRange{0xFF21, 0xFF3A}, + RuneRange{0xFF41, 0xFF5A}, + RuneRange{0xFF66, 0xFFBE}, + RuneRange{0xFFC2, 0xFFC7}, + RuneRange{0xFFCA, 0xFFCF}, + RuneRange{0xFFD2, 0xFFD7}, + RuneRange{0xFFDA, 0xFFDC}, + RuneRange{0x10300, 0x1031E}, + RuneRange{0x10320, 0x10323}, + RuneRange{0x10330, 0x1034A}, + RuneRange{0x10400, 0x10425}, + RuneRange{0x10428, 0x1044D}, + RuneRange{0x1D000, 0x1D0F5}, + RuneRange{0x1D100, 0x1D126}, + RuneRange{0x1D12A, 0x1D166}, + RuneRange{0x1D16A, 0x1D172}, + RuneRange{0x1D183, 0x1D184}, + RuneRange{0x1D18C, 0x1D1A9}, + RuneRange{0x1D1AE, 0x1D1DD}, + RuneRange{0x1D400, 0x1D454}, + RuneRange{0x1D456, 0x1D49C}, + RuneRange{0x1D49E, 0x1D49F}, + RuneRange{0x1D4A2, 0x1D4A2}, + RuneRange{0x1D4A5, 0x1D4A6}, + RuneRange{0x1D4A9, 0x1D4AC}, + RuneRange{0x1D4AE, 0x1D4B9}, + RuneRange{0x1D4BB, 0x1D4BB}, + RuneRange{0x1D4BD, 0x1D4C0}, + RuneRange{0x1D4C2, 0x1D4C3}, + RuneRange{0x1D4C5, 0x1D505}, + RuneRange{0x1D507, 0x1D50A}, + RuneRange{0x1D50D, 0x1D514}, + RuneRange{0x1D516, 0x1D51C}, + RuneRange{0x1D51E, 0x1D539}, + RuneRange{0x1D53B, 0x1D53E}, + RuneRange{0x1D540, 0x1D544}, + RuneRange{0x1D546, 0x1D546}, + RuneRange{0x1D54A, 0x1D550}, + RuneRange{0x1D552, 0x1D6A3}, + RuneRange{0x1D6A8, 0x1D7C9}, + RuneRange{0x20000, 0x2A6D6}, + RuneRange{0x2F800, 0x2FA1D}, + RuneRange{0xF0000, 0xFFFFD}, + RuneRange{0x100000, 0x10FFFD}, +} + +// TableD2 represents RFC-3454 Table D.2. +var TableD2 Set = tableD2 diff --git a/vendor/go.opencensus.io/.travis.yml b/vendor/go.opencensus.io/.travis.yml deleted file mode 100644 index bd6b66ee83d..00000000000 --- a/vendor/go.opencensus.io/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -go_import_path: go.opencensus.io - -go: - - 1.11.x - -env: - global: - GO111MODULE=on - -before_script: - - make install-tools - -script: - - make travis-ci - - go run internal/check/version.go # TODO move this to makefile diff --git a/vendor/go.opencensus.io/go.mod b/vendor/go.opencensus.io/go.mod index 29707156269..95b2522a7fa 100644 --- a/vendor/go.opencensus.io/go.mod +++ b/vendor/go.opencensus.io/go.mod @@ -1,15 +1,12 @@ module go.opencensus.io require ( - github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 - github.com/golang/protobuf v1.3.1 - github.com/google/go-cmp v0.3.0 - github.com/stretchr/testify v1.4.0 - golang.org/x/net v0.0.0-20190620200207-3b0461eec859 - golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd // indirect - golang.org/x/text v0.3.3 // indirect - google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect - google.golang.org/grpc v1.20.1 + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e + github.com/golang/protobuf v1.4.3 + github.com/google/go-cmp v0.5.3 + github.com/stretchr/testify v1.6.1 + golang.org/x/net v0.0.0-20201110031124-69a78807bb2b + google.golang.org/grpc v1.33.2 ) go 1.13 diff --git a/vendor/go.opencensus.io/go.sum b/vendor/go.opencensus.io/go.sum index 01c02972c7e..c97cd1b551e 100644 --- a/vendor/go.opencensus.io/go.sum +++ b/vendor/go.opencensus.io/go.sum @@ -1,25 +1,47 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -30,24 +52,25 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd h1:r7DufRZuZbWB7j439YfAzP8RPDa9unLkpwQKUYbIMPI= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -55,20 +78,39 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/go.opencensus.io/metric/metricexport/reader.go b/vendor/go.opencensus.io/metric/metricexport/reader.go index b920bacd870..8a09d0f0076 100644 --- a/vendor/go.opencensus.io/metric/metricexport/reader.go +++ b/vendor/go.opencensus.io/metric/metricexport/reader.go @@ -130,7 +130,7 @@ func (ir *IntervalReader) Start() error { reportingInterval = ir.ReportingInterval } - if ir.done != nil { + if ir.quit != nil { return errAlreadyStarted } ir.timer = time.NewTicker(reportingInterval) @@ -172,6 +172,19 @@ func (ir *IntervalReader) Stop() { ir.quit = nil } +// Flush flushes the metrics if IntervalReader is stopped, otherwise no-op. +func (ir *IntervalReader) Flush() { + ir.mu.Lock() + defer ir.mu.Unlock() + + // No-op if IntervalReader is not stopped + if ir.quit != nil { + return + } + + ir.reader.ReadAndExport(ir.exporter) +} + // ReadAndExport reads metrics from all producer registered with // producer manager and then exports them using provided exporter. func (r *Reader) ReadAndExport(exporter Exporter) { diff --git a/vendor/go.opencensus.io/trace/basetypes.go b/vendor/go.opencensus.io/trace/basetypes.go index 0c54492a2b1..c8e26ed6355 100644 --- a/vendor/go.opencensus.io/trace/basetypes.go +++ b/vendor/go.opencensus.io/trace/basetypes.go @@ -49,6 +49,16 @@ type Attribute struct { value interface{} } +// Key returns the attribute's key +func (a *Attribute) Key() string { + return a.key +} + +// Value returns the attribute's value +func (a *Attribute) Value() interface{} { + return a.value +} + // BoolAttribute returns a bool-valued attribute. func BoolAttribute(key string, value bool) Attribute { return Attribute{key: key, value: value} diff --git a/vendor/go.opencensus.io/trace/spanstore.go b/vendor/go.opencensus.io/trace/spanstore.go index c442d990218..e601f76f2c8 100644 --- a/vendor/go.opencensus.io/trace/spanstore.go +++ b/vendor/go.opencensus.io/trace/spanstore.go @@ -48,8 +48,10 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData { var out []*SpanData s.mu.Lock() defer s.mu.Unlock() - for span := range s.active { - out = append(out, span.makeSpanData()) + for activeSpan := range s.active { + if s, ok := activeSpan.(*span); ok { + out = append(out, s.makeSpanData()) + } } return out } @@ -185,7 +187,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t // bucketed by latency. type spanStore struct { mu sync.Mutex // protects everything below. - active map[*Span]struct{} + active map[SpanInterface]struct{} errors map[int32]*bucket latency []bucket maxSpansPerErrorBucket int @@ -194,7 +196,7 @@ type spanStore struct { // newSpanStore creates a span store. func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore { s := &spanStore{ - active: make(map[*Span]struct{}), + active: make(map[SpanInterface]struct{}), latency: make([]bucket, len(defaultLatencies)+1), maxSpansPerErrorBucket: errorBucketSize, } @@ -271,7 +273,7 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) { } // add adds a span to the active bucket of the spanStore. -func (s *spanStore) add(span *Span) { +func (s *spanStore) add(span SpanInterface) { s.mu.Lock() s.active[span] = struct{}{} s.mu.Unlock() @@ -279,7 +281,7 @@ func (s *spanStore) add(span *Span) { // finished removes a span from the active set, and adds a corresponding // SpanData to a latency or error bucket. -func (s *spanStore) finished(span *Span, sd *SpanData) { +func (s *spanStore) finished(span SpanInterface, sd *SpanData) { latency := sd.EndTime.Sub(sd.StartTime) if latency < 0 { latency = 0 diff --git a/vendor/go.opencensus.io/trace/trace.go b/vendor/go.opencensus.io/trace/trace.go index daf895596a9..861df9d3913 100644 --- a/vendor/go.opencensus.io/trace/trace.go +++ b/vendor/go.opencensus.io/trace/trace.go @@ -28,12 +28,16 @@ import ( "go.opencensus.io/trace/tracestate" ) +type tracer struct{} + +var _ Tracer = &tracer{} + // Span represents a span of a trace. It has an associated SpanContext, and // stores data accumulated while the span is active. // // Ideally users should interact with Spans by calling the functions in this // package that take a Context parameter. -type Span struct { +type span struct { // data contains information recorded about the span. // // It will be non-nil if we are exporting the span or recording events for it. @@ -66,7 +70,7 @@ type Span struct { // IsRecordingEvents returns true if events are being recorded for this span. // Use this check to avoid computing expensive annotations when they will never // be used. -func (s *Span) IsRecordingEvents() bool { +func (s *span) IsRecordingEvents() bool { if s == nil { return false } @@ -109,13 +113,13 @@ type SpanContext struct { type contextKey struct{} // FromContext returns the Span stored in a context, or nil if there isn't one. -func FromContext(ctx context.Context) *Span { +func (t *tracer) FromContext(ctx context.Context) *Span { s, _ := ctx.Value(contextKey{}).(*Span) return s } // NewContext returns a new context with the given Span attached. -func NewContext(parent context.Context, s *Span) context.Context { +func (t *tracer) NewContext(parent context.Context, s *Span) context.Context { return context.WithValue(parent, contextKey{}, s) } @@ -166,12 +170,14 @@ func WithSampler(sampler Sampler) StartOption { // // Returned context contains the newly created span. You can use it to // propagate the returned span in process. -func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { +func (t *tracer) StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { var opts StartOptions var parent SpanContext - if p := FromContext(ctx); p != nil { - p.addChild() - parent = p.spanContext + if p := t.FromContext(ctx); p != nil { + if ps, ok := p.internal.(*span); ok { + ps.addChild() + } + parent = p.SpanContext() } for _, op := range o { op(&opts) @@ -180,7 +186,8 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont ctx, end := startExecutionTracerTask(ctx, name) span.executionTracerTaskEnd = end - return NewContext(ctx, span), span + extSpan := NewSpan(span) + return t.NewContext(ctx, extSpan), extSpan } // StartSpanWithRemoteParent starts a new child span of the span from the given parent. @@ -190,7 +197,7 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont // // Returned context contains the newly created span. You can use it to // propagate the returned span in process. -func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { +func (t *tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { var opts StartOptions for _, op := range o { op(&opts) @@ -198,12 +205,13 @@ func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanCont span := startSpanInternal(name, parent != SpanContext{}, parent, true, opts) ctx, end := startExecutionTracerTask(ctx, name) span.executionTracerTaskEnd = end - return NewContext(ctx, span), span + extSpan := NewSpan(span) + return t.NewContext(ctx, extSpan), extSpan } -func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *Span { - span := &Span{} - span.spanContext = parent +func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *span { + s := &span{} + s.spanContext = parent cfg := config.Load().(*Config) if gen, ok := cfg.IDGenerator.(*defaultIDGenerator); ok { @@ -212,9 +220,9 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa } if !hasParent { - span.spanContext.TraceID = cfg.IDGenerator.NewTraceID() + s.spanContext.TraceID = cfg.IDGenerator.NewTraceID() } - span.spanContext.SpanID = cfg.IDGenerator.NewSpanID() + s.spanContext.SpanID = cfg.IDGenerator.NewSpanID() sampler := cfg.DefaultSampler if !hasParent || remoteParent || o.Sampler != nil { @@ -226,47 +234,47 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa if o.Sampler != nil { sampler = o.Sampler } - span.spanContext.setIsSampled(sampler(SamplingParameters{ + s.spanContext.setIsSampled(sampler(SamplingParameters{ ParentContext: parent, - TraceID: span.spanContext.TraceID, - SpanID: span.spanContext.SpanID, + TraceID: s.spanContext.TraceID, + SpanID: s.spanContext.SpanID, Name: name, HasRemoteParent: remoteParent}).Sample) } - if !internal.LocalSpanStoreEnabled && !span.spanContext.IsSampled() { - return span + if !internal.LocalSpanStoreEnabled && !s.spanContext.IsSampled() { + return s } - span.data = &SpanData{ - SpanContext: span.spanContext, + s.data = &SpanData{ + SpanContext: s.spanContext, StartTime: time.Now(), SpanKind: o.SpanKind, Name: name, HasRemoteParent: remoteParent, } - span.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan) - span.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan) - span.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan) - span.links = newEvictedQueue(cfg.MaxLinksPerSpan) + s.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan) + s.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan) + s.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan) + s.links = newEvictedQueue(cfg.MaxLinksPerSpan) if hasParent { - span.data.ParentSpanID = parent.SpanID + s.data.ParentSpanID = parent.SpanID } if internal.LocalSpanStoreEnabled { var ss *spanStore ss = spanStoreForNameCreateIfNew(name) if ss != nil { - span.spanStore = ss - ss.add(span) + s.spanStore = ss + ss.add(s) } } - return span + return s } // End ends the span. -func (s *Span) End() { +func (s *span) End() { if s == nil { return } @@ -296,7 +304,7 @@ func (s *Span) End() { // makeSpanData produces a SpanData representing the current state of the Span. // It requires that s.data is non-nil. -func (s *Span) makeSpanData() *SpanData { +func (s *span) makeSpanData() *SpanData { var sd SpanData s.mu.Lock() sd = *s.data @@ -321,7 +329,7 @@ func (s *Span) makeSpanData() *SpanData { } // SpanContext returns the SpanContext of the span. -func (s *Span) SpanContext() SpanContext { +func (s *span) SpanContext() SpanContext { if s == nil { return SpanContext{} } @@ -329,7 +337,7 @@ func (s *Span) SpanContext() SpanContext { } // SetName sets the name of the span, if it is recording events. -func (s *Span) SetName(name string) { +func (s *span) SetName(name string) { if !s.IsRecordingEvents() { return } @@ -339,7 +347,7 @@ func (s *Span) SetName(name string) { } // SetStatus sets the status of the span, if it is recording events. -func (s *Span) SetStatus(status Status) { +func (s *span) SetStatus(status Status) { if !s.IsRecordingEvents() { return } @@ -348,7 +356,7 @@ func (s *Span) SetStatus(status Status) { s.mu.Unlock() } -func (s *Span) interfaceArrayToLinksArray() []Link { +func (s *span) interfaceArrayToLinksArray() []Link { linksArr := make([]Link, 0, len(s.links.queue)) for _, value := range s.links.queue { linksArr = append(linksArr, value.(Link)) @@ -356,7 +364,7 @@ func (s *Span) interfaceArrayToLinksArray() []Link { return linksArr } -func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent { +func (s *span) interfaceArrayToMessageEventArray() []MessageEvent { messageEventArr := make([]MessageEvent, 0, len(s.messageEvents.queue)) for _, value := range s.messageEvents.queue { messageEventArr = append(messageEventArr, value.(MessageEvent)) @@ -364,7 +372,7 @@ func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent { return messageEventArr } -func (s *Span) interfaceArrayToAnnotationArray() []Annotation { +func (s *span) interfaceArrayToAnnotationArray() []Annotation { annotationArr := make([]Annotation, 0, len(s.annotations.queue)) for _, value := range s.annotations.queue { annotationArr = append(annotationArr, value.(Annotation)) @@ -372,7 +380,7 @@ func (s *Span) interfaceArrayToAnnotationArray() []Annotation { return annotationArr } -func (s *Span) lruAttributesToAttributeMap() map[string]interface{} { +func (s *span) lruAttributesToAttributeMap() map[string]interface{} { attributes := make(map[string]interface{}, s.lruAttributes.len()) for _, key := range s.lruAttributes.keys() { value, ok := s.lruAttributes.get(key) @@ -384,13 +392,13 @@ func (s *Span) lruAttributesToAttributeMap() map[string]interface{} { return attributes } -func (s *Span) copyToCappedAttributes(attributes []Attribute) { +func (s *span) copyToCappedAttributes(attributes []Attribute) { for _, a := range attributes { s.lruAttributes.add(a.key, a.value) } } -func (s *Span) addChild() { +func (s *span) addChild() { if !s.IsRecordingEvents() { return } @@ -402,7 +410,7 @@ func (s *Span) addChild() { // AddAttributes sets attributes in the span. // // Existing attributes whose keys appear in the attributes parameter are overwritten. -func (s *Span) AddAttributes(attributes ...Attribute) { +func (s *span) AddAttributes(attributes ...Attribute) { if !s.IsRecordingEvents() { return } @@ -411,49 +419,27 @@ func (s *Span) AddAttributes(attributes ...Attribute) { s.mu.Unlock() } -// copyAttributes copies a slice of Attributes into a map. -func copyAttributes(m map[string]interface{}, attributes []Attribute) { - for _, a := range attributes { - m[a.key] = a.value - } -} - -func (s *Span) lazyPrintfInternal(attributes []Attribute, format string, a ...interface{}) { +func (s *span) printStringInternal(attributes []Attribute, str string) { now := time.Now() - msg := fmt.Sprintf(format, a...) - var m map[string]interface{} - s.mu.Lock() + var am map[string]interface{} if len(attributes) != 0 { - m = make(map[string]interface{}, len(attributes)) - copyAttributes(m, attributes) + am = make(map[string]interface{}, len(attributes)) + for _, attr := range attributes { + am[attr.key] = attr.value + } } - s.annotations.add(Annotation{ - Time: now, - Message: msg, - Attributes: m, - }) - s.mu.Unlock() -} - -func (s *Span) printStringInternal(attributes []Attribute, str string) { - now := time.Now() - var a map[string]interface{} s.mu.Lock() - if len(attributes) != 0 { - a = make(map[string]interface{}, len(attributes)) - copyAttributes(a, attributes) - } s.annotations.add(Annotation{ Time: now, Message: str, - Attributes: a, + Attributes: am, }) s.mu.Unlock() } // Annotate adds an annotation with attributes. // Attributes can be nil. -func (s *Span) Annotate(attributes []Attribute, str string) { +func (s *span) Annotate(attributes []Attribute, str string) { if !s.IsRecordingEvents() { return } @@ -461,11 +447,11 @@ func (s *Span) Annotate(attributes []Attribute, str string) { } // Annotatef adds an annotation with attributes. -func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) { +func (s *span) Annotatef(attributes []Attribute, format string, a ...interface{}) { if !s.IsRecordingEvents() { return } - s.lazyPrintfInternal(attributes, format, a...) + s.printStringInternal(attributes, fmt.Sprintf(format, a...)) } // AddMessageSendEvent adds a message send event to the span. @@ -474,7 +460,7 @@ func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{} // unique in this span and the same between the send event and the receive // event (this allows to identify a message between the sender and receiver). // For example, this could be a sequence id. -func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { +func (s *span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { if !s.IsRecordingEvents() { return } @@ -496,7 +482,7 @@ func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedBy // unique in this span and the same between the send event and the receive // event (this allows to identify a message between the sender and receiver). // For example, this could be a sequence id. -func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { +func (s *span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { if !s.IsRecordingEvents() { return } @@ -513,7 +499,7 @@ func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compresse } // AddLink adds a link to the span. -func (s *Span) AddLink(l Link) { +func (s *span) AddLink(l Link) { if !s.IsRecordingEvents() { return } @@ -522,7 +508,7 @@ func (s *Span) AddLink(l Link) { s.mu.Unlock() } -func (s *Span) String() string { +func (s *span) String() string { if s == nil { return "" } diff --git a/vendor/go.opencensus.io/trace/trace_api.go b/vendor/go.opencensus.io/trace/trace_api.go new file mode 100644 index 00000000000..9e2c3a99926 --- /dev/null +++ b/vendor/go.opencensus.io/trace/trace_api.go @@ -0,0 +1,265 @@ +// Copyright 2020, OpenCensus Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package trace + +import ( + "context" +) + +// DefaultTracer is the tracer used when package-level exported functions are invoked. +var DefaultTracer Tracer = &tracer{} + +// Tracer can start spans and access context functions. +type Tracer interface { + + // StartSpan starts a new child span of the current span in the context. If + // there is no span in the context, creates a new trace and span. + // + // Returned context contains the newly created span. You can use it to + // propagate the returned span in process. + StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) + + // StartSpanWithRemoteParent starts a new child span of the span from the given parent. + // + // If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is + // preferred for cases where the parent is propagated via an incoming request. + // + // Returned context contains the newly created span. You can use it to + // propagate the returned span in process. + StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) + + // FromContext returns the Span stored in a context, or nil if there isn't one. + FromContext(ctx context.Context) *Span + + // NewContext returns a new context with the given Span attached. + NewContext(parent context.Context, s *Span) context.Context +} + +// StartSpan starts a new child span of the current span in the context. If +// there is no span in the context, creates a new trace and span. +// +// Returned context contains the newly created span. You can use it to +// propagate the returned span in process. +func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) { + return DefaultTracer.StartSpan(ctx, name, o...) +} + +// StartSpanWithRemoteParent starts a new child span of the span from the given parent. +// +// If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is +// preferred for cases where the parent is propagated via an incoming request. +// +// Returned context contains the newly created span. You can use it to +// propagate the returned span in process. +func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) { + return DefaultTracer.StartSpanWithRemoteParent(ctx, name, parent, o...) +} + +// FromContext returns the Span stored in a context, or a Span that is not +// recording events if there isn't one. +func FromContext(ctx context.Context) *Span { + return DefaultTracer.FromContext(ctx) +} + +// NewContext returns a new context with the given Span attached. +func NewContext(parent context.Context, s *Span) context.Context { + return DefaultTracer.NewContext(parent, s) +} + +// SpanInterface represents a span of a trace. It has an associated SpanContext, and +// stores data accumulated while the span is active. +// +// Ideally users should interact with Spans by calling the functions in this +// package that take a Context parameter. +type SpanInterface interface { + + // IsRecordingEvents returns true if events are being recorded for this span. + // Use this check to avoid computing expensive annotations when they will never + // be used. + IsRecordingEvents() bool + + // End ends the span. + End() + + // SpanContext returns the SpanContext of the span. + SpanContext() SpanContext + + // SetName sets the name of the span, if it is recording events. + SetName(name string) + + // SetStatus sets the status of the span, if it is recording events. + SetStatus(status Status) + + // AddAttributes sets attributes in the span. + // + // Existing attributes whose keys appear in the attributes parameter are overwritten. + AddAttributes(attributes ...Attribute) + + // Annotate adds an annotation with attributes. + // Attributes can be nil. + Annotate(attributes []Attribute, str string) + + // Annotatef adds an annotation with attributes. + Annotatef(attributes []Attribute, format string, a ...interface{}) + + // AddMessageSendEvent adds a message send event to the span. + // + // messageID is an identifier for the message, which is recommended to be + // unique in this span and the same between the send event and the receive + // event (this allows to identify a message between the sender and receiver). + // For example, this could be a sequence id. + AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) + + // AddMessageReceiveEvent adds a message receive event to the span. + // + // messageID is an identifier for the message, which is recommended to be + // unique in this span and the same between the send event and the receive + // event (this allows to identify a message between the sender and receiver). + // For example, this could be a sequence id. + AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) + + // AddLink adds a link to the span. + AddLink(l Link) + + // String prints a string representation of a span. + String() string +} + +// NewSpan is a convenience function for creating a *Span out of a *span +func NewSpan(s SpanInterface) *Span { + return &Span{internal: s} +} + +// Span is a struct wrapper around the SpanInt interface, which allows correctly handling +// nil spans, while also allowing the SpanInterface implementation to be swapped out. +type Span struct { + internal SpanInterface +} + +// Internal returns the underlying implementation of the Span +func (s *Span) Internal() SpanInterface { + return s.internal +} + +// IsRecordingEvents returns true if events are being recorded for this span. +// Use this check to avoid computing expensive annotations when they will never +// be used. +func (s *Span) IsRecordingEvents() bool { + if s == nil { + return false + } + return s.internal.IsRecordingEvents() +} + +// End ends the span. +func (s *Span) End() { + if s == nil { + return + } + s.internal.End() +} + +// SpanContext returns the SpanContext of the span. +func (s *Span) SpanContext() SpanContext { + if s == nil { + return SpanContext{} + } + return s.internal.SpanContext() +} + +// SetName sets the name of the span, if it is recording events. +func (s *Span) SetName(name string) { + if !s.IsRecordingEvents() { + return + } + s.internal.SetName(name) +} + +// SetStatus sets the status of the span, if it is recording events. +func (s *Span) SetStatus(status Status) { + if !s.IsRecordingEvents() { + return + } + s.internal.SetStatus(status) +} + +// AddAttributes sets attributes in the span. +// +// Existing attributes whose keys appear in the attributes parameter are overwritten. +func (s *Span) AddAttributes(attributes ...Attribute) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddAttributes(attributes...) +} + +// Annotate adds an annotation with attributes. +// Attributes can be nil. +func (s *Span) Annotate(attributes []Attribute, str string) { + if !s.IsRecordingEvents() { + return + } + s.internal.Annotate(attributes, str) +} + +// Annotatef adds an annotation with attributes. +func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) { + if !s.IsRecordingEvents() { + return + } + s.internal.Annotatef(attributes, format, a...) +} + +// AddMessageSendEvent adds a message send event to the span. +// +// messageID is an identifier for the message, which is recommended to be +// unique in this span and the same between the send event and the receive +// event (this allows to identify a message between the sender and receiver). +// For example, this could be a sequence id. +func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize) +} + +// AddMessageReceiveEvent adds a message receive event to the span. +// +// messageID is an identifier for the message, which is recommended to be +// unique in this span and the same between the send event and the receive +// event (this allows to identify a message between the sender and receiver). +// For example, this could be a sequence id. +func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize) +} + +// AddLink adds a link to the span. +func (s *Span) AddLink(l Link) { + if !s.IsRecordingEvents() { + return + } + s.internal.AddLink(l) +} + +// String prints a string representation of a span. +func (s *Span) String() string { + if s == nil { + return "" + } + return s.internal.String() +} diff --git a/vendor/go.opentelemetry.io/collector/component/component.go b/vendor/go.opentelemetry.io/collector/component/component.go index c591879b51f..065c3e2d775 100644 --- a/vendor/go.opentelemetry.io/collector/component/component.go +++ b/vendor/go.opentelemetry.io/collector/component/component.go @@ -37,11 +37,13 @@ type Component interface { // Create a new context from the context.Background() for long-running operations. Start(ctx context.Context, host Host) error - // Shutdown is invoked during service shutdown. + // Shutdown is invoked during service shutdown. After Shutdown() is called, if the component accept data in + // any way, it should not accept it anymore. // // If there are any background operations running by the component they must be aborted as soon as possible. // Remember that if you started any long-running background operation from the Start() method that operation - // must be also cancelled. + // must be also cancelled. If there are any buffer in the component, it should be cleared and the data sent + // immediately to the next component. Shutdown(ctx context.Context) error } diff --git a/vendor/go.opentelemetry.io/collector/component/componenterror/errors.go b/vendor/go.opentelemetry.io/collector/component/componenterror/errors.go index 0a89c29b3f2..ecc8c6a1f1f 100644 --- a/vendor/go.opentelemetry.io/collector/component/componenterror/errors.go +++ b/vendor/go.opentelemetry.io/collector/component/componenterror/errors.go @@ -18,8 +18,6 @@ package componenterror import ( "errors" - "fmt" - "strings" "go.opentelemetry.io/collector/consumer/consumererror" ) @@ -36,28 +34,7 @@ var ( ) // CombineErrors converts a list of errors into one error. +// Deprecated: use consumererror.CombineErrors instead. func CombineErrors(errs []error) error { - numErrors := len(errs) - if numErrors == 0 { - // No errors - return nil - } - - if numErrors == 1 { - return errs[0] - } - - errMsgs := make([]string, 0, numErrors) - permanent := false - for _, err := range errs { - if !permanent && consumererror.IsPermanent(err) { - permanent = true - } - errMsgs = append(errMsgs, err.Error()) - } - err := fmt.Errorf("[%s]", strings.Join(errMsgs, "; ")) - if permanent { - err = consumererror.Permanent(err) - } - return err + return consumererror.CombineErrors(errs) } diff --git a/vendor/go.opentelemetry.io/collector/component/receiver.go b/vendor/go.opentelemetry.io/collector/component/receiver.go index a0cd40dc889..44b57070b58 100644 --- a/vendor/go.opentelemetry.io/collector/component/receiver.go +++ b/vendor/go.opentelemetry.io/collector/component/receiver.go @@ -32,8 +32,7 @@ type Receiver interface { // Its purpose is to translate data from the wild into internal trace format. // TracesReceiver feeds a consumer.TracesConsumer with data. // -// For example it could be Zipkin data source which translates -// Zipkin spans into consumerdata.TraceData. +// For example it could be Zipkin data source which translates Zipkin spans into pdata.Traces. type TracesReceiver interface { Receiver } @@ -42,8 +41,7 @@ type TracesReceiver interface { // Its purpose is to translate data from the wild into internal metrics format. // MetricsReceiver feeds a consumer.MetricsConsumer with data. // -// For example it could be Prometheus data source which translates -// Prometheus metrics into consumerdata.MetricsData. +// For example it could be Prometheus data source which translates Prometheus metrics into pdata.Metrics. type MetricsReceiver interface { Receiver } diff --git a/vendor/go.opentelemetry.io/collector/config/config.go b/vendor/go.opentelemetry.io/collector/config/config.go index 06cdc58baa2..5bbfcd0669c 100644 --- a/vendor/go.opentelemetry.io/collector/config/config.go +++ b/vendor/go.opentelemetry.io/collector/config/config.go @@ -275,6 +275,7 @@ func loadExtensions(exts map[string]interface{}, factories map[configmodels.Type // Create the default config for this extension extensionCfg := factory.CreateDefaultConfig() extensionCfg.SetName(fullName) + expandEnvLoadedConfig(extensionCfg) // Now that the default config struct is created we can Unmarshal into it // and it will apply user-defined config on top of the default. @@ -310,6 +311,7 @@ func LoadReceiver(componentConfig *viper.Viper, typeStr configmodels.Type, fullN // Create the default config for this receiver. receiverCfg := factory.CreateDefaultConfig() receiverCfg.SetName(fullName) + expandEnvLoadedConfig(receiverCfg) // Now that the default config struct is created we can Unmarshal into it // and it will apply user-defined config on top of the default. @@ -382,6 +384,7 @@ func loadExporters(exps map[string]interface{}, factories map[configmodels.Type] // Create the default config for this exporter exporterCfg := factory.CreateDefaultConfig() exporterCfg.SetName(fullName) + expandEnvLoadedConfig(exporterCfg) // Now that the default config struct is created we can Unmarshal into it // and it will apply user-defined config on top of the default. @@ -424,6 +427,7 @@ func loadProcessors(procs map[string]interface{}, factories map[configmodels.Typ // Create the default config for this processor. processorCfg := factory.CreateDefaultConfig() processorCfg.SetName(fullName) + expandEnvLoadedConfig(processorCfg) // Now that the default config struct is created we can Unmarshal into it // and it will apply user-defined config on top of the default. @@ -676,6 +680,45 @@ func expandStringValues(value interface{}) interface{} { } } +// expandEnvLoadedConfig is a utility function that goes recursively through a config object +// and tries to expand environment variables in its string fields. +func expandEnvLoadedConfig(s interface{}) { + expandEnvLoadedConfigPointer(s) +} + +func expandEnvLoadedConfigPointer(s interface{}) { + // Check that the value given is indeed a pointer, otherwise safely stop the search here + value := reflect.ValueOf(s) + if value.Kind() != reflect.Ptr { + return + } + // Run expandLoadedConfigValue on the value behind the pointer + expandEnvLoadedConfigValue(value.Elem()) +} + +func expandEnvLoadedConfigValue(value reflect.Value) { + // The value given is a string, we expand it (if allowed) + if value.Kind() == reflect.String && value.CanSet() { + value.SetString(expandEnv(value.String())) + } + // The value given is a struct, we go through its fields + if value.Kind() == reflect.Struct { + for i := 0; i < value.NumField(); i++ { + field := value.Field(i) // Returns the content of the field + if field.CanSet() { // Only try to modify a field if it can be modified (eg. skip unexported private fields) + switch field.Kind() { + case reflect.String: // The current field is a string, we want to expand it + field.SetString(expandEnv(field.String())) // Expand env variables in the string + case reflect.Ptr: // The current field is a pointer + expandEnvLoadedConfigPointer(field.Interface()) // Run the expansion function on the pointer + case reflect.Struct: // The current field is a nested struct + expandEnvLoadedConfigValue(field) // Go through the nested struct + } + } + } + } +} + func expandEnv(s string) string { return os.Expand(s, func(str string) string { // This allows escaping environment variable substitution via $$, e.g. diff --git a/vendor/go.opentelemetry.io/collector/config/configgrpc/README.md b/vendor/go.opentelemetry.io/collector/config/configgrpc/README.md index 4a6ff017b6d..ef5fe4c0f4b 100644 --- a/vendor/go.opentelemetry.io/collector/config/configgrpc/README.md +++ b/vendor/go.opentelemetry.io/collector/config/configgrpc/README.md @@ -7,7 +7,7 @@ adjusted. ## Client Configuration -[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/README.md) +[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md) leverage client configuration. Note that client configuration supports TLS configuration, however @@ -29,7 +29,7 @@ README](../configtls/README.md). Example: ```yaml -exporter: +exporters: otlp: endpoint: otelcol2:55690 headers: @@ -39,7 +39,7 @@ exporter: ## Server Configuration -[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/README.md) +[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/README.md) leverage server configuration. Note that transport configuration can also be configured. For more information, diff --git a/vendor/go.opentelemetry.io/collector/config/confighttp/README.md b/vendor/go.opentelemetry.io/collector/config/confighttp/README.md index 5449b679333..ead126dc4a3 100644 --- a/vendor/go.opentelemetry.io/collector/config/confighttp/README.md +++ b/vendor/go.opentelemetry.io/collector/config/confighttp/README.md @@ -6,7 +6,7 @@ receivers or exporters. ## Client Configuration -[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/README.md) +[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md) leverage client configuration. Note that client configuration supports TLS configuration, however @@ -33,12 +33,16 @@ exporter: ## Server Configuration -[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/README.md) +[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/README.md) leverage server configuration. - [`cors_allowed_origins`](https://github.com/rs/cors): An empty list means that CORS is not enabled at all. A wildcard can be used to match any origin or one or more characters of an origin. +- [`cors_allowed_headers`](https://github.com/rs/cors): When CORS is enabled, + can be used to specify an optional list of allowed headers. By default, it includes `Accept`, + `Content-Type`, `X-Requested-With`. `Origin` is also always + added to the list. A wildcard (`*`) can be used to match any header. - `endpoint`: Valid value syntax available [here](https://github.com/grpc/grpc/blob/master/doc/naming.md) - [`tls_settings`](../configtls/README.md) @@ -50,6 +54,8 @@ receivers: cors_allowed_origins: - https://foo.bar.com - https://*.test.com + cors_allowed_headers: + - ExampleHeader endpoint: 0.0.0.0:55690 protocols: http: diff --git a/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go b/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go index 56936c74da8..b1b49b5a587 100644 --- a/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go +++ b/vendor/go.opentelemetry.io/collector/config/confighttp/confighttp.go @@ -114,6 +114,12 @@ type HTTPServerSettings struct { // An empty list means that CORS is not enabled at all. A wildcard (*) can be // used to match any origin or one or more characters of an origin. CorsOrigins []string `mapstructure:"cors_allowed_origins"` + + // CorsHeaders are the allowed CORS headers for HTTP/JSON requests to grpc-gateway adapter + // for the OTLP receiver. See github.com/rs/cors + // CORS needs to be enabled first by providing a non-empty list in CorsOrigins + // A wildcard (*) can be used to match any header. + CorsHeaders []string `mapstructure:"cors_allowed_headers"` } func (hss *HTTPServerSettings) ToListener() (net.Listener, error) { @@ -155,9 +161,11 @@ func (hss *HTTPServerSettings) ToServer(handler http.Handler, opts ...ToServerOp o(serverOpts) } if len(hss.CorsOrigins) > 0 { - co := cors.Options{AllowedOrigins: hss.CorsOrigins} + co := cors.Options{AllowedOrigins: hss.CorsOrigins, AllowedHeaders: hss.CorsHeaders} handler = cors.New(co).Handler(handler) } + // TODO: emit a warning when non-empty CorsHeaders and empty CorsOrigins. + handler = middleware.HTTPContentDecompressor( handler, middleware.WithErrorHandler(serverOpts.errorHandler), diff --git a/vendor/go.opentelemetry.io/collector/config/confignet/README.md b/vendor/go.opentelemetry.io/collector/config/confignet/README.md index 2a4053da59f..579564cbff4 100644 --- a/vendor/go.opentelemetry.io/collector/config/confignet/README.md +++ b/vendor/go.opentelemetry.io/collector/config/confignet/README.md @@ -1,6 +1,6 @@ # Network Configuration Settings -[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/README.md) +[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/README.md) leverage network configuration to set connection and transport information. - `endpoint`: Configures the address for this network connection. For TCP and diff --git a/vendor/go.opentelemetry.io/collector/config/configtls/README.md b/vendor/go.opentelemetry.io/collector/config/configtls/README.md index 7eda60cd074..b30bcd35aeb 100644 --- a/vendor/go.opentelemetry.io/collector/config/configtls/README.md +++ b/vendor/go.opentelemetry.io/collector/config/configtls/README.md @@ -39,7 +39,7 @@ See below for examples. ## Client Configuration -[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/README.md) +[Exporters](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/README.md) leverage client configuration. Note that client configuration supports TLS configuration, however @@ -74,7 +74,7 @@ exporters: ## Server Configuration -[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/master/receiver/README.md) +[Receivers](https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/README.md) leverage server configuration. Beyond TLS configuration, the following setting can optionally be configured diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumer.go b/vendor/go.opentelemetry.io/collector/consumer/consumer.go index aa867f62984..e2b6b77079a 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/consumer.go +++ b/vendor/go.opentelemetry.io/collector/consumer/consumer.go @@ -21,7 +21,7 @@ import ( "go.opentelemetry.io/collector/consumer/pdata" ) -// MetricsConsumer is the new metrics consumer interface that receives pdata.MetricData, processes it +// MetricsConsumer is the new metrics consumer interface that receives pdata.Metrics, processes it // as needed, and sends it to the next processing node if any or to the destination. type MetricsConsumer interface { ConsumeMetrics(ctx context.Context, md pdata.Metrics) error diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/combineerrors.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/combineerrors.go new file mode 100644 index 00000000000..1010c07d60c --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/combineerrors.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package consumererror + +import ( + "fmt" + "strings" +) + +// CombineErrors converts a list of errors into one error. +func CombineErrors(errs []error) error { + numErrors := len(errs) + if numErrors == 0 { + // No errors + return nil + } + + if numErrors == 1 { + return errs[0] + } + + errMsgs := make([]string, 0, numErrors) + permanent := false + for _, err := range errs { + if !permanent && IsPermanent(err) { + permanent = true + } + errMsgs = append(errMsgs, err.Error()) + } + err := fmt.Errorf("[%s]", strings.Join(errMsgs, "; ")) + if permanent { + err = Permanent(err) + } + return err +} diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/permanenterror.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/permanenterror.go index e4d0950596e..935206f1a57 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/consumererror/permanenterror.go +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/permanenterror.go @@ -17,12 +17,17 @@ // error type/instance. package consumererror +import "errors" + // permanent is an error that will be always returned if its source // receives the same inputs. type permanent struct { err error } +// permanentError exists to test errors for "IsPermanent" +var permanentError = &permanent{} + // Permanent wraps an error to indicate that it is a permanent error, i.e.: an // error that will be always returned if its source receives the same inputs. func Permanent(err error) error { @@ -38,8 +43,7 @@ func (p permanent) Error() string { // that its sources receives the same input. func IsPermanent(err error) bool { if err != nil { - _, isPermanent := err.(permanent) - return isPermanent + return errors.As(err, permanentError) } return false } diff --git a/vendor/go.opentelemetry.io/collector/consumer/consumererror/scrapeerrors.go b/vendor/go.opentelemetry.io/collector/consumer/consumererror/scrapeerrors.go new file mode 100644 index 00000000000..1bd0b6de12a --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/consumer/consumererror/scrapeerrors.go @@ -0,0 +1,49 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package consumererror + +// ScrapeErrors contains multiple PartialScrapeErrors and can also contain generic errors. +type ScrapeErrors struct { + errs []error + failedScrapeCount int +} + +// Add adds a PartialScrapeError with the provided failed count and error. +func (s *ScrapeErrors) AddPartial(failed int, err error) { + s.errs = append(s.errs, NewPartialScrapeError(err, failed)) + s.failedScrapeCount += failed +} + +// Add adds a regular error. +func (s *ScrapeErrors) Add(err error) { + s.errs = append(s.errs, err) +} + +// Combine converts a slice of errors into one error. +// It will return a PartialScrapeError if at least one error in the slice is a PartialScrapeError. +func (s *ScrapeErrors) Combine() error { + partialScrapeErr := false + for _, err := range s.errs { + if IsPartialScrapeError(err) { + partialScrapeErr = true + } + } + + if !partialScrapeErr { + return CombineErrors(s.errs) + } + + return NewPartialScrapeError(CombineErrors(s.errs), s.failedScrapeCount) +} diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/common.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/common.go index 7bd75dd8ecb..0792287580e 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/common.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/common.go @@ -21,7 +21,7 @@ import ( "sort" "time" - otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" + otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1" ) // TimestampUnixNano is a time specified as UNIX Epoch time in nanoseconds since @@ -280,6 +280,10 @@ func (a AttributeValue) CopyTo(dest AttributeValue) { // Equal checks for equality, it returns true if the objects are equal otherwise false. func (a AttributeValue) Equal(av AttributeValue) bool { + if a.orig == av.orig { + return true + } + if a.orig.Value == nil || av.orig.Value == nil { return a.orig.Value == av.orig.Value } @@ -293,8 +297,30 @@ func (a AttributeValue) Equal(av AttributeValue) bool { return v.IntValue == av.orig.GetIntValue() case *otlpcommon.AnyValue_DoubleValue: return v.DoubleValue == av.orig.GetDoubleValue() + case *otlpcommon.AnyValue_ArrayValue: + vv := v.ArrayValue.GetValues() + avv := av.orig.GetArrayValue().GetValues() + if len(vv) != len(avv) { + return false + } + + for i, val := range avv { + val := val + av := newAttributeValue(&vv[i]) + + // According to the specification, array values must be scalar. + if avType := av.Type(); avType == AttributeValueARRAY || avType == AttributeValueMAP { + return false + } + + if !av.Equal(newAttributeValue(&val)) { + return false + } + } + return true } - // TODO: handle MAP and ARRAY data types. + + // TODO: handle MAP data type return false } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_common.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_common.go index c54f817e4c7..1028bf4933d 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_common.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_common.go @@ -18,7 +18,7 @@ package pdata import ( - otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" + otlpcommon "go.opentelemetry.io/collector/internal/data/protogen/common/v1" ) // InstrumentationLibrary is a message representing the instrumentation library information. @@ -43,35 +43,22 @@ func NewInstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&otlpcommon.InstrumentationLibrary{}) } -// Deprecated: This function will be removed soon. -func (ms InstrumentationLibrary) InitEmpty() { - *ms.orig = otlpcommon.InstrumentationLibrary{} -} - // Name returns the name associated with this InstrumentationLibrary. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrary) Name() string { return (*ms.orig).Name } // SetName replaces the name associated with this InstrumentationLibrary. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrary) SetName(v string) { (*ms.orig).Name = v } // Version returns the version associated with this InstrumentationLibrary. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrary) Version() string { return (*ms.orig).Version } // SetVersion replaces the version associated with this InstrumentationLibrary. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrary) SetVersion(v string) { (*ms.orig).Version = v } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_log.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_log.go index 918b274f9bf..76bb19dfb81 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_log.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_log.go @@ -19,7 +19,7 @@ package pdata import ( "go.opentelemetry.io/collector/internal/data" - otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1" + otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1" ) // ResourceLogsSlice logically represents a slice of ResourceLogs. @@ -158,21 +158,12 @@ func NewResourceLogs() ResourceLogs { return newResourceLogs(&otlplogs.ResourceLogs{}) } -// Deprecated: This function will be removed soon. -func (ms ResourceLogs) InitEmpty() { - *ms.orig = otlplogs.ResourceLogs{} -} - // Resource returns the resource associated with this ResourceLogs. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceLogs) Resource() Resource { return newResource(&(*ms.orig).Resource) } // InstrumentationLibraryLogs returns the InstrumentationLibraryLogs associated with this ResourceLogs. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceLogs) InstrumentationLibraryLogs() InstrumentationLibraryLogsSlice { return newInstrumentationLibraryLogsSlice(&(*ms.orig).InstrumentationLibraryLogs) } @@ -319,21 +310,12 @@ func NewInstrumentationLibraryLogs() InstrumentationLibraryLogs { return newInstrumentationLibraryLogs(&otlplogs.InstrumentationLibraryLogs{}) } -// Deprecated: This function will be removed soon. -func (ms InstrumentationLibraryLogs) InitEmpty() { - *ms.orig = otlplogs.InstrumentationLibraryLogs{} -} - // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibraryLogs. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibraryLogs) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) } // Logs returns the Logs associated with this InstrumentationLibraryLogs. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibraryLogs) Logs() LogSlice { return newLogSlice(&(*ms.orig).Logs) } @@ -481,133 +463,92 @@ func NewLogRecord() LogRecord { return newLogRecord(&otlplogs.LogRecord{}) } -// Deprecated: This function will be removed soon. -func (ms LogRecord) InitEmpty() { - *ms.orig = otlplogs.LogRecord{} -} - // Timestamp returns the timestamp associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // TraceID returns the traceid associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) TraceID() TraceID { return TraceID((*ms.orig).TraceId) } // SetTraceID replaces the traceid associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetTraceID(v TraceID) { (*ms.orig).TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SpanID() SpanID { return SpanID((*ms.orig).SpanId) } // SetSpanID replaces the spanid associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetSpanID(v SpanID) { (*ms.orig).SpanId = data.SpanID(v) } // Flags returns the flags associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) Flags() uint32 { return uint32((*ms.orig).Flags) } // SetFlags replaces the flags associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetFlags(v uint32) { (*ms.orig).Flags = uint32(v) } // SeverityText returns the severitytext associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SeverityText() string { return (*ms.orig).SeverityText } // SetSeverityText replaces the severitytext associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetSeverityText(v string) { (*ms.orig).SeverityText = v } // SeverityNumber returns the severitynumber associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SeverityNumber() SeverityNumber { return SeverityNumber((*ms.orig).SeverityNumber) } // SetSeverityNumber replaces the severitynumber associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetSeverityNumber(v SeverityNumber) { (*ms.orig).SeverityNumber = otlplogs.SeverityNumber(v) } // Name returns the name associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) Name() string { return (*ms.orig).Name } // SetName replaces the name associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetName(v string) { (*ms.orig).Name = v } // Body returns the body associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) Body() AttributeValue { return newAttributeValue(&(*ms.orig).Body) } // Attributes returns the Attributes associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) } // DroppedAttributesCount returns the droppedattributescount associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) DroppedAttributesCount() uint32 { return (*ms.orig).DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this LogRecord. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms LogRecord) SetDroppedAttributesCount(v uint32) { (*ms.orig).DroppedAttributesCount = v } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_metrics.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_metrics.go index 9876ef292a0..fd675ee5284 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_metrics.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_metrics.go @@ -18,7 +18,7 @@ package pdata import ( - otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1" ) // ResourceMetricsSlice logically represents a slice of ResourceMetrics. @@ -157,21 +157,12 @@ func NewResourceMetrics() ResourceMetrics { return newResourceMetrics(&otlpmetrics.ResourceMetrics{}) } -// Deprecated: This function will be removed soon. -func (ms ResourceMetrics) InitEmpty() { - *ms.orig = otlpmetrics.ResourceMetrics{} -} - // Resource returns the resource associated with this ResourceMetrics. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceMetrics) Resource() Resource { return newResource(&(*ms.orig).Resource) } // InstrumentationLibraryMetrics returns the InstrumentationLibraryMetrics associated with this ResourceMetrics. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceMetrics) InstrumentationLibraryMetrics() InstrumentationLibraryMetricsSlice { return newInstrumentationLibraryMetricsSlice(&(*ms.orig).InstrumentationLibraryMetrics) } @@ -318,21 +309,12 @@ func NewInstrumentationLibraryMetrics() InstrumentationLibraryMetrics { return newInstrumentationLibraryMetrics(&otlpmetrics.InstrumentationLibraryMetrics{}) } -// Deprecated: This function will be removed soon. -func (ms InstrumentationLibraryMetrics) InitEmpty() { - *ms.orig = otlpmetrics.InstrumentationLibraryMetrics{} -} - // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibraryMetrics. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibraryMetrics) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) } // Metrics returns the Metrics associated with this InstrumentationLibraryMetrics. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibraryMetrics) Metrics() MetricSlice { return newMetricSlice(&(*ms.orig).Metrics) } @@ -458,7 +440,7 @@ func (es MetricSlice) Append(e Metric) { } // Metric represents one metric as a collection of datapoints. -// See Metric definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/master/opentelemetry/proto/metrics/v1/metrics.proto +// See Metric definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/metrics/v1/metrics.proto // // This is a reference type, if passed by value and callee modifies it the // caller will see the modification. @@ -480,49 +462,32 @@ func NewMetric() Metric { return newMetric(&otlpmetrics.Metric{}) } -// Deprecated: This function will be removed soon. -func (ms Metric) InitEmpty() { - *ms.orig = otlpmetrics.Metric{} -} - // Name returns the name associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) Name() string { return (*ms.orig).Name } // SetName replaces the name associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) SetName(v string) { (*ms.orig).Name = v } // Description returns the description associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) Description() string { return (*ms.orig).Description } // SetDescription replaces the description associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) SetDescription(v string) { (*ms.orig).Description = v } // Unit returns the unit associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) Unit() string { return (*ms.orig).Unit } // SetUnit replaces the unit associated with this Metric. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Metric) SetUnit(v string) { (*ms.orig).Unit = v } @@ -557,14 +522,7 @@ func NewIntGauge() IntGauge { return newIntGauge(&otlpmetrics.IntGauge{}) } -// Deprecated: This function will be removed soon. -func (ms IntGauge) InitEmpty() { - *ms.orig = otlpmetrics.IntGauge{} -} - // DataPoints returns the DataPoints associated with this IntGauge. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntGauge) DataPoints() IntDataPointSlice { return newIntDataPointSlice(&(*ms.orig).DataPoints) } @@ -596,14 +554,7 @@ func NewDoubleGauge() DoubleGauge { return newDoubleGauge(&otlpmetrics.DoubleGauge{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleGauge) InitEmpty() { - *ms.orig = otlpmetrics.DoubleGauge{} -} - // DataPoints returns the DataPoints associated with this DoubleGauge. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleGauge) DataPoints() DoubleDataPointSlice { return newDoubleDataPointSlice(&(*ms.orig).DataPoints) } @@ -635,42 +586,27 @@ func NewIntSum() IntSum { return newIntSum(&otlpmetrics.IntSum{}) } -// Deprecated: This function will be removed soon. -func (ms IntSum) InitEmpty() { - *ms.orig = otlpmetrics.IntSum{} -} - // AggregationTemporality returns the aggregationtemporality associated with this IntSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntSum) AggregationTemporality() AggregationTemporality { return AggregationTemporality((*ms.orig).AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this IntSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntSum) SetAggregationTemporality(v AggregationTemporality) { (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // IsMonotonic returns the ismonotonic associated with this IntSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntSum) IsMonotonic() bool { return (*ms.orig).IsMonotonic } // SetIsMonotonic replaces the ismonotonic associated with this IntSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntSum) SetIsMonotonic(v bool) { (*ms.orig).IsMonotonic = v } // DataPoints returns the DataPoints associated with this IntSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntSum) DataPoints() IntDataPointSlice { return newIntDataPointSlice(&(*ms.orig).DataPoints) } @@ -704,42 +640,27 @@ func NewDoubleSum() DoubleSum { return newDoubleSum(&otlpmetrics.DoubleSum{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleSum) InitEmpty() { - *ms.orig = otlpmetrics.DoubleSum{} -} - // AggregationTemporality returns the aggregationtemporality associated with this DoubleSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSum) AggregationTemporality() AggregationTemporality { return AggregationTemporality((*ms.orig).AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this DoubleSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSum) SetAggregationTemporality(v AggregationTemporality) { (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // IsMonotonic returns the ismonotonic associated with this DoubleSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSum) IsMonotonic() bool { return (*ms.orig).IsMonotonic } // SetIsMonotonic replaces the ismonotonic associated with this DoubleSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSum) SetIsMonotonic(v bool) { (*ms.orig).IsMonotonic = v } // DataPoints returns the DataPoints associated with this DoubleSum. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSum) DataPoints() DoubleDataPointSlice { return newDoubleDataPointSlice(&(*ms.orig).DataPoints) } @@ -773,28 +694,17 @@ func NewIntHistogram() IntHistogram { return newIntHistogram(&otlpmetrics.IntHistogram{}) } -// Deprecated: This function will be removed soon. -func (ms IntHistogram) InitEmpty() { - *ms.orig = otlpmetrics.IntHistogram{} -} - // AggregationTemporality returns the aggregationtemporality associated with this IntHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogram) AggregationTemporality() AggregationTemporality { return AggregationTemporality((*ms.orig).AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this IntHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogram) SetAggregationTemporality(v AggregationTemporality) { (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // DataPoints returns the DataPoints associated with this IntHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogram) DataPoints() IntHistogramDataPointSlice { return newIntHistogramDataPointSlice(&(*ms.orig).DataPoints) } @@ -827,28 +737,17 @@ func NewDoubleHistogram() DoubleHistogram { return newDoubleHistogram(&otlpmetrics.DoubleHistogram{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleHistogram) InitEmpty() { - *ms.orig = otlpmetrics.DoubleHistogram{} -} - // AggregationTemporality returns the aggregationtemporality associated with this DoubleHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogram) AggregationTemporality() AggregationTemporality { return AggregationTemporality((*ms.orig).AggregationTemporality) } // SetAggregationTemporality replaces the aggregationtemporality associated with this DoubleHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogram) SetAggregationTemporality(v AggregationTemporality) { (*ms.orig).AggregationTemporality = otlpmetrics.AggregationTemporality(v) } // DataPoints returns the DataPoints associated with this DoubleHistogram. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogram) DataPoints() DoubleHistogramDataPointSlice { return newDoubleHistogramDataPointSlice(&(*ms.orig).DataPoints) } @@ -881,14 +780,7 @@ func NewDoubleSummary() DoubleSummary { return newDoubleSummary(&otlpmetrics.DoubleSummary{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleSummary) InitEmpty() { - *ms.orig = otlpmetrics.DoubleSummary{} -} - // DataPoints returns the DataPoints associated with this DoubleSummary. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummary) DataPoints() DoubleSummaryDataPointSlice { return newDoubleSummaryDataPointSlice(&(*ms.orig).DataPoints) } @@ -1034,63 +926,42 @@ func NewIntDataPoint() IntDataPoint { return newIntDataPoint(&otlpmetrics.IntDataPoint{}) } -// Deprecated: This function will be removed soon. -func (ms IntDataPoint) InitEmpty() { - *ms.orig = otlpmetrics.IntDataPoint{} -} - // LabelsMap returns the Labels associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) LabelsMap() StringMap { return newStringMap(&(*ms.orig).Labels) } // StartTime returns the starttime associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Value returns the value associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) Value() int64 { return (*ms.orig).Value } // SetValue replaces the value associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) SetValue(v int64) { (*ms.orig).Value = v } // Exemplars returns the Exemplars associated with this IntDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntDataPoint) Exemplars() IntExemplarSlice { return newIntExemplarSlice(&(*ms.orig).Exemplars) } @@ -1240,63 +1111,42 @@ func NewDoubleDataPoint() DoubleDataPoint { return newDoubleDataPoint(&otlpmetrics.DoubleDataPoint{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleDataPoint) InitEmpty() { - *ms.orig = otlpmetrics.DoubleDataPoint{} -} - // LabelsMap returns the Labels associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) LabelsMap() StringMap { return newStringMap(&(*ms.orig).Labels) } // StartTime returns the starttime associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Value returns the value associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) Value() float64 { return (*ms.orig).Value } // SetValue replaces the value associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) SetValue(v float64) { (*ms.orig).Value = v } // Exemplars returns the Exemplars associated with this DoubleDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleDataPoint) Exemplars() DoubleExemplarSlice { return newDoubleExemplarSlice(&(*ms.orig).Exemplars) } @@ -1446,105 +1296,72 @@ func NewIntHistogramDataPoint() IntHistogramDataPoint { return newIntHistogramDataPoint(&otlpmetrics.IntHistogramDataPoint{}) } -// Deprecated: This function will be removed soon. -func (ms IntHistogramDataPoint) InitEmpty() { - *ms.orig = otlpmetrics.IntHistogramDataPoint{} -} - // LabelsMap returns the Labels associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) LabelsMap() StringMap { return newStringMap(&(*ms.orig).Labels) } // StartTime returns the starttime associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Count returns the count associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) Count() uint64 { return (*ms.orig).Count } // SetCount replaces the count associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetCount(v uint64) { (*ms.orig).Count = v } // Sum returns the sum associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) Sum() int64 { return (*ms.orig).Sum } // SetSum replaces the sum associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetSum(v int64) { (*ms.orig).Sum = v } // BucketCounts returns the bucketcounts associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) BucketCounts() []uint64 { return (*ms.orig).BucketCounts } // SetBucketCounts replaces the bucketcounts associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetBucketCounts(v []uint64) { (*ms.orig).BucketCounts = v } // ExplicitBounds returns the explicitbounds associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) ExplicitBounds() []float64 { return (*ms.orig).ExplicitBounds } // SetExplicitBounds replaces the explicitbounds associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) SetExplicitBounds(v []float64) { (*ms.orig).ExplicitBounds = v } // Exemplars returns the Exemplars associated with this IntHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntHistogramDataPoint) Exemplars() IntExemplarSlice { return newIntExemplarSlice(&(*ms.orig).Exemplars) } @@ -1697,105 +1514,72 @@ func NewDoubleHistogramDataPoint() DoubleHistogramDataPoint { return newDoubleHistogramDataPoint(&otlpmetrics.DoubleHistogramDataPoint{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleHistogramDataPoint) InitEmpty() { - *ms.orig = otlpmetrics.DoubleHistogramDataPoint{} -} - // LabelsMap returns the Labels associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) LabelsMap() StringMap { return newStringMap(&(*ms.orig).Labels) } // StartTime returns the starttime associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Count returns the count associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) Count() uint64 { return (*ms.orig).Count } // SetCount replaces the count associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetCount(v uint64) { (*ms.orig).Count = v } // Sum returns the sum associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) Sum() float64 { return (*ms.orig).Sum } // SetSum replaces the sum associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetSum(v float64) { (*ms.orig).Sum = v } // BucketCounts returns the bucketcounts associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) BucketCounts() []uint64 { return (*ms.orig).BucketCounts } // SetBucketCounts replaces the bucketcounts associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetBucketCounts(v []uint64) { (*ms.orig).BucketCounts = v } // ExplicitBounds returns the explicitbounds associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) ExplicitBounds() []float64 { return (*ms.orig).ExplicitBounds } // SetExplicitBounds replaces the explicitbounds associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) SetExplicitBounds(v []float64) { (*ms.orig).ExplicitBounds = v } // Exemplars returns the Exemplars associated with this DoubleHistogramDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleHistogramDataPoint) Exemplars() DoubleExemplarSlice { return newDoubleExemplarSlice(&(*ms.orig).Exemplars) } @@ -1948,77 +1732,52 @@ func NewDoubleSummaryDataPoint() DoubleSummaryDataPoint { return newDoubleSummaryDataPoint(&otlpmetrics.DoubleSummaryDataPoint{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleSummaryDataPoint) InitEmpty() { - *ms.orig = otlpmetrics.DoubleSummaryDataPoint{} -} - // LabelsMap returns the Labels associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) LabelsMap() StringMap { return newStringMap(&(*ms.orig).Labels) } // StartTime returns the starttime associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // Timestamp returns the timestamp associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Count returns the count associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) Count() uint64 { return (*ms.orig).Count } // SetCount replaces the count associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) SetCount(v uint64) { (*ms.orig).Count = v } // Sum returns the sum associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) Sum() float64 { return (*ms.orig).Sum } // SetSum replaces the sum associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) SetSum(v float64) { (*ms.orig).Sum = v } // QuantileValues returns the QuantileValues associated with this DoubleSummaryDataPoint. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleSummaryDataPoint) QuantileValues() ValueAtQuantileSlice { return newValueAtQuantileSlice(&(*ms.orig).QuantileValues) } @@ -2169,35 +1928,22 @@ func NewValueAtQuantile() ValueAtQuantile { return newValueAtQuantile(&otlpmetrics.DoubleSummaryDataPoint_ValueAtQuantile{}) } -// Deprecated: This function will be removed soon. -func (ms ValueAtQuantile) InitEmpty() { - *ms.orig = otlpmetrics.DoubleSummaryDataPoint_ValueAtQuantile{} -} - // Quantile returns the quantile associated with this ValueAtQuantile. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ValueAtQuantile) Quantile() float64 { return (*ms.orig).Quantile } // SetQuantile replaces the quantile associated with this ValueAtQuantile. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ValueAtQuantile) SetQuantile(v float64) { (*ms.orig).Quantile = v } // Value returns the value associated with this ValueAtQuantile. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ValueAtQuantile) Value() float64 { return (*ms.orig).Value } // SetValue replaces the value associated with this ValueAtQuantile. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ValueAtQuantile) SetValue(v float64) { (*ms.orig).Value = v } @@ -2218,17 +1964,17 @@ func (ms ValueAtQuantile) CopyTo(dest ValueAtQuantile) { type IntExemplarSlice struct { // orig points to the slice otlpmetrics.IntExemplar field contained somewhere else. // We use pointer-to-slice to be able to modify it in functions like Resize. - orig *[]*otlpmetrics.IntExemplar + orig *[]otlpmetrics.IntExemplar } -func newIntExemplarSlice(orig *[]*otlpmetrics.IntExemplar) IntExemplarSlice { +func newIntExemplarSlice(orig *[]otlpmetrics.IntExemplar) IntExemplarSlice { return IntExemplarSlice{orig} } // NewIntExemplarSlice creates a IntExemplarSlice with 0 elements. // Can use "Resize" to initialize with a given length. func NewIntExemplarSlice() IntExemplarSlice { - orig := []*otlpmetrics.IntExemplar(nil) + orig := []otlpmetrics.IntExemplar(nil) return IntExemplarSlice{&orig} } @@ -2247,7 +1993,7 @@ func (es IntExemplarSlice) Len() int { // ... // Do something with the element // } func (es IntExemplarSlice) At(ix int) IntExemplar { - return newIntExemplar((*es.orig)[ix]) + return newIntExemplar(&(*es.orig)[ix]) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. @@ -2268,18 +2014,13 @@ func (es IntExemplarSlice) CopyTo(dest IntExemplarSlice) { destCap := cap(*dest.orig) if srcLen <= destCap { (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newIntExemplar((*es.orig)[i]).CopyTo(newIntExemplar((*dest.orig)[i])) - } - return + } else { + (*dest.orig) = make([]otlpmetrics.IntExemplar, srcLen) } - origs := make([]otlpmetrics.IntExemplar, srcLen) - wrappers := make([]*otlpmetrics.IntExemplar, srcLen) + for i := range *es.orig { - wrappers[i] = &origs[i] - newIntExemplar((*es.orig)[i]).CopyTo(newIntExemplar(wrappers[i])) + newIntExemplar(&(*es.orig)[i]).CopyTo(newIntExemplar(&(*dest.orig)[i])) } - *dest.orig = wrappers } // Resize is an operation that resizes the slice: @@ -2302,15 +2043,15 @@ func (es IntExemplarSlice) Resize(newLen int) { } if newLen > oldCap { - newOrig := make([]*otlpmetrics.IntExemplar, oldLen, newLen) + newOrig := make([]otlpmetrics.IntExemplar, oldLen, newLen) copy(newOrig, *es.orig) *es.orig = newOrig } // Add extra empty elements to the array. - extraOrigs := make([]otlpmetrics.IntExemplar, newLen-oldLen) - for i := range extraOrigs { - *es.orig = append(*es.orig, &extraOrigs[i]) + empty := otlpmetrics.IntExemplar{} + for i := oldLen; i < newLen; i++ { + *es.orig = append(*es.orig, empty) } } @@ -2319,7 +2060,7 @@ func (es IntExemplarSlice) Resize(newLen int) { // could still be referenced so do not reuse it after passing it to this // method. func (es IntExemplarSlice) Append(e IntExemplar) { - *es.orig = append(*es.orig, e.orig) + *es.orig = append(*es.orig, *e.orig) } // IntExemplar is a sample input int measurement. @@ -2347,42 +2088,27 @@ func NewIntExemplar() IntExemplar { return newIntExemplar(&otlpmetrics.IntExemplar{}) } -// Deprecated: This function will be removed soon. -func (ms IntExemplar) InitEmpty() { - *ms.orig = otlpmetrics.IntExemplar{} -} - // Timestamp returns the timestamp associated with this IntExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntExemplar) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this IntExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntExemplar) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Value returns the value associated with this IntExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntExemplar) Value() int64 { return (*ms.orig).Value } // SetValue replaces the value associated with this IntExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntExemplar) SetValue(v int64) { (*ms.orig).Value = v } // FilteredLabels returns the FilteredLabels associated with this IntExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms IntExemplar) FilteredLabels() StringMap { return newStringMap(&(*ms.orig).FilteredLabels) } @@ -2404,17 +2130,17 @@ func (ms IntExemplar) CopyTo(dest IntExemplar) { type DoubleExemplarSlice struct { // orig points to the slice otlpmetrics.DoubleExemplar field contained somewhere else. // We use pointer-to-slice to be able to modify it in functions like Resize. - orig *[]*otlpmetrics.DoubleExemplar + orig *[]otlpmetrics.DoubleExemplar } -func newDoubleExemplarSlice(orig *[]*otlpmetrics.DoubleExemplar) DoubleExemplarSlice { +func newDoubleExemplarSlice(orig *[]otlpmetrics.DoubleExemplar) DoubleExemplarSlice { return DoubleExemplarSlice{orig} } // NewDoubleExemplarSlice creates a DoubleExemplarSlice with 0 elements. // Can use "Resize" to initialize with a given length. func NewDoubleExemplarSlice() DoubleExemplarSlice { - orig := []*otlpmetrics.DoubleExemplar(nil) + orig := []otlpmetrics.DoubleExemplar(nil) return DoubleExemplarSlice{&orig} } @@ -2433,7 +2159,7 @@ func (es DoubleExemplarSlice) Len() int { // ... // Do something with the element // } func (es DoubleExemplarSlice) At(ix int) DoubleExemplar { - return newDoubleExemplar((*es.orig)[ix]) + return newDoubleExemplar(&(*es.orig)[ix]) } // MoveAndAppendTo moves all elements from the current slice and appends them to the dest. @@ -2454,18 +2180,13 @@ func (es DoubleExemplarSlice) CopyTo(dest DoubleExemplarSlice) { destCap := cap(*dest.orig) if srcLen <= destCap { (*dest.orig) = (*dest.orig)[:srcLen:destCap] - for i := range *es.orig { - newDoubleExemplar((*es.orig)[i]).CopyTo(newDoubleExemplar((*dest.orig)[i])) - } - return + } else { + (*dest.orig) = make([]otlpmetrics.DoubleExemplar, srcLen) } - origs := make([]otlpmetrics.DoubleExemplar, srcLen) - wrappers := make([]*otlpmetrics.DoubleExemplar, srcLen) + for i := range *es.orig { - wrappers[i] = &origs[i] - newDoubleExemplar((*es.orig)[i]).CopyTo(newDoubleExemplar(wrappers[i])) + newDoubleExemplar(&(*es.orig)[i]).CopyTo(newDoubleExemplar(&(*dest.orig)[i])) } - *dest.orig = wrappers } // Resize is an operation that resizes the slice: @@ -2488,15 +2209,15 @@ func (es DoubleExemplarSlice) Resize(newLen int) { } if newLen > oldCap { - newOrig := make([]*otlpmetrics.DoubleExemplar, oldLen, newLen) + newOrig := make([]otlpmetrics.DoubleExemplar, oldLen, newLen) copy(newOrig, *es.orig) *es.orig = newOrig } // Add extra empty elements to the array. - extraOrigs := make([]otlpmetrics.DoubleExemplar, newLen-oldLen) - for i := range extraOrigs { - *es.orig = append(*es.orig, &extraOrigs[i]) + empty := otlpmetrics.DoubleExemplar{} + for i := oldLen; i < newLen; i++ { + *es.orig = append(*es.orig, empty) } } @@ -2505,7 +2226,7 @@ func (es DoubleExemplarSlice) Resize(newLen int) { // could still be referenced so do not reuse it after passing it to this // method. func (es DoubleExemplarSlice) Append(e DoubleExemplar) { - *es.orig = append(*es.orig, e.orig) + *es.orig = append(*es.orig, *e.orig) } // DoubleExemplar is a sample input double measurement. @@ -2533,42 +2254,27 @@ func NewDoubleExemplar() DoubleExemplar { return newDoubleExemplar(&otlpmetrics.DoubleExemplar{}) } -// Deprecated: This function will be removed soon. -func (ms DoubleExemplar) InitEmpty() { - *ms.orig = otlpmetrics.DoubleExemplar{} -} - // Timestamp returns the timestamp associated with this DoubleExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleExemplar) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this DoubleExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleExemplar) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Value returns the value associated with this DoubleExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleExemplar) Value() float64 { return (*ms.orig).Value } // SetValue replaces the value associated with this DoubleExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleExemplar) SetValue(v float64) { (*ms.orig).Value = v } // FilteredLabels returns the FilteredLabels associated with this DoubleExemplar. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms DoubleExemplar) FilteredLabels() StringMap { return newStringMap(&(*ms.orig).FilteredLabels) } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_resource.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_resource.go index e8e7e75bc53..9e4f2cb3fd0 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_resource.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_resource.go @@ -18,7 +18,7 @@ package pdata import ( - otlpresource "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1" + otlpresource "go.opentelemetry.io/collector/internal/data/protogen/resource/v1" ) // Resource information. @@ -43,14 +43,7 @@ func NewResource() Resource { return newResource(&otlpresource.Resource{}) } -// Deprecated: This function will be removed soon. -func (ms Resource) InitEmpty() { - *ms.orig = otlpresource.Resource{} -} - // Attributes returns the Attributes associated with this Resource. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Resource) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_trace.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_trace.go index 89bd861839f..2e813dfe277 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_trace.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/generated_trace.go @@ -19,7 +19,7 @@ package pdata import ( "go.opentelemetry.io/collector/internal/data" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1" ) // ResourceSpansSlice logically represents a slice of ResourceSpans. @@ -158,21 +158,12 @@ func NewResourceSpans() ResourceSpans { return newResourceSpans(&otlptrace.ResourceSpans{}) } -// Deprecated: This function will be removed soon. -func (ms ResourceSpans) InitEmpty() { - *ms.orig = otlptrace.ResourceSpans{} -} - // Resource returns the resource associated with this ResourceSpans. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceSpans) Resource() Resource { return newResource(&(*ms.orig).Resource) } // InstrumentationLibrarySpans returns the InstrumentationLibrarySpans associated with this ResourceSpans. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms ResourceSpans) InstrumentationLibrarySpans() InstrumentationLibrarySpansSlice { return newInstrumentationLibrarySpansSlice(&(*ms.orig).InstrumentationLibrarySpans) } @@ -319,21 +310,12 @@ func NewInstrumentationLibrarySpans() InstrumentationLibrarySpans { return newInstrumentationLibrarySpans(&otlptrace.InstrumentationLibrarySpans{}) } -// Deprecated: This function will be removed soon. -func (ms InstrumentationLibrarySpans) InitEmpty() { - *ms.orig = otlptrace.InstrumentationLibrarySpans{} -} - // InstrumentationLibrary returns the instrumentationlibrary associated with this InstrumentationLibrarySpans. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrarySpans) InstrumentationLibrary() InstrumentationLibrary { return newInstrumentationLibrary(&(*ms.orig).InstrumentationLibrary) } // Spans returns the Spans associated with this InstrumentationLibrarySpans. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms InstrumentationLibrarySpans) Spans() SpanSlice { return newSpanSlice(&(*ms.orig).Spans) } @@ -459,7 +441,7 @@ func (es SpanSlice) Append(e Span) { } // Span represents a single operation within a trace. -// See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/master/opentelemetry/proto/trace/v1/trace.proto#L37 +// See Span definition in OTLP: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto#L37 // // This is a reference type, if passed by value and callee modifies it the // caller will see the modification. @@ -481,192 +463,132 @@ func NewSpan() Span { return newSpan(&otlptrace.Span{}) } -// Deprecated: This function will be removed soon. -func (ms Span) InitEmpty() { - *ms.orig = otlptrace.Span{} -} - // TraceID returns the traceid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) TraceID() TraceID { return TraceID((*ms.orig).TraceId) } // SetTraceID replaces the traceid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetTraceID(v TraceID) { (*ms.orig).TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SpanID() SpanID { return SpanID((*ms.orig).SpanId) } // SetSpanID replaces the spanid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetSpanID(v SpanID) { (*ms.orig).SpanId = data.SpanID(v) } // TraceState returns the tracestate associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) TraceState() TraceState { return TraceState((*ms.orig).TraceState) } // SetTraceState replaces the tracestate associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetTraceState(v TraceState) { (*ms.orig).TraceState = string(v) } // ParentSpanID returns the parentspanid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) ParentSpanID() SpanID { return SpanID((*ms.orig).ParentSpanId) } // SetParentSpanID replaces the parentspanid associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetParentSpanID(v SpanID) { (*ms.orig).ParentSpanId = data.SpanID(v) } // Name returns the name associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Name() string { return (*ms.orig).Name } // SetName replaces the name associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetName(v string) { (*ms.orig).Name = v } // Kind returns the kind associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Kind() SpanKind { return SpanKind((*ms.orig).Kind) } // SetKind replaces the kind associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetKind(v SpanKind) { (*ms.orig).Kind = otlptrace.Span_SpanKind(v) } // StartTime returns the starttime associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) StartTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).StartTimeUnixNano) } // SetStartTime replaces the starttime associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetStartTime(v TimestampUnixNano) { (*ms.orig).StartTimeUnixNano = uint64(v) } // EndTime returns the endtime associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) EndTime() TimestampUnixNano { return TimestampUnixNano((*ms.orig).EndTimeUnixNano) } // SetEndTime replaces the endtime associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetEndTime(v TimestampUnixNano) { (*ms.orig).EndTimeUnixNano = uint64(v) } // Attributes returns the Attributes associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) } // DroppedAttributesCount returns the droppedattributescount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) DroppedAttributesCount() uint32 { return (*ms.orig).DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetDroppedAttributesCount(v uint32) { (*ms.orig).DroppedAttributesCount = v } // Events returns the Events associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Events() SpanEventSlice { return newSpanEventSlice(&(*ms.orig).Events) } // DroppedEventsCount returns the droppedeventscount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) DroppedEventsCount() uint32 { return (*ms.orig).DroppedEventsCount } // SetDroppedEventsCount replaces the droppedeventscount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetDroppedEventsCount(v uint32) { (*ms.orig).DroppedEventsCount = v } // Links returns the Links associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Links() SpanLinkSlice { return newSpanLinkSlice(&(*ms.orig).Links) } // DroppedLinksCount returns the droppedlinkscount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) DroppedLinksCount() uint32 { return (*ms.orig).DroppedLinksCount } // SetDroppedLinksCount replaces the droppedlinkscount associated with this Span. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) SetDroppedLinksCount(v uint32) { (*ms.orig).DroppedLinksCount = v } // Status returns the status associated with this Span. -// If no status available, it creates an empty message and associates it with this Span. -// -// Empty initialized Span will return "nil" SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms Span) Status() SpanStatus { return newSpanStatus(&(*ms.orig).Status) } @@ -827,56 +749,37 @@ func NewSpanEvent() SpanEvent { return newSpanEvent(&otlptrace.Span_Event{}) } -// Deprecated: This function will be removed soon. -func (ms SpanEvent) InitEmpty() { - *ms.orig = otlptrace.Span_Event{} -} - // Timestamp returns the timestamp associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) Timestamp() TimestampUnixNano { return TimestampUnixNano((*ms.orig).TimeUnixNano) } // SetTimestamp replaces the timestamp associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) SetTimestamp(v TimestampUnixNano) { (*ms.orig).TimeUnixNano = uint64(v) } // Name returns the name associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) Name() string { return (*ms.orig).Name } // SetName replaces the name associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) SetName(v string) { (*ms.orig).Name = v } // Attributes returns the Attributes associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) } // DroppedAttributesCount returns the droppedattributescount associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) DroppedAttributesCount() uint32 { return (*ms.orig).DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanEvent. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanEvent) SetDroppedAttributesCount(v uint32) { (*ms.orig).DroppedAttributesCount = v } @@ -1026,70 +929,47 @@ func NewSpanLink() SpanLink { return newSpanLink(&otlptrace.Span_Link{}) } -// Deprecated: This function will be removed soon. -func (ms SpanLink) InitEmpty() { - *ms.orig = otlptrace.Span_Link{} -} - // TraceID returns the traceid associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) TraceID() TraceID { return TraceID((*ms.orig).TraceId) } // SetTraceID replaces the traceid associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) SetTraceID(v TraceID) { (*ms.orig).TraceId = data.TraceID(v) } // SpanID returns the spanid associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) SpanID() SpanID { return SpanID((*ms.orig).SpanId) } // SetSpanID replaces the spanid associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) SetSpanID(v SpanID) { (*ms.orig).SpanId = data.SpanID(v) } // TraceState returns the tracestate associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) TraceState() TraceState { return TraceState((*ms.orig).TraceState) } // SetTraceState replaces the tracestate associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) SetTraceState(v TraceState) { (*ms.orig).TraceState = string(v) } // Attributes returns the Attributes associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) Attributes() AttributeMap { return newAttributeMap(&(*ms.orig).Attributes) } // DroppedAttributesCount returns the droppedattributescount associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) DroppedAttributesCount() uint32 { return (*ms.orig).DroppedAttributesCount } // SetDroppedAttributesCount replaces the droppedattributescount associated with this SpanLink. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanLink) SetDroppedAttributesCount(v uint32) { (*ms.orig).DroppedAttributesCount = v } @@ -1112,81 +992,37 @@ func (ms SpanLink) CopyTo(dest SpanLink) { // Must use NewSpanStatus function to create new instances. // Important: zero-initialized instance is not valid for use. type SpanStatus struct { - // orig points to the pointer otlptrace.Status field contained somewhere else. - // We use pointer-to-pointer to be able to modify it in InitEmpty func. - orig **otlptrace.Status + orig *otlptrace.Status } -func newSpanStatus(orig **otlptrace.Status) SpanStatus { - return SpanStatus{orig} +func newSpanStatus(orig *otlptrace.Status) SpanStatus { + return SpanStatus{orig: orig} } -// NewSpanStatus creates a new "nil" SpanStatus. -// To initialize the struct call "InitEmpty". +// NewSpanStatus creates a new empty SpanStatus. // // This must be used only in testing code since no "Set" method available. func NewSpanStatus() SpanStatus { - orig := (*otlptrace.Status)(nil) - return newSpanStatus(&orig) -} - -// InitEmpty overwrites the current value with empty. -func (ms SpanStatus) InitEmpty() { - *ms.orig = &otlptrace.Status{} -} - -// IsNil returns true if the underlying data are nil. -// -// Important: All other functions will cause a runtime error if this returns "true". -func (ms SpanStatus) IsNil() bool { - return *ms.orig == nil + return newSpanStatus(&otlptrace.Status{}) } // Code returns the code associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanStatus) Code() StatusCode { return StatusCode((*ms.orig).Code) } -// DeprecatedCode returns the deprecatedcode associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". -func (ms SpanStatus) DeprecatedCode() DeprecatedStatusCode { - return DeprecatedStatusCode((*ms.orig).DeprecatedCode) -} - -// SetDeprecatedCode replaces the deprecatedcode associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". -func (ms SpanStatus) SetDeprecatedCode(v DeprecatedStatusCode) { - (*ms.orig).DeprecatedCode = otlptrace.Status_DeprecatedStatusCode(v) -} - // Message returns the message associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanStatus) Message() string { return (*ms.orig).Message } // SetMessage replaces the message associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanStatus) SetMessage(v string) { (*ms.orig).Message = v } // CopyTo copies all properties from the current struct to the dest. func (ms SpanStatus) CopyTo(dest SpanStatus) { - if ms.IsNil() { - *dest.orig = nil - return - } - if dest.IsNil() { - dest.InitEmpty() - } dest.SetCode(ms.Code()) - dest.SetDeprecatedCode(ms.DeprecatedCode()) dest.SetMessage(ms.Message()) } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/log.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/log.go index fef6a4f2aa0..958e0cded23 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/log.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/log.go @@ -16,8 +16,8 @@ package pdata import ( "go.opentelemetry.io/collector/internal" - otlpcollectorlog "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1" - otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1" + otlpcollectorlog "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1" + otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1" ) // This file defines in-memory data structures to represent logs. diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/metric.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/metric.go index d415c9f2001..89864aab23a 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/metric.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/metric.go @@ -15,8 +15,8 @@ package pdata import ( - otlpcollectormetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1" - otlpmetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1" + otlpcollectormetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1" + otlpmetrics "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1" ) type AggregationTemporality otlpmetrics.AggregationTemporality @@ -40,18 +40,18 @@ type Metrics struct { orig *[]*otlpmetrics.ResourceMetrics } -// NewMetricData creates a new MetricData. +// NewMetrics creates a new Metrics. func NewMetrics() Metrics { orig := []*otlpmetrics.ResourceMetrics(nil) return Metrics{&orig} } -// MetricDataFromOtlp creates the internal MetricData representation from the OTLP. +// MetricsFromOtlp creates the internal Metrics representation from the OTLP. func MetricsFromOtlp(orig []*otlpmetrics.ResourceMetrics) Metrics { return Metrics{&orig} } -// MetricDataToOtlp converts the internal MetricData to the OTLP. +// MetricsToOtlp converts the internal Metrics to the OTLP. func MetricsToOtlp(md Metrics) []*otlpmetrics.ResourceMetrics { return *md.orig } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/spanid.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/spanid.go index 52a35a1bfdd..748c96a9d6b 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/spanid.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/spanid.go @@ -39,7 +39,7 @@ func (t SpanID) HexString() string { return data.SpanID(t).HexString() } -// IsValid returns true if id contains at leas one non-zero byte. -func (t SpanID) IsValid() bool { - return data.SpanID(t).IsValid() +// IsEmpty returns true if id doesn't contain at least one non-zero byte. +func (t SpanID) IsEmpty() bool { + return data.SpanID(t).IsEmpty() } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/trace.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/trace.go index a6c8edef734..a26fa18a7fb 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/trace.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/trace.go @@ -15,15 +15,13 @@ package pdata import ( - otlpcollectortrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1" + otlpcollectortrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1" ) // This file defines in-memory data structures to represent traces (spans). // Traces is the top-level struct that is propagated through the traces pipeline. -// This is the newer version of consumerdata.Traces, but uses more efficient -// in-memory representation. type Traces struct { orig *[]*otlptrace.ResourceSpans } @@ -123,37 +121,8 @@ const ( SpanKindCONSUMER = SpanKind(otlptrace.Span_SPAN_KIND_CONSUMER) ) -// DeprecatedStatusCode is the deprecated status code used previously. -// https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-status -// Deprecated: use StatusCode instead. -type DeprecatedStatusCode otlptrace.Status_DeprecatedStatusCode - -const ( - DeprecatedStatusCodeOk = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_OK) - DeprecatedStatusCodeCancelled = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_CANCELLED) - DeprecatedStatusCodeUnknownError = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_UNKNOWN_ERROR) - DeprecatedStatusCodeInvalidArgument = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_INVALID_ARGUMENT) - DeprecatedStatusCodeDeadlineExceeded = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED) - DeprecatedStatusCodeNotFound = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_NOT_FOUND) - DeprecatedStatusCodeAlreadyExists = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_ALREADY_EXISTS) - DeprecatedStatusCodePermissionDenied = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_PERMISSION_DENIED) - DeprecatedStatusCodeResourceExhausted = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED) - DeprecatedStatusCodeFailedPrecondition = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_FAILED_PRECONDITION) - DeprecatedStatusCodeAborted = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_ABORTED) - DeprecatedStatusCodeOutOfRange = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_OUT_OF_RANGE) - DeprecatedStatusCodeUnimplemented = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_UNIMPLEMENTED) - DeprecatedStatusCodeInternalError = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_INTERNAL_ERROR) - DeprecatedStatusCodeUnavailable = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_UNAVAILABLE) - DeprecatedStatusCodeDataLoss = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_DATA_LOSS) - DeprecatedStatusCodeUnauthenticated = DeprecatedStatusCode(otlptrace.Status_DEPRECATED_STATUS_CODE_UNAUTHENTICATED) -) - -func (sc DeprecatedStatusCode) String() string { - return otlptrace.Status_DeprecatedStatusCode(sc).String() -} - // StatusCode mirrors the codes defined at -// https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#set-status +// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status type StatusCode otlptrace.Status_StatusCode const ( @@ -165,26 +134,15 @@ const ( func (sc StatusCode) String() string { return otlptrace.Status_StatusCode(sc).String() } // SetCode replaces the code associated with this SpanStatus. -// -// Important: This causes a runtime error if IsNil() returns "true". func (ms SpanStatus) SetCode(v StatusCode) { - (*ms.orig).Code = otlptrace.Status_StatusCode(v) - - // According to OTLP spec we also need to set the deprecated_code field. - // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L231 - // - // if code==STATUS_CODE_UNSET then `deprecated_code` MUST be - // set to DEPRECATED_STATUS_CODE_OK. - // - // if code==STATUS_CODE_OK then `deprecated_code` MUST be - // set to DEPRECATED_STATUS_CODE_OK. - // - // if code==STATUS_CODE_ERROR then `deprecated_code` MUST be - // set to DEPRECATED_STATUS_CODE_UNKNOWN_ERROR. + ms.orig.Code = otlptrace.Status_StatusCode(v) + + // According to OTLP spec we also need to set the deprecated_code field as we are a new sender: + // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239 switch v { case StatusCodeUnset, StatusCodeOk: - ms.SetDeprecatedCode(DeprecatedStatusCodeOk) + ms.orig.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_OK case StatusCodeError: - ms.SetDeprecatedCode(DeprecatedStatusCodeUnknownError) + ms.orig.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_UNKNOWN_ERROR } } diff --git a/vendor/go.opentelemetry.io/collector/consumer/pdata/traceid.go b/vendor/go.opentelemetry.io/collector/consumer/pdata/traceid.go index d374499a3d0..3ec8276c455 100644 --- a/vendor/go.opentelemetry.io/collector/consumer/pdata/traceid.go +++ b/vendor/go.opentelemetry.io/collector/consumer/pdata/traceid.go @@ -39,7 +39,7 @@ func (t TraceID) HexString() string { return data.TraceID(t).HexString() } -// IsValid returns true if id contains at leas one non-zero byte. -func (t TraceID) IsValid() bool { - return data.TraceID(t).IsValid() +// IsEmpty returns true if id doesn't contain at least one non-zero byte. +func (t TraceID) IsEmpty() bool { + return data.TraceID(t).IsEmpty() } diff --git a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/README.md b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/README.md index b75fcbfe63a..2575515001c 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/README.md +++ b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/README.md @@ -19,6 +19,10 @@ The following settings can be optionally configured: - `plain_text` - `username`: The username to use. - `password`: The password to use + - `sasl` + - `username`: The username to use. + - `password`: The password to use + - `mechanism`: The sasl mechanism to use (SCRAM-SHA-256, SCRAM-SHA-512 or PLAIN) - `tls` - `ca_file`: path to the CA cert. For a client this verifies the server certificate. Should only be used if `insecure` is set to true. diff --git a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/authentication.go b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/authentication.go index ad723b4696b..4096e2043dd 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/authentication.go +++ b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/authentication.go @@ -15,6 +15,8 @@ package kafkaexporter import ( + "crypto/sha256" + "crypto/sha512" "fmt" "github.com/Shopify/sarama" @@ -25,6 +27,7 @@ import ( // Authentication defines authentication. type Authentication struct { PlainText *PlainTextConfig `mapstructure:"plain_text"` + SASL *SASLConfig `mapstructure:"sasl"` TLS *configtls.TLSClientSetting `mapstructure:"tls"` Kerberos *KerberosConfig `mapstructure:"kerberos"` } @@ -35,6 +38,16 @@ type PlainTextConfig struct { Password string `mapstructure:"password"` } +// SASLConfig defines the configuration for the SASL authentication. +type SASLConfig struct { + // Username to be used on authentication + Username string `mapstructure:"username"` + // Password to be used on authentication + Password string `mapstructure:"password"` + // SASL Mechanism to be used, possible values are: (PLAIN, SCRAM-SHA-256 or SCRAM-SHA-512). + Mechanism string `mapstructure:"mechanism"` +} + // KerberosConfig defines kereros configuration. type KerberosConfig struct { ServiceName string `mapstructure:"service_name"` @@ -56,6 +69,12 @@ func ConfigureAuthentication(config Authentication, saramaConfig *sarama.Config) return err } } + if config.SASL != nil { + if err := configureSASL(*config.SASL, saramaConfig); err != nil { + return err + } + } + if config.Kerberos != nil { configureKerberos(*config.Kerberos, saramaConfig) } @@ -68,6 +87,36 @@ func configurePlaintext(config PlainTextConfig, saramaConfig *sarama.Config) { saramaConfig.Net.SASL.Password = config.Password } +func configureSASL(config SASLConfig, saramaConfig *sarama.Config) error { + + if config.Username == "" { + return fmt.Errorf("username have to be provided") + } + + if config.Password == "" { + return fmt.Errorf("password have to be provided") + } + + saramaConfig.Net.SASL.Enable = true + saramaConfig.Net.SASL.User = config.Username + saramaConfig.Net.SASL.Password = config.Password + + switch config.Mechanism { + case "SCRAM-SHA-512": + saramaConfig.Net.SASL.SCRAMClientGeneratorFunc = func() sarama.SCRAMClient { return &XDGSCRAMClient{HashGeneratorFcn: sha512.New} } + saramaConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA512 + case "SCRAM-SHA-256": + saramaConfig.Net.SASL.SCRAMClientGeneratorFunc = func() sarama.SCRAMClient { return &XDGSCRAMClient{HashGeneratorFcn: sha256.New} } + saramaConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA256 + case "PLAIN": + saramaConfig.Net.SASL.Mechanism = sarama.SASLTypePlaintext + default: + return fmt.Errorf("invalid SASL Mechanism %q: can be either \"PLAIN\" , \"SCRAM-SHA-256\" or \"SCRAM-SHA-512\"", config.Mechanism) + } + + return nil +} + func configureTLS(config configtls.TLSClientSetting, saramaConfig *sarama.Config) error { tlsConfig, err := config.LoadTLSConfig() if err != nil { diff --git a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/jaeger_marshaller.go b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/jaeger_marshaller.go index 10d2fc1dad3..473bafc91a5 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/jaeger_marshaller.go +++ b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/jaeger_marshaller.go @@ -20,7 +20,7 @@ import ( "github.com/gogo/protobuf/jsonpb" jaegerproto "github.com/jaegertracing/jaeger/model" - "go.opentelemetry.io/collector/component/componenterror" + "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/pdata" jaegertranslator "go.opentelemetry.io/collector/translator/trace/jaeger" ) @@ -50,7 +50,7 @@ func (j jaegerMarshaller) Marshal(traces pdata.Traces) ([]Message, error) { messages = append(messages, Message{Value: bts}) } } - return messages, componenterror.CombineErrors(errs) + return messages, consumererror.CombineErrors(errs) } func (j jaegerMarshaller) Encoding() string { diff --git a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/otlp_marshaller.go b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/otlp_marshaller.go index 29232fa2946..e5d01b459f8 100644 --- a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/otlp_marshaller.go +++ b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/otlp_marshaller.go @@ -16,8 +16,8 @@ package kafkaexporter import ( "go.opentelemetry.io/collector/consumer/pdata" - otlpmetric "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1" + otlpmetric "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1" ) var _ TracesMarshaller = (*otlpTracesPbMarshaller)(nil) diff --git a/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/scram_client.go b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/scram_client.go new file mode 100644 index 00000000000..811feaab35b --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/exporter/kafkaexporter/scram_client.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package kafkaexporter + +import ( + "github.com/Shopify/sarama" + "github.com/xdg-go/scram" +) + +var _ sarama.SCRAMClient = (*XDGSCRAMClient)(nil) + +// XDGSCRAMClient uses xdg-go scram to authentication conversation +type XDGSCRAMClient struct { + *scram.Client + *scram.ClientConversation + scram.HashGeneratorFcn +} + +func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) { + x.Client, err = x.HashGeneratorFcn.NewClient(userName, password, authzID) + if err != nil { + return err + } + x.ClientConversation = x.Client.NewConversation() + return nil +} + +func (x *XDGSCRAMClient) Step(challenge string) (response string, err error) { + return x.ClientConversation.Step(challenge) + +} + +func (x *XDGSCRAMClient) Done() bool { + return x.ClientConversation.Done() +} diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.go similarity index 96% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.go index 722bec013b6..ccf286ef470 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.go @@ -16,7 +16,7 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/logs/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -125,7 +125,7 @@ func init() { } var fileDescriptor_8e3bf87aaa43acd4 = []byte{ - // 303 bytes of a gzipped FileDescriptorProto + // 299 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0xc8, 0x2f, 0x48, 0xcd, 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0xcf, 0xc9, 0x4f, 0x2f, 0xd6, 0x2f, @@ -138,13 +138,13 @@ var fileDescriptor_8e3bf87aaa43acd4 = []byte{ 0x53, 0x0f, 0x9b, 0xc3, 0xa0, 0xce, 0xd1, 0x0b, 0x82, 0xea, 0x00, 0x99, 0x17, 0xc4, 0x53, 0x84, 0xc4, 0x53, 0x92, 0xe6, 0x92, 0xc4, 0x62, 0x57, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0xaa, 0xd1, 0x5c, 0x46, 0x2e, 0x6e, 0x24, 0x71, 0xa1, 0x5e, 0x46, 0x2e, 0x36, 0x88, 0x6a, 0x21, 0x7b, 0x3d, 0xa2, - 0x42, 0x42, 0x0f, 0x97, 0x47, 0xa4, 0x1c, 0xc8, 0x37, 0x00, 0xe2, 0x3a, 0x25, 0x06, 0xa7, 0xb5, + 0x42, 0x42, 0x0f, 0x97, 0x47, 0xa4, 0x1c, 0xc8, 0x37, 0x00, 0xe2, 0x3a, 0x25, 0x06, 0xa7, 0x79, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0xc0, 0xa5, 0x91, 0x99, 0x4f, 0x9c, - 0x05, 0x4e, 0x02, 0x48, 0x66, 0x07, 0x80, 0xd4, 0x04, 0x30, 0x46, 0x85, 0xa6, 0xa3, 0xeb, 0xce, + 0x05, 0x4e, 0x02, 0x48, 0x66, 0x07, 0x80, 0xd4, 0x04, 0x30, 0x46, 0xb9, 0xa5, 0xa3, 0xeb, 0xce, 0x44, 0x4e, 0x20, 0x99, 0x79, 0x25, 0xa9, 0x45, 0x79, 0x89, 0x39, 0xfa, 0x29, 0x89, 0x25, 0x89, - 0xfa, 0x28, 0x0a, 0x75, 0xc1, 0xd6, 0xe8, 0xa6, 0xa7, 0xe6, 0x61, 0x26, 0xa8, 0x24, 0x36, 0xb0, - 0xa4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x73, 0x09, 0x94, 0xaf, 0x80, 0x02, 0x00, 0x00, + 0x90, 0x78, 0x4c, 0x4f, 0xcd, 0xc3, 0x4c, 0x41, 0x49, 0x6c, 0x60, 0x39, 0x63, 0x40, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xaa, 0x3c, 0xaf, 0xaf, 0x71, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -401,10 +401,7 @@ func (m *ExportLogsServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogsService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogsService } if (iNdEx + skippy) > l { @@ -454,10 +451,7 @@ func (m *ExportLogsServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogsService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogsService } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.gw.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.gw.go similarity index 93% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.gw.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.gw.go index 8003733add0..b40b49905fa 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.gw.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1/logs_service.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_LogsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client LogsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ExportLogsServiceRequest @@ -68,11 +70,14 @@ func local_request_LogsService_Export_0(ctx context.Context, marshaler runtime.M // RegisterLogsServiceHandlerServer registers the http handlers for service LogsService to "mux". // UnaryRPC :call LogsServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterLogsServiceHandlerFromEndpoint instead. func RegisterLogsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LogsServiceServer) error { mux.Handle("POST", pattern_LogsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -80,6 +85,7 @@ func RegisterLogsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_LogsService_Export_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go similarity index 96% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go index b0a984f1139..e193ca32a6a 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.go @@ -16,7 +16,7 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/metrics/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -125,7 +125,7 @@ func init() { } var fileDescriptor_75fb6015e6e64798 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto + // 299 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0xcb, 0x2f, 0x48, 0xcd, 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0x07, 0x89, 0x66, 0x26, 0x17, 0xeb, @@ -138,13 +138,13 @@ var fileDescriptor_75fb6015e6e64798 = []byte{ 0x5f, 0x0f, 0x9b, 0x3b, 0x11, 0xae, 0xd3, 0x0b, 0x82, 0xea, 0x83, 0x1a, 0x1c, 0xc4, 0x5f, 0x84, 0x2a, 0xa0, 0x24, 0xc7, 0x25, 0x83, 0xdd, 0xea, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa3, 0x35, 0x8c, 0x5c, 0x7c, 0xa8, 0x52, 0x42, 0x33, 0x19, 0xb9, 0xd8, 0x20, 0x7a, 0x84, 0x5c, 0xf5, 0x88, - 0x0d, 0x27, 0x3d, 0x3c, 0x1e, 0x94, 0x72, 0xa3, 0xd4, 0x18, 0x88, 0x63, 0x95, 0x18, 0x9c, 0xb6, - 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0x0d, 0x27, 0x3d, 0x3c, 0x1e, 0x94, 0x72, 0xa3, 0xd4, 0x18, 0x88, 0x63, 0x95, 0x18, 0x9c, 0x96, + 0x33, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x76, 0x66, 0x3e, 0xd1, - 0xd6, 0x38, 0x09, 0xa3, 0xda, 0x10, 0x00, 0x52, 0x19, 0xc0, 0x18, 0x15, 0x91, 0x8e, 0x6e, 0x46, + 0xd6, 0x38, 0x09, 0xa3, 0xda, 0x10, 0x00, 0x52, 0x19, 0xc0, 0x18, 0xe5, 0x99, 0x8e, 0x6e, 0x46, 0x26, 0x72, 0xb2, 0xca, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b, 0xcc, 0xd1, 0x4f, 0x49, 0x2c, 0x49, - 0xd4, 0x47, 0x51, 0xa8, 0x0b, 0xb6, 0x4c, 0x37, 0x3d, 0x35, 0x0f, 0x6b, 0x32, 0x4c, 0x62, 0x03, - 0xcb, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x08, 0x8a, 0xe8, 0x11, 0xb9, 0x02, 0x00, 0x00, + 0x84, 0x44, 0x7a, 0x7a, 0x6a, 0x1e, 0xd6, 0x74, 0x97, 0xc4, 0x06, 0x96, 0x36, 0x06, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x1e, 0x0e, 0xdd, 0xdd, 0xaa, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -401,10 +401,7 @@ func (m *ExportMetricsServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsService } if (iNdEx + skippy) > l { @@ -454,10 +451,7 @@ func (m *ExportMetricsServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetricsService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricsService } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.gw.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.gw.go similarity index 93% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.gw.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.gw.go index 8158c98a624..f0dc06e5f5e 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1/metrics_service.pb.gw.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1/metrics_service.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_MetricsService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client MetricsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ExportMetricsServiceRequest @@ -68,11 +70,14 @@ func local_request_MetricsService_Export_0(ctx context.Context, marshaler runtim // RegisterMetricsServiceHandlerServer registers the http handlers for service MetricsService to "mux". // UnaryRPC :call MetricsServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMetricsServiceHandlerFromEndpoint instead. func RegisterMetricsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MetricsServiceServer) error { mux.Handle("POST", pattern_MetricsService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -80,6 +85,7 @@ func RegisterMetricsServiceHandlerServer(ctx context.Context, mux *runtime.Serve return } resp, md, err := local_request_MetricsService_Export_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_config.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_config.pb.go similarity index 89% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_config.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_config.pb.go index deebad2314c..3a906f56f7f 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_config.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_config.pb.go @@ -355,43 +355,42 @@ func init() { } var fileDescriptor_5936aa8fa6443e6f = []byte{ - // 565 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xed, 0x86, 0xfe, 0xdd, 0x2a, 0xad, 0x33, 0x69, 0x91, 0x55, 0x55, 0xa6, 0x58, 0x48, - 0x64, 0x93, 0x58, 0x29, 0x0b, 0x04, 0x0b, 0xa4, 0xa4, 0x3f, 0x14, 0x29, 0x4a, 0x23, 0x37, 0x02, - 0x91, 0x8d, 0x35, 0xb1, 0x27, 0xd6, 0x08, 0x7b, 0x26, 0x8c, 0xa7, 0x51, 0xd9, 0xf3, 0x00, 0xbc, - 0x04, 0x4f, 0xc0, 0x4b, 0xb0, 0xec, 0x92, 0x25, 0x4a, 0x5e, 0x04, 0x79, 0x9c, 0xa6, 0x71, 0xda, - 0x46, 0x62, 0x37, 0x73, 0xce, 0x9c, 0xef, 0xde, 0x49, 0xae, 0x07, 0x1c, 0x3e, 0x24, 0x4c, 0x92, - 0x88, 0xc4, 0x44, 0x8a, 0x6f, 0xce, 0x50, 0x70, 0xc9, 0x1d, 0x29, 0xb0, 0x4f, 0x9c, 0x51, 0x3d, - 0x5b, 0x78, 0x3e, 0x67, 0x03, 0x1a, 0xd6, 0x94, 0x87, 0x0e, 0x72, 0x81, 0x4c, 0xac, 0xa9, 0x73, - 0xb5, 0x51, 0x7d, 0x7f, 0x37, 0xe4, 0x21, 0xcf, 0x20, 0xe9, 0x2a, 0xb3, 0xed, 0xef, 0xab, 0xb0, - 0xd5, 0x4d, 0x8f, 0x1c, 0x2b, 0x12, 0xea, 0x81, 0xe1, 0x73, 0x96, 0x48, 0xcc, 0xa4, 0x97, 0xe0, - 0x78, 0x18, 0x11, 0x61, 0xea, 0x87, 0x7a, 0x65, 0xeb, 0xa8, 0x5a, 0x5b, 0x86, 0xaf, 0x1d, 0x4f, - 0x53, 0x97, 0x59, 0xe8, 0x5c, 0x73, 0x77, 0xfc, 0xbc, 0x84, 0xfa, 0xb0, 0x9b, 0x75, 0x4d, 0x03, - 0x4f, 0x60, 0x49, 0xb9, 0xd7, 0xc7, 0x09, 0x09, 0xcc, 0x15, 0xc5, 0x77, 0x96, 0xf3, 0x55, 0x93, - 0x1f, 0x02, 0x37, 0xcd, 0x35, 0xd3, 0xd8, 0xb9, 0xe6, 0x96, 0xe4, 0xa2, 0x88, 0x42, 0xd8, 0x13, - 0x58, 0x12, 0x2f, 0xa2, 0x31, 0x95, 0x94, 0x85, 0xb3, 0x4b, 0x14, 0x54, 0x91, 0xfa, 0xf2, 0x22, - 0x2e, 0x96, 0xa4, 0x35, 0x4d, 0xde, 0x5d, 0xa4, 0x2c, 0xee, 0xcb, 0xe8, 0x35, 0x98, 0x31, 0xbe, - 0xf6, 0xd8, 0x55, 0xdc, 0x27, 0xc2, 0xe3, 0x03, 0x0f, 0x4b, 0x29, 0x68, 0xff, 0x4a, 0x92, 0xc4, - 0x7c, 0x72, 0xa8, 0x57, 0x0a, 0xee, 0x5e, 0x8c, 0xaf, 0xdb, 0xca, 0xbe, 0x18, 0x34, 0x66, 0x26, - 0x7a, 0x0b, 0xfb, 0xf9, 0xa0, 0xa4, 0x31, 0x09, 0x3c, 0x32, 0x22, 0x4c, 0x26, 0xe6, 0xaa, 0x8a, - 0x3e, 0x9d, 0x8b, 0x76, 0x53, 0xfb, 0x54, 0xb9, 0xa8, 0x0b, 0x95, 0xc7, 0x8a, 0x7a, 0x43, 0x22, - 0xe6, 0x51, 0xe6, 0x9a, 0x22, 0xd9, 0x0f, 0x36, 0xd1, 0x21, 0xe2, 0x0e, 0x8b, 0xaa, 0x50, 0xce, - 0x53, 0x23, 0xca, 0xbe, 0x24, 0xe6, 0xba, 0x02, 0x18, 0x73, 0x80, 0x56, 0xaa, 0xa3, 0xf7, 0xf0, - 0x7c, 0x69, 0x13, 0x69, 0xda, 0xdc, 0x50, 0xe1, 0x83, 0xc7, 0xaa, 0xa7, 0xa4, 0xe6, 0x26, 0xac, - 0x4f, 0xff, 0x1d, 0xfb, 0x97, 0x0e, 0x3b, 0x0b, 0x13, 0x84, 0x7a, 0xb0, 0x11, 0x10, 0x9f, 0x26, - 0x94, 0x33, 0x35, 0x82, 0xdb, 0x47, 0xef, 0xfe, 0x6b, 0x04, 0x67, 0xfb, 0x93, 0x29, 0xc5, 0x9d, - 0xf1, 0xec, 0x13, 0x30, 0x16, 0x5d, 0xb4, 0x0d, 0xd0, 0x68, 0x7d, 0x6a, 0x7c, 0xbe, 0xf4, 0x2e, - 0xce, 0xce, 0x0c, 0x0d, 0x15, 0x61, 0xf3, 0x76, 0xdf, 0x36, 0x74, 0x54, 0x82, 0xe2, 0x74, 0xdb, - 0x69, 0xb8, 0xa7, 0xed, 0xae, 0xb1, 0x62, 0xbf, 0x81, 0xd2, 0xbd, 0xb1, 0x44, 0x2f, 0xa0, 0xa8, - 0x6e, 0x45, 0x59, 0xa8, 0x54, 0xd5, 0xbb, 0xee, 0xe6, 0x45, 0xfb, 0x25, 0x94, 0x1f, 0x18, 0x36, - 0x64, 0x40, 0xe1, 0xeb, 0x30, 0x51, 0x91, 0x82, 0x9b, 0x2e, 0x9b, 0x3f, 0xf5, 0xdf, 0x63, 0x4b, - 0xbf, 0x19, 0x5b, 0xfa, 0xdf, 0xb1, 0xa5, 0xff, 0x98, 0x58, 0xda, 0xcd, 0xc4, 0xd2, 0xfe, 0x4c, - 0x2c, 0x0d, 0x9e, 0x51, 0xbe, 0xf4, 0x07, 0x69, 0x1a, 0x73, 0x5f, 0x76, 0x27, 0xb5, 0x3a, 0x7a, - 0xef, 0x63, 0xb8, 0x18, 0xa2, 0xdc, 0xf1, 0x79, 0x14, 0x11, 0x5f, 0x72, 0xe1, 0x50, 0x26, 0x89, - 0x60, 0x38, 0x72, 0x02, 0x2c, 0x71, 0xfe, 0x05, 0xaa, 0x2a, 0x7a, 0x35, 0x24, 0x6c, 0xee, 0xfc, - 0xed, 0x7b, 0xd4, 0x5f, 0x53, 0xee, 0xab, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4f, 0xc7, 0xe9, - 0xec, 0xb6, 0x04, 0x00, 0x00, + // 560 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x6f, 0xda, 0x30, + 0x18, 0xc6, 0x93, 0xb2, 0xfe, 0x7b, 0xab, 0xb6, 0xc1, 0xb4, 0x53, 0x54, 0x55, 0x59, 0x17, 0x4d, + 0x1a, 0x97, 0x12, 0xd1, 0x1d, 0xa6, 0xed, 0x30, 0x09, 0xfa, 0x77, 0x12, 0xa2, 0x28, 0x45, 0x9a, + 0xc6, 0xc5, 0x32, 0x89, 0x89, 0xac, 0x25, 0x36, 0x73, 0x5c, 0xd4, 0xdd, 0xf7, 0x01, 0x76, 0xda, + 0x17, 0xd9, 0x97, 0xd8, 0xb1, 0xc7, 0x1d, 0x27, 0xf8, 0x22, 0x53, 0x1c, 0x4a, 0x81, 0xb6, 0x48, + 0xbb, 0xd9, 0xcf, 0xe3, 0xe7, 0xf7, 0xbe, 0x86, 0x37, 0x06, 0x4f, 0xf4, 0x29, 0x57, 0x34, 0xa6, + 0x09, 0x55, 0xf2, 0x9b, 0xd7, 0x97, 0x42, 0x09, 0x4f, 0x49, 0x12, 0x50, 0x6f, 0x50, 0xcd, 0x17, + 0x38, 0x10, 0xbc, 0xc7, 0xa2, 0x8a, 0xf6, 0xd0, 0xfe, 0x4c, 0x20, 0x17, 0x2b, 0xfa, 0x5c, 0x65, + 0x50, 0xdd, 0xdb, 0x89, 0x44, 0x24, 0x72, 0x48, 0xb6, 0xca, 0x6d, 0xf7, 0xfb, 0x32, 0x6c, 0xb4, + 0xb3, 0x23, 0xc7, 0x9a, 0x84, 0x3a, 0x60, 0x05, 0x82, 0xa7, 0x8a, 0x70, 0x85, 0x53, 0x92, 0xf4, + 0x63, 0x2a, 0x6d, 0xf3, 0xc0, 0x2c, 0x6f, 0x1c, 0x1d, 0x56, 0x16, 0xe1, 0x2b, 0xc7, 0xe3, 0xd4, + 0x55, 0x1e, 0xba, 0x30, 0xfc, 0xed, 0x60, 0x56, 0x42, 0x5d, 0xd8, 0xc9, 0xbb, 0x66, 0x21, 0x96, + 0x44, 0x31, 0x81, 0xbb, 0x24, 0xa5, 0xa1, 0xbd, 0xa4, 0xf9, 0xde, 0x62, 0xbe, 0x6e, 0xf2, 0x63, + 0xe8, 0x67, 0xb9, 0x7a, 0x16, 0xbb, 0x30, 0xfc, 0xa2, 0x9a, 0x17, 0x51, 0x04, 0xbb, 0x92, 0x28, + 0x8a, 0x63, 0x96, 0x30, 0xc5, 0x78, 0x34, 0xb9, 0x44, 0x41, 0x17, 0xa9, 0x2e, 0x2e, 0xe2, 0x13, + 0x45, 0x1b, 0xe3, 0xe4, 0xfd, 0x45, 0x4a, 0xf2, 0xa1, 0x8c, 0xde, 0x82, 0x9d, 0x90, 0x1b, 0xcc, + 0xaf, 0x93, 0x2e, 0x95, 0x58, 0xf4, 0x30, 0x51, 0x4a, 0xb2, 0xee, 0xb5, 0xa2, 0xa9, 0xfd, 0xec, + 0xc0, 0x2c, 0x17, 0xfc, 0xdd, 0x84, 0xdc, 0x34, 0xb5, 0x7d, 0xd9, 0xab, 0x4d, 0x4c, 0xf4, 0x1e, + 0xf6, 0x66, 0x83, 0x8a, 0x25, 0x34, 0xc4, 0x74, 0x40, 0xb9, 0x4a, 0xed, 0x65, 0x1d, 0x7d, 0x3e, + 0x15, 0x6d, 0x67, 0xf6, 0xa9, 0x76, 0x51, 0x1b, 0xca, 0x4f, 0x15, 0xc5, 0x7d, 0x2a, 0xa7, 0x51, + 0xf6, 0x8a, 0x26, 0xb9, 0x8f, 0x36, 0xd1, 0xa2, 0xf2, 0x1e, 0x8b, 0x0e, 0xa1, 0x34, 0x4b, 0x8d, + 0x19, 0xff, 0x92, 0xda, 0xab, 0x1a, 0x60, 0x4d, 0x01, 0x1a, 0x99, 0x8e, 0xce, 0xe1, 0xe5, 0xc2, + 0x26, 0xb2, 0xb4, 0xbd, 0xa6, 0xc3, 0xfb, 0x4f, 0x55, 0xcf, 0x48, 0xf5, 0x75, 0x58, 0x1d, 0xff, + 0x3b, 0xee, 0x2f, 0x13, 0xb6, 0xe7, 0x26, 0x08, 0x75, 0x60, 0x2d, 0xa4, 0x01, 0x4b, 0x99, 0xe0, + 0x7a, 0x04, 0xb7, 0x8e, 0x3e, 0xfc, 0xd7, 0x08, 0x4e, 0xf6, 0x27, 0x63, 0x8a, 0x3f, 0xe1, 0xb9, + 0x27, 0x60, 0xcd, 0xbb, 0x68, 0x0b, 0xa0, 0xd6, 0xf8, 0x54, 0xfb, 0x7c, 0x85, 0x2f, 0xcf, 0xce, + 0x2c, 0x03, 0x6d, 0xc2, 0xfa, 0xdd, 0xbe, 0x69, 0x99, 0xa8, 0x08, 0x9b, 0xe3, 0x6d, 0xab, 0xe6, + 0x9f, 0x36, 0xdb, 0xd6, 0x92, 0xfb, 0x0e, 0x8a, 0x0f, 0xc6, 0x12, 0xbd, 0x82, 0x4d, 0x7d, 0x2b, + 0xc6, 0x23, 0xad, 0xea, 0xde, 0x4d, 0x7f, 0x56, 0x74, 0x5f, 0x43, 0xe9, 0x91, 0x61, 0x43, 0x16, + 0x14, 0xbe, 0xf6, 0x53, 0x1d, 0x29, 0xf8, 0xd9, 0xb2, 0xfe, 0xd3, 0xfc, 0x3d, 0x74, 0xcc, 0xdb, + 0xa1, 0x63, 0xfe, 0x1d, 0x3a, 0xe6, 0x8f, 0x91, 0x63, 0xdc, 0x8e, 0x1c, 0xe3, 0xcf, 0xc8, 0x31, + 0xe0, 0x05, 0x13, 0x0b, 0x7f, 0x90, 0xba, 0x35, 0xf5, 0x65, 0xb7, 0x32, 0xab, 0x65, 0x76, 0xce, + 0xa3, 0xf9, 0x10, 0x13, 0x5e, 0x20, 0xe2, 0x98, 0x06, 0x4a, 0x48, 0x8f, 0x71, 0x45, 0x25, 0x27, + 0xb1, 0x17, 0x12, 0x45, 0xf2, 0x37, 0x27, 0xa2, 0x7c, 0xea, 0xc0, 0xdd, 0x03, 0xd4, 0x5d, 0xd1, + 0xe6, 0x9b, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xac, 0x76, 0xce, 0xc4, 0xa7, 0x04, 0x00, 0x00, } func (m *TraceConfig) Marshal() (dAtA []byte, err error) { @@ -950,10 +949,7 @@ func (m *TraceConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceConfig } if (iNdEx + skippy) > l { @@ -1022,10 +1018,7 @@ func (m *ConstantSampler) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceConfig } if (iNdEx + skippy) > l { @@ -1086,10 +1079,7 @@ func (m *TraceIdRatioBased) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceConfig } if (iNdEx + skippy) > l { @@ -1158,10 +1148,7 @@ func (m *RateLimitingSampler) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceConfig - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceConfig } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.go similarity index 86% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.go index a96e40ea8a3..f481fa560c7 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.go @@ -16,7 +16,7 @@ import ( codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/trace/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -125,27 +125,26 @@ func init() { } var fileDescriptor_192a962890318cf4 = []byte{ - // 306 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0xca, 0x2f, 0x48, 0xcd, - 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, - 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0x2f, 0x29, 0x4a, 0x4c, 0x4e, 0xd5, - 0x2f, 0x33, 0x84, 0x30, 0xe2, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0xc0, 0xca, 0x84, - 0xd4, 0x50, 0xf4, 0x42, 0x04, 0xf5, 0xe0, 0x7a, 0xf5, 0xc0, 0x5a, 0xf4, 0xca, 0x0c, 0xa5, 0x44, - 0xd2, 0xf3, 0xd3, 0xf3, 0x21, 0x26, 0x83, 0x58, 0x10, 0x85, 0x52, 0x1a, 0xd8, 0x6c, 0x46, 0xb5, - 0x0f, 0xa2, 0x52, 0x29, 0x9f, 0x4b, 0xd2, 0xb5, 0xa2, 0x20, 0xbf, 0xa8, 0x24, 0x04, 0x24, 0x18, - 0x0c, 0x71, 0x43, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x50, 0x10, 0x17, 0x5f, 0x51, 0x6a, - 0x71, 0x7e, 0x69, 0x11, 0xc8, 0x79, 0x05, 0x89, 0x79, 0xc5, 0x12, 0x8c, 0x0a, 0xcc, 0x1a, 0xdc, - 0x46, 0xda, 0x7a, 0xd8, 0x5c, 0x07, 0x73, 0x93, 0x5e, 0x10, 0x54, 0x4f, 0x30, 0x48, 0x4b, 0x10, - 0x6f, 0x11, 0x32, 0x57, 0x49, 0x86, 0x4b, 0x0a, 0x9b, 0x85, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, - 0x46, 0x8b, 0x18, 0xb9, 0x78, 0x90, 0x25, 0x84, 0x26, 0x32, 0x72, 0xb1, 0x41, 0xd4, 0x0b, 0x39, - 0xea, 0x11, 0x17, 0x26, 0x7a, 0x38, 0x3d, 0x24, 0xe5, 0x44, 0x89, 0x11, 0x10, 0x27, 0x2a, 0x31, - 0x38, 0x6d, 0x60, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, - 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x06, 0x2e, 0xcd, 0xcc, - 0x7c, 0x22, 0xad, 0x70, 0x12, 0x44, 0x36, 0x3d, 0x00, 0xa4, 0x2a, 0x80, 0x31, 0x2a, 0x2c, 0x1d, - 0x5d, 0x7f, 0x26, 0x72, 0x92, 0xc9, 0xcc, 0x2b, 0x49, 0x2d, 0xca, 0x4b, 0xcc, 0xd1, 0x4f, 0x49, - 0x2c, 0x49, 0xd4, 0x47, 0x51, 0xa8, 0x0b, 0xb6, 0x48, 0x37, 0x3d, 0x35, 0x0f, 0x4b, 0x12, 0x4b, - 0x62, 0x03, 0xcb, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x4c, 0x62, 0xbb, 0x93, 0x02, - 0x00, 0x00, + // 299 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xcd, 0x4a, 0xc4, 0x30, + 0x10, 0x6e, 0x10, 0xf6, 0x10, 0x7f, 0xc0, 0xe2, 0x41, 0x8b, 0x04, 0xd9, 0x83, 0xac, 0x08, 0x29, + 0xbb, 0xde, 0xbc, 0x59, 0x10, 0xaf, 0x4b, 0xd7, 0x93, 0x17, 0xa9, 0x75, 0x28, 0x85, 0x9a, 0xa9, + 0x93, 0x6c, 0xd1, 0xb7, 0xd0, 0x47, 0xd0, 0xa7, 0xf1, 0xb8, 0x47, 0x8f, 0xd2, 0xbe, 0x88, 0xa4, + 0x51, 0xe9, 0x4a, 0x85, 0x05, 0x6f, 0x93, 0x99, 0xef, 0x2f, 0xc9, 0xf0, 0x53, 0x2c, 0x41, 0x19, + 0x28, 0xe0, 0x0e, 0x0c, 0x3d, 0x86, 0x25, 0xa1, 0xc1, 0x30, 0xc5, 0xa2, 0x80, 0xd4, 0x20, 0x85, + 0x86, 0x92, 0x14, 0xc2, 0x6a, 0xec, 0x8a, 0x6b, 0x0d, 0x54, 0xe5, 0x29, 0xc8, 0x16, 0xe6, 0x1f, + 0x2e, 0x71, 0x5d, 0x53, 0xfe, 0x70, 0x65, 0x4b, 0x91, 0xd5, 0x38, 0xd8, 0xc9, 0x30, 0x43, 0xa7, + 0x6c, 0x2b, 0x07, 0x0c, 0x46, 0x7d, 0xce, 0xcb, 0x7e, 0x0e, 0x39, 0x44, 0xbe, 0x77, 0xfe, 0x50, + 0x22, 0x99, 0x4b, 0xdb, 0x9c, 0xb9, 0x0c, 0x31, 0xdc, 0xcf, 0x41, 0x1b, 0x3f, 0xe6, 0x5b, 0x04, + 0x1a, 0xe7, 0x64, 0xe3, 0x95, 0x89, 0xd2, 0xbb, 0xec, 0x60, 0x6d, 0xb4, 0x3e, 0x39, 0x96, 0x7d, + 0xe9, 0xbe, 0x33, 0xc9, 0xf8, 0x8b, 0x33, 0xb3, 0x94, 0x78, 0x93, 0xba, 0xc7, 0xe1, 0x3e, 0x0f, + 0xfa, 0x0c, 0x75, 0x89, 0x4a, 0xc3, 0xe4, 0x95, 0xf1, 0x8d, 0xee, 0xc0, 0x7f, 0x66, 0x7c, 0xe0, + 0xf0, 0xfe, 0x99, 0x5c, 0xed, 0x4d, 0xe4, 0x9f, 0x17, 0x0a, 0xa2, 0xff, 0x48, 0xb8, 0x88, 0x43, + 0x2f, 0x7a, 0x61, 0x6f, 0xb5, 0x60, 0x8b, 0x5a, 0xb0, 0x8f, 0x5a, 0xb0, 0xa7, 0x46, 0x78, 0x8b, + 0x46, 0x78, 0xef, 0x8d, 0xf0, 0xf8, 0x51, 0x8e, 0x2b, 0x5a, 0x44, 0xdb, 0x5d, 0xf5, 0xa9, 0x45, + 0x4d, 0xd9, 0xd5, 0x45, 0xf6, 0x9b, 0x9f, 0x77, 0x57, 0x26, 0x57, 0x06, 0x48, 0x25, 0x45, 0x78, + 0x9b, 0x98, 0xc4, 0x7d, 0x6b, 0x06, 0xaa, 0x67, 0xa7, 0x6e, 0x06, 0xed, 0xf0, 0xe4, 0x33, 0x00, + 0x00, 0xff, 0xff, 0x53, 0x91, 0xbb, 0xe7, 0x84, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -402,10 +401,7 @@ func (m *ExportTraceServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceService } if (iNdEx + skippy) > l { @@ -455,10 +451,7 @@ func (m *ExportTraceServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTraceService - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTraceService } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.gw.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.gw.go similarity index 93% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.gw.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.gw.go index 1da38f1cd28..18dff3d03e7 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service.pb.gw.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_TraceService_Export_0(ctx context.Context, marshaler runtime.Marshaler, client TraceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ExportTraceServiceRequest @@ -68,11 +70,14 @@ func local_request_TraceService_Export_0(ctx context.Context, marshaler runtime. // RegisterTraceServiceHandlerServer registers the http handlers for service TraceService to "mux". // UnaryRPC :call TraceServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTraceServiceHandlerFromEndpoint instead. func RegisterTraceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TraceServiceServer) error { mux.Handle("POST", pattern_TraceService_Export_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -80,6 +85,7 @@ func RegisterTraceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMu return } resp, md, err := local_request_TraceService_Export_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service_gateway_aliases.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service_gateway_aliases.go similarity index 100% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1/trace_service_gateway_aliases.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1/trace_service_gateway_aliases.go diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1/common.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/common/v1/common.pb.go similarity index 92% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1/common.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/common/v1/common.pb.go index 3b362407449..24307a8f129 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1/common.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/common/v1/common.pb.go @@ -442,37 +442,36 @@ func init() { } var fileDescriptor_62ba46dcb97aa817 = []byte{ - // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x6b, 0xdb, 0x30, - 0x18, 0xb6, 0x9a, 0x34, 0x4d, 0x5e, 0x87, 0x31, 0x44, 0x19, 0x61, 0x50, 0xd7, 0x64, 0x87, 0x79, - 0x1b, 0x8d, 0x69, 0x77, 0xd9, 0xb5, 0x29, 0x1b, 0x19, 0xcb, 0x20, 0xb8, 0x6c, 0x87, 0x5d, 0x86, - 0xd2, 0x0a, 0x23, 0x2a, 0x4b, 0x45, 0x56, 0x0c, 0xfe, 0x17, 0x3b, 0xee, 0xcf, 0xec, 0xde, 0x63, - 0x8f, 0x3b, 0x8d, 0x91, 0xfc, 0x91, 0xa2, 0x0f, 0xf7, 0xeb, 0x90, 0x92, 0xdb, 0xab, 0x47, 0xcf, - 0xc7, 0xfb, 0xea, 0x03, 0xde, 0xca, 0x4b, 0x2a, 0x34, 0xe5, 0xb4, 0xa0, 0x5a, 0xd5, 0xe9, 0xa5, - 0x92, 0x5a, 0xa6, 0x67, 0xb2, 0x28, 0xa4, 0x48, 0xab, 0x43, 0x5f, 0x8d, 0x2c, 0x8c, 0xf7, 0x1e, - 0x70, 0x1d, 0x38, 0xf2, 0x8c, 0xea, 0xf0, 0xe5, 0x6e, 0x2e, 0x73, 0xe9, 0x0c, 0x4c, 0xe5, 0xf6, - 0x87, 0x7f, 0xb6, 0xa0, 0x7b, 0x2c, 0xea, 0xef, 0x84, 0x2f, 0x28, 0x7e, 0x05, 0xfd, 0x52, 0x2b, - 0x26, 0xf2, 0x9f, 0x95, 0x59, 0x0f, 0x50, 0x8c, 0x92, 0xde, 0x24, 0xc8, 0x42, 0x87, 0x3a, 0xd2, - 0x3e, 0xc0, 0x5c, 0x4a, 0xee, 0x29, 0x5b, 0x31, 0x4a, 0xba, 0x93, 0x20, 0xeb, 0x19, 0xcc, 0x11, - 0xf6, 0xa0, 0xc7, 0x84, 0xf6, 0xfb, 0xad, 0x18, 0x25, 0xad, 0x49, 0x90, 0x75, 0x99, 0xd0, 0xb7, - 0x21, 0xe7, 0x72, 0x31, 0xe7, 0xd4, 0x33, 0xda, 0x31, 0x4a, 0x90, 0x09, 0x71, 0xa8, 0x23, 0x4d, - 0x21, 0x24, 0x4a, 0x91, 0xda, 0x73, 0xb6, 0x63, 0x94, 0x84, 0x47, 0x6f, 0x46, 0x6b, 0x27, 0x1c, - 0x1d, 0x1b, 0x85, 0xd5, 0x4f, 0x82, 0x0c, 0xc8, 0xed, 0x0a, 0xcf, 0xa0, 0x7f, 0x51, 0x71, 0x56, - 0x36, 0x4d, 0x75, 0xac, 0xdd, 0xbb, 0x27, 0xec, 0xbe, 0x50, 0x27, 0x9f, 0xb2, 0x52, 0x9b, 0xfe, - 0x9c, 0x85, 0x85, 0xc6, 0x3b, 0xb0, 0x6d, 0xad, 0x86, 0xa7, 0x00, 0x77, 0xb1, 0xf8, 0x23, 0x74, - 0x2c, 0x5c, 0x0e, 0x50, 0xdc, 0x4a, 0xc2, 0xa3, 0xd7, 0x4f, 0x75, 0xec, 0x4f, 0x7e, 0xdc, 0xbe, - 0xfa, 0xb7, 0x1f, 0x64, 0x5e, 0x3c, 0xfc, 0x06, 0xfd, 0xfb, 0xe1, 0x1b, 0xdb, 0x36, 0xe2, 0x47, - 0xb6, 0x04, 0xba, 0xcd, 0x0e, 0x7e, 0x0e, 0xad, 0x0b, 0x5a, 0xbb, 0x1b, 0xce, 0x4c, 0x89, 0x4f, - 0xfc, 0x48, 0xf6, 0x4a, 0x37, 0x6e, 0xdd, 0x1f, 0xc7, 0x07, 0x78, 0x76, 0x6a, 0xdf, 0xca, 0x9a, - 0xa0, 0xdd, 0xfb, 0x41, 0xbd, 0x46, 0xf9, 0x09, 0x5e, 0x7c, 0x16, 0xa5, 0x56, 0x8b, 0x82, 0x0a, - 0x4d, 0x34, 0x93, 0x62, 0xca, 0xe6, 0x8a, 0xa8, 0x1a, 0x63, 0x68, 0x0b, 0x52, 0xf8, 0xd7, 0x98, - 0xd9, 0x1a, 0x0f, 0x60, 0xa7, 0xa2, 0xaa, 0x64, 0x52, 0x78, 0x97, 0x66, 0x39, 0xfe, 0x8d, 0xae, - 0x96, 0x11, 0xba, 0x5e, 0x46, 0xe8, 0xff, 0x32, 0x42, 0xbf, 0x56, 0x51, 0x70, 0xbd, 0x8a, 0x82, - 0xbf, 0xab, 0x28, 0x80, 0x98, 0xc9, 0xf5, 0x43, 0x8d, 0xc3, 0x13, 0x5b, 0xce, 0x0c, 0x3c, 0x43, - 0x3f, 0xbe, 0xe6, 0x8f, 0x05, 0xcc, 0xfc, 0x3e, 0xce, 0xe9, 0x99, 0x96, 0x2a, 0x65, 0x42, 0x53, - 0x25, 0x08, 0x4f, 0xcf, 0x89, 0x26, 0xe9, 0x03, 0xe2, 0x81, 0x75, 0x3e, 0xc8, 0xa9, 0xb8, 0xfb, - 0xad, 0xf3, 0x8e, 0x05, 0xdf, 0xdf, 0x04, 0x00, 0x00, 0xff, 0xff, 0x70, 0x0b, 0x4b, 0xbe, 0xd5, - 0x03, 0x00, 0x00, + // 464 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xde, 0x69, 0xd2, 0x34, 0x79, 0x37, 0x88, 0x0c, 0x45, 0x82, 0xd0, 0xed, 0x12, 0x0f, 0xae, + 0x0a, 0x59, 0x5a, 0x2f, 0x9e, 0x84, 0xa6, 0x28, 0x11, 0x73, 0x08, 0x5b, 0xf4, 0xe0, 0x45, 0x66, + 0xdb, 0x61, 0x19, 0x3a, 0x3b, 0x53, 0x66, 0x27, 0x0b, 0xfb, 0x13, 0xbc, 0xf9, 0x87, 0xbc, 0xf7, + 0xd8, 0xa3, 0x27, 0x91, 0xe4, 0x8f, 0xc8, 0x7c, 0x6c, 0x5b, 0x7b, 0x48, 0xc9, 0xed, 0x9d, 0x67, + 0x9e, 0x8f, 0x77, 0x3e, 0x5e, 0x78, 0x2d, 0xaf, 0xa8, 0xd0, 0x94, 0xd3, 0x92, 0x6a, 0xd5, 0xa4, + 0x57, 0x4a, 0x6a, 0x99, 0x9e, 0xcb, 0xb2, 0x94, 0x22, 0xad, 0x8f, 0x7c, 0x35, 0xb1, 0x30, 0x3e, + 0xf8, 0x8f, 0xeb, 0xc0, 0x89, 0x67, 0xd4, 0x47, 0xcf, 0xf7, 0x0b, 0x59, 0x48, 0x67, 0x60, 0x2a, + 0xb7, 0x3f, 0xfe, 0xb5, 0x03, 0xfd, 0x13, 0xd1, 0x7c, 0x25, 0x7c, 0x49, 0xf1, 0x0b, 0x18, 0x56, + 0x5a, 0x31, 0x51, 0x7c, 0xaf, 0xcd, 0x7a, 0x84, 0x62, 0x94, 0x0c, 0x66, 0x41, 0x16, 0x3a, 0xd4, + 0x91, 0x0e, 0x01, 0x72, 0x29, 0xb9, 0xa7, 0xec, 0xc4, 0x28, 0xe9, 0xcf, 0x82, 0x6c, 0x60, 0x30, + 0x47, 0x38, 0x80, 0x01, 0x13, 0xda, 0xef, 0x77, 0x62, 0x94, 0x74, 0x66, 0x41, 0xd6, 0x67, 0x42, + 0xdf, 0x86, 0x5c, 0xc8, 0x65, 0xce, 0xa9, 0x67, 0x74, 0x63, 0x94, 0x20, 0x13, 0xe2, 0x50, 0x47, + 0x9a, 0x43, 0x48, 0x94, 0x22, 0x8d, 0xe7, 0xec, 0xc6, 0x28, 0x09, 0x8f, 0x5f, 0x4d, 0x36, 0x9e, + 0x70, 0x72, 0x62, 0x14, 0x56, 0x3f, 0x0b, 0x32, 0x20, 0xb7, 0x2b, 0xbc, 0x80, 0xe1, 0x65, 0xcd, + 0x59, 0xd5, 0x36, 0xd5, 0xb3, 0x76, 0x6f, 0x1e, 0xb1, 0xfb, 0x4c, 0x9d, 0x7c, 0xce, 0x2a, 0x6d, + 0xfa, 0x73, 0x16, 0x16, 0x9a, 0xee, 0xc1, 0xae, 0xb5, 0x1a, 0x9f, 0x01, 0xdc, 0xc5, 0xe2, 0x0f, + 0xd0, 0xb3, 0x70, 0x35, 0x42, 0x71, 0x27, 0x09, 0x8f, 0x5f, 0x3e, 0xd6, 0xb1, 0xbf, 0xf9, 0x69, + 0xf7, 0xfa, 0xcf, 0x61, 0x90, 0x79, 0xf1, 0xf8, 0x0b, 0x0c, 0xef, 0x87, 0x6f, 0x6d, 0xdb, 0x8a, + 0x1f, 0xd8, 0x12, 0xe8, 0xb7, 0x3b, 0xf8, 0x29, 0x74, 0x2e, 0x69, 0xe3, 0x5e, 0x38, 0x33, 0x25, + 0x3e, 0xf5, 0x47, 0xb2, 0x4f, 0xba, 0x75, 0xeb, 0xfe, 0x3a, 0xde, 0xc1, 0x93, 0x33, 0xfb, 0x57, + 0x36, 0x04, 0xed, 0xdf, 0x0f, 0x1a, 0xb4, 0xca, 0x8f, 0xf0, 0xec, 0x93, 0xa8, 0xb4, 0x5a, 0x96, + 0x54, 0x68, 0xa2, 0x99, 0x14, 0x73, 0x96, 0x2b, 0xa2, 0x1a, 0x8c, 0xa1, 0x2b, 0x48, 0xe9, 0x7f, + 0x63, 0x66, 0x6b, 0x3c, 0x82, 0xbd, 0x9a, 0xaa, 0x8a, 0x49, 0xe1, 0x5d, 0xda, 0xe5, 0xf4, 0x07, + 0xba, 0x5e, 0x45, 0xe8, 0x66, 0x15, 0xa1, 0xbf, 0xab, 0x08, 0xfd, 0x5c, 0x47, 0xc1, 0xcd, 0x3a, + 0x0a, 0x7e, 0xaf, 0xa3, 0x00, 0x62, 0x26, 0x37, 0x1f, 0x6a, 0x1a, 0x9e, 0xda, 0x72, 0x61, 0xe0, + 0x05, 0xfa, 0xf6, 0xbe, 0x78, 0x28, 0x60, 0x66, 0xfa, 0x38, 0xa7, 0xe7, 0x5a, 0xaa, 0x94, 0x09, + 0x4d, 0x95, 0x20, 0x3c, 0xbd, 0x20, 0x9a, 0xb8, 0xd9, 0x2c, 0xa8, 0xb8, 0x1b, 0xcf, 0xbc, 0x67, + 0xb1, 0xb7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2a, 0xbe, 0xe0, 0x4f, 0xc6, 0x03, 0x00, 0x00, } func (m *AnyValue) Marshal() (dAtA []byte, err error) { @@ -1151,10 +1150,7 @@ func (m *AnyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { @@ -1238,10 +1234,7 @@ func (m *ArrayValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { @@ -1325,10 +1318,7 @@ func (m *KeyValueList) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { @@ -1443,10 +1433,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { @@ -1560,10 +1547,7 @@ func (m *StringKeyValue) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { @@ -1677,10 +1661,7 @@ func (m *InstrumentationLibrary) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthCommon - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthCommon } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1/logs.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/logs/v1/logs.pb.go similarity index 86% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1/logs.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/logs/v1/logs.pb.go index 3092a71e09b..264b5c4f908 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1/logs.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/logs/v1/logs.pb.go @@ -14,8 +14,8 @@ import ( proto "github.com/gogo/protobuf/proto" go_opentelemetry_io_collector_internal_data "go.opentelemetry.io/collector/internal/data" - v11 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1" + v11 "go.opentelemetry.io/collector/internal/data/protogen/common/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/resource/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -407,61 +407,60 @@ func init() { } var fileDescriptor_d1c030a3ec7e961e = []byte{ - // 849 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xdf, 0x6e, 0x22, 0x37, - 0x14, 0xc6, 0x71, 0x42, 0x20, 0x71, 0x08, 0xeb, 0xba, 0xd9, 0xec, 0x94, 0x54, 0x04, 0xa5, 0xed, - 0x96, 0xa6, 0x5a, 0x50, 0x06, 0xaa, 0x56, 0xdb, 0xab, 0x21, 0x0c, 0xd1, 0x28, 0x84, 0x44, 0x86, - 0xa4, 0x7f, 0x6e, 0x46, 0x03, 0xb8, 0x68, 0x24, 0xb0, 0xd1, 0x8c, 0x89, 0xc2, 0x5b, 0x54, 0x7d, - 0xa5, 0xde, 0xec, 0x55, 0xbb, 0x57, 0x55, 0xd5, 0x8b, 0x55, 0x95, 0x3c, 0x48, 0x2b, 0x9b, 0x81, - 0x5d, 0xd0, 0x98, 0xd5, 0x5e, 0xc5, 0x73, 0x7e, 0xe7, 0xfb, 0xce, 0xf1, 0x89, 0x6d, 0x01, 0x9f, - 0xf3, 0x31, 0x65, 0x82, 0x0e, 0xe9, 0x88, 0x8a, 0x60, 0x5a, 0x1e, 0x07, 0x5c, 0xf0, 0xf2, 0x90, - 0x0f, 0xc2, 0xf2, 0xdd, 0xa9, 0xfa, 0x5b, 0x52, 0x21, 0x7c, 0xb8, 0x94, 0x37, 0x0b, 0x96, 0x14, - 0xbf, 0x3b, 0xcd, 0xed, 0x0f, 0xf8, 0x80, 0xcf, 0xa4, 0x72, 0x35, 0xa3, 0xb9, 0x93, 0x38, 0xeb, - 0x1e, 0x1f, 0x8d, 0x38, 0x93, 0xe6, 0xb3, 0x55, 0x94, 0x5b, 0x8a, 0xcb, 0x0d, 0x68, 0xc8, 0x27, - 0x41, 0x8f, 0xca, 0xec, 0xf9, 0x7a, 0x96, 0x7f, 0xfc, 0x17, 0x80, 0x19, 0x12, 0x85, 0x9a, 0x7c, - 0x10, 0xe2, 0x0b, 0xb8, 0x3d, 0x4f, 0x31, 0x40, 0x01, 0x14, 0x77, 0xcd, 0xaf, 0x4a, 0x71, 0x2d, - 0x2f, 0x7c, 0xee, 0x4e, 0x4b, 0x73, 0x83, 0x5a, 0xf2, 0xd5, 0x9b, 0xa3, 0x04, 0x59, 0x18, 0xe0, - 0x29, 0xfc, 0xd4, 0x67, 0xa1, 0x08, 0x26, 0x23, 0xca, 0x84, 0x27, 0x7c, 0xce, 0xdc, 0xa1, 0xdf, - 0x0d, 0xbc, 0x60, 0xea, 0xca, 0x2d, 0x1b, 0x1b, 0x85, 0xcd, 0xe2, 0xae, 0xf9, 0x6d, 0x69, 0xcd, - 0x4c, 0x4a, 0xce, 0xb2, 0x41, 0x73, 0xa6, 0x97, 0xbd, 0x92, 0x9c, 0xaf, 0x65, 0xc7, 0x7f, 0x00, - 0x98, 0xd3, 0x4b, 0xb1, 0x80, 0xcf, 0x34, 0x9d, 0x45, 0xbb, 0xfe, 0x26, 0xb6, 0xa9, 0x68, 0xd6, - 0xda, 0xb6, 0xa2, 0x09, 0x1c, 0xc4, 0x37, 0x86, 0x5f, 0xc2, 0xe4, 0x3b, 0xfb, 0x7e, 0xbe, 0x76, - 0xdf, 0x4d, 0x3e, 0x20, 0xb4, 0xc7, 0x83, 0x3e, 0x51, 0x9a, 0xe3, 0x3f, 0x93, 0x70, 0x67, 0x11, - 0xc3, 0x9f, 0xc3, 0xac, 0xf0, 0x47, 0xd4, 0x9d, 0x30, 0xff, 0xde, 0x65, 0x1e, 0xe3, 0xaa, 0xed, - 0x14, 0xc9, 0xc8, 0xe8, 0x0d, 0xf3, 0xef, 0x5b, 0x1e, 0xe3, 0xb8, 0x03, 0x9f, 0x84, 0xf4, 0x8e, - 0x06, 0xbe, 0x98, 0xba, 0x6c, 0x32, 0xea, 0xd2, 0xc0, 0xd8, 0x28, 0x80, 0x62, 0xd6, 0xfc, 0x7a, - 0x6d, 0xe9, 0x76, 0xa4, 0x69, 0x29, 0x09, 0xc9, 0x86, 0x4b, 0xdf, 0xf8, 0x33, 0xb8, 0xb7, 0x70, - 0x15, 0xf4, 0x5e, 0x18, 0x9b, 0x05, 0x50, 0xdc, 0x21, 0x99, 0x79, 0xb0, 0x43, 0xef, 0x05, 0xc6, - 0x30, 0xc9, 0xbc, 0x11, 0x35, 0x92, 0x8a, 0xa9, 0x35, 0xb6, 0x60, 0xb2, 0xcb, 0xfb, 0x53, 0x63, - 0x4b, 0x4d, 0xf8, 0xcb, 0xf7, 0x4c, 0xd8, 0x62, 0xd3, 0x5b, 0x6f, 0x38, 0x99, 0x9f, 0x2a, 0x25, - 0xc5, 0x97, 0x10, 0x7a, 0x42, 0x04, 0x7e, 0x77, 0x22, 0x68, 0x68, 0xa4, 0xd4, 0x1c, 0xdf, 0x67, - 0x74, 0x41, 0x97, 0x8c, 0xde, 0x31, 0xc0, 0xdf, 0x41, 0xa3, 0x1f, 0xf0, 0xf1, 0x98, 0xf6, 0xdd, - 0xb7, 0x51, 0xb7, 0xc7, 0x27, 0x4c, 0x18, 0xe9, 0x02, 0x28, 0xee, 0x91, 0x83, 0x88, 0x5b, 0x0b, - 0x7c, 0x26, 0x29, 0xde, 0x87, 0x5b, 0xbf, 0x0c, 0xbd, 0x41, 0x68, 0x6c, 0x17, 0x40, 0x31, 0x4d, - 0x66, 0x1f, 0xf8, 0x16, 0x6e, 0x8b, 0xc0, 0xeb, 0x51, 0xd7, 0xef, 0x1b, 0x3b, 0x05, 0x50, 0xcc, - 0xd4, 0xbe, 0x97, 0x35, 0xff, 0x79, 0x73, 0x54, 0x19, 0xf0, 0x95, 0x36, 0x7d, 0x79, 0x89, 0x87, - 0x43, 0xda, 0x13, 0x3c, 0x28, 0xfb, 0x4c, 0xd0, 0x80, 0x79, 0xc3, 0x72, 0xdf, 0x13, 0x5e, 0xa9, - 0x23, 0x3d, 0x9c, 0x3a, 0x49, 0x2b, 0x33, 0xa7, 0x8f, 0xdb, 0x30, 0x1d, 0x8e, 0x3d, 0x26, 0x6d, - 0xa1, 0xb2, 0x7d, 0x19, 0xd9, 0x9a, 0x1f, 0x62, 0xdb, 0x1e, 0x7b, 0xcc, 0xa9, 0x93, 0x94, 0xb4, - 0x72, 0xfa, 0x27, 0xbf, 0x6f, 0xc1, 0xec, 0xf2, 0xbf, 0x1a, 0x1f, 0xc1, 0xc3, 0xb6, 0x7d, 0x6b, - 0x13, 0xa7, 0xf3, 0x93, 0xdb, 0xba, 0xb9, 0xac, 0xd9, 0xc4, 0xbd, 0x69, 0xb5, 0xaf, 0xed, 0x33, - 0xa7, 0xe1, 0xd8, 0x75, 0x94, 0xc0, 0x9f, 0xc0, 0xa7, 0xab, 0x09, 0x1d, 0x62, 0x9d, 0xd9, 0x08, - 0xe0, 0x1c, 0x3c, 0x88, 0x45, 0x26, 0xda, 0xd0, 0xb2, 0x0a, 0xda, 0xd4, 0xb2, 0x2a, 0x4a, 0xc6, - 0x95, 0xab, 0xdb, 0xb5, 0x9b, 0x73, 0xb4, 0x15, 0x27, 0x53, 0xc8, 0x44, 0x29, 0x2d, 0xab, 0xa0, - 0xb4, 0x96, 0x55, 0xd1, 0x36, 0x36, 0xe0, 0xfe, 0x2a, 0x73, 0x5a, 0x8d, 0x2b, 0xb4, 0x13, 0xd7, - 0x88, 0x24, 0x26, 0x82, 0x3a, 0x54, 0x41, 0xbb, 0x3a, 0x54, 0x45, 0x99, 0xb8, 0x52, 0x3f, 0x58, - 0xa4, 0x85, 0xf6, 0xe2, 0x44, 0x92, 0x98, 0x28, 0xab, 0x43, 0x15, 0xf4, 0x44, 0x87, 0xaa, 0x08, - 0xc5, 0x21, 0x9b, 0x90, 0x2b, 0x82, 0x3e, 0x8a, 0x1b, 0x86, 0x42, 0x26, 0xc2, 0x5a, 0x56, 0x41, - 0x1f, 0x6b, 0x59, 0x15, 0xed, 0xc7, 0x95, 0x6b, 0x58, 0x1d, 0xab, 0x89, 0x9e, 0xc6, 0xc9, 0x14, - 0x32, 0xd1, 0x81, 0x96, 0x55, 0xd0, 0x33, 0x2d, 0xab, 0x22, 0xe3, 0xe4, 0x47, 0x98, 0x5d, 0x3c, - 0x8b, 0x0d, 0x75, 0x09, 0x8f, 0xe0, 0x61, 0xf3, 0xea, 0xdc, 0x25, 0xf6, 0xd9, 0x15, 0xa9, 0xbb, - 0x8d, 0xa6, 0x75, 0xbe, 0x72, 0x88, 0xbf, 0x80, 0x85, 0xd5, 0x04, 0x75, 0xe2, 0xd4, 0xb2, 0xed, - 0x5e, 0x5a, 0xed, 0x0b, 0xf4, 0x1f, 0xa8, 0xfd, 0x06, 0x5e, 0x3d, 0xe4, 0xc1, 0xeb, 0x87, 0x3c, - 0xf8, 0xf7, 0x21, 0x0f, 0x7e, 0x7d, 0xcc, 0x27, 0x5e, 0x3f, 0xe6, 0x13, 0x7f, 0x3f, 0xe6, 0x13, - 0x30, 0xef, 0xf3, 0x75, 0x2f, 0x68, 0x4d, 0xbe, 0xd4, 0xe1, 0xb5, 0x0c, 0x5d, 0x83, 0x9f, 0x2f, - 0x3e, 0xe0, 0x8e, 0x96, 0x97, 0x12, 0x5f, 0x28, 0xd7, 0x17, 0x03, 0xca, 0xe6, 0x3f, 0x25, 0xba, - 0x29, 0x15, 0xaa, 0xfc, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x28, 0xc9, 0xea, 0x70, 0x08, 0x00, - 0x00, + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x96, 0xcf, 0x6f, 0x22, 0x37, + 0x14, 0xc7, 0x71, 0x42, 0x20, 0x71, 0x08, 0xeb, 0xba, 0xd9, 0xec, 0x94, 0x54, 0x04, 0xa5, 0xed, + 0x96, 0xa6, 0x12, 0x28, 0x03, 0x55, 0xab, 0x6d, 0x2f, 0x43, 0x18, 0xa2, 0x51, 0x08, 0x89, 0x0c, + 0x49, 0x7f, 0x5c, 0x46, 0x03, 0xb8, 0x68, 0x24, 0xb0, 0xd1, 0x8c, 0x89, 0xc2, 0xb9, 0xff, 0x40, + 0xff, 0xa7, 0x5e, 0xf6, 0xd4, 0xee, 0xa9, 0xaa, 0x7a, 0x58, 0x55, 0xc9, 0x1f, 0xd2, 0xca, 0x66, + 0xa0, 0x0b, 0x1a, 0xb3, 0xca, 0x09, 0xcf, 0xfb, 0xbc, 0xef, 0xf7, 0x3d, 0x3f, 0xc6, 0x06, 0xf8, + 0x92, 0x8f, 0x29, 0x13, 0x74, 0x48, 0x47, 0x54, 0x04, 0xd3, 0xf2, 0x38, 0xe0, 0x82, 0x97, 0x87, + 0x7c, 0x10, 0x96, 0xef, 0x4e, 0xd5, 0x67, 0x49, 0x85, 0xf0, 0xe1, 0x52, 0xde, 0x2c, 0x58, 0x52, + 0xfc, 0xee, 0x34, 0xb7, 0x3f, 0xe0, 0x03, 0x3e, 0x93, 0xca, 0xd5, 0x8c, 0xe6, 0x4e, 0xe2, 0xac, + 0x7b, 0x7c, 0x34, 0xe2, 0x4c, 0x9a, 0xcf, 0x56, 0x51, 0x6e, 0x29, 0x2e, 0x37, 0xa0, 0x21, 0x9f, + 0x04, 0x3d, 0x2a, 0xb3, 0xe7, 0xeb, 0x59, 0xfe, 0xf1, 0x9f, 0x00, 0x66, 0x48, 0x14, 0x6a, 0xf2, + 0x41, 0x88, 0x2f, 0xe0, 0xf6, 0x3c, 0xc5, 0x00, 0x05, 0x50, 0xdc, 0x35, 0xbf, 0x28, 0xc5, 0xb5, + 0xbc, 0xf0, 0xb9, 0x3b, 0x2d, 0xcd, 0x0d, 0x6a, 0xc9, 0xd7, 0x6f, 0x8f, 0x12, 0x64, 0x61, 0x80, + 0xa7, 0xf0, 0x63, 0x9f, 0x85, 0x22, 0x98, 0x8c, 0x28, 0x13, 0x9e, 0xf0, 0x39, 0x73, 0x87, 0x7e, + 0x37, 0xf0, 0x82, 0xa9, 0x2b, 0xb7, 0x6c, 0x6c, 0x14, 0x36, 0x8b, 0xbb, 0xe6, 0xd7, 0xa5, 0x35, + 0x33, 0x29, 0x39, 0xcb, 0x06, 0xcd, 0x99, 0x5e, 0xf6, 0x4a, 0x72, 0xbe, 0x96, 0x1d, 0xff, 0x0e, + 0x60, 0x4e, 0x2f, 0xc5, 0x02, 0xbe, 0xd0, 0x74, 0x16, 0xed, 0xfa, 0xab, 0xd8, 0xa6, 0xa2, 0x59, + 0x6b, 0xdb, 0x8a, 0x26, 0x70, 0x10, 0xdf, 0x18, 0x7e, 0x05, 0x93, 0xef, 0xec, 0xfb, 0xe5, 0xda, + 0x7d, 0x37, 0xf9, 0x80, 0xd0, 0x1e, 0x0f, 0xfa, 0x44, 0x69, 0x8e, 0xff, 0x48, 0xc2, 0x9d, 0x45, + 0x0c, 0x7f, 0x0a, 0xb3, 0xc2, 0x1f, 0x51, 0x77, 0xc2, 0xfc, 0x7b, 0x97, 0x79, 0x8c, 0xab, 0xb6, + 0x53, 0x24, 0x23, 0xa3, 0x37, 0xcc, 0xbf, 0x6f, 0x79, 0x8c, 0xe3, 0x0e, 0x7c, 0x16, 0xd2, 0x3b, + 0x1a, 0xf8, 0x62, 0xea, 0xb2, 0xc9, 0xa8, 0x4b, 0x03, 0x63, 0xa3, 0x00, 0x8a, 0x59, 0xf3, 0xcb, + 0xb5, 0xa5, 0xdb, 0x91, 0xa6, 0xa5, 0x24, 0x24, 0x1b, 0x2e, 0x3d, 0xe3, 0x4f, 0xe0, 0xde, 0xc2, + 0x55, 0xd0, 0x7b, 0x61, 0x6c, 0x16, 0x40, 0x71, 0x87, 0x64, 0xe6, 0xc1, 0x0e, 0xbd, 0x17, 0x18, + 0xc3, 0x24, 0xf3, 0x46, 0xd4, 0x48, 0x2a, 0xa6, 0xd6, 0xd8, 0x82, 0xc9, 0x2e, 0xef, 0x4f, 0x8d, + 0x2d, 0x35, 0xe1, 0xcf, 0xdf, 0x33, 0x61, 0x8b, 0x4d, 0x6f, 0xbd, 0xe1, 0x64, 0xfe, 0x56, 0x29, + 0x29, 0xbe, 0x84, 0xd0, 0x13, 0x22, 0xf0, 0xbb, 0x13, 0x41, 0x43, 0x23, 0xa5, 0xe6, 0xf8, 0x3e, + 0xa3, 0x0b, 0xba, 0x64, 0xf4, 0x8e, 0x01, 0xfe, 0x06, 0x1a, 0xfd, 0x80, 0x8f, 0xc7, 0xb4, 0xef, + 0xfe, 0x1f, 0x75, 0x7b, 0x7c, 0xc2, 0x84, 0x91, 0x2e, 0x80, 0xe2, 0x1e, 0x39, 0x88, 0xb8, 0xb5, + 0xc0, 0x67, 0x92, 0xe2, 0x7d, 0xb8, 0xf5, 0xf3, 0xd0, 0x1b, 0x84, 0xc6, 0x76, 0x01, 0x14, 0xd3, + 0x64, 0xf6, 0x80, 0x6f, 0xe1, 0xb6, 0x08, 0xbc, 0x1e, 0x75, 0xfd, 0xbe, 0xb1, 0x53, 0x00, 0xc5, + 0x4c, 0xed, 0x5b, 0x59, 0xf3, 0xef, 0xb7, 0x47, 0x95, 0x01, 0x5f, 0x69, 0xd3, 0x97, 0x87, 0x78, + 0x38, 0xa4, 0x3d, 0xc1, 0x83, 0xb2, 0xcf, 0x04, 0x0d, 0x98, 0x37, 0x2c, 0xf7, 0x3d, 0xe1, 0x95, + 0x3a, 0xd2, 0xc3, 0xa9, 0x93, 0xb4, 0x32, 0x73, 0xfa, 0xb8, 0x0d, 0xd3, 0xe1, 0xd8, 0x63, 0xd2, + 0x16, 0x2a, 0xdb, 0x57, 0x91, 0xad, 0xf9, 0x14, 0xdb, 0xf6, 0xd8, 0x63, 0x4e, 0x9d, 0xa4, 0xa4, + 0x95, 0xd3, 0x3f, 0xf9, 0x6d, 0x0b, 0x66, 0x97, 0xbf, 0x6a, 0x7c, 0x04, 0x0f, 0xdb, 0xf6, 0xad, + 0x4d, 0x9c, 0xce, 0x8f, 0x6e, 0xeb, 0xe6, 0xb2, 0x66, 0x13, 0xf7, 0xa6, 0xd5, 0xbe, 0xb6, 0xcf, + 0x9c, 0x86, 0x63, 0xd7, 0x51, 0x02, 0x7f, 0x04, 0x9f, 0xaf, 0x26, 0x74, 0x88, 0x75, 0x66, 0x23, + 0x80, 0x73, 0xf0, 0x20, 0x16, 0x99, 0x68, 0x43, 0xcb, 0x2a, 0x68, 0x53, 0xcb, 0xaa, 0x28, 0x19, + 0x57, 0xae, 0x6e, 0xd7, 0x6e, 0xce, 0xd1, 0x56, 0x9c, 0x4c, 0x21, 0x13, 0xa5, 0xb4, 0xac, 0x82, + 0xd2, 0x5a, 0x56, 0x45, 0xdb, 0xd8, 0x80, 0xfb, 0xab, 0xcc, 0x69, 0x35, 0xae, 0xd0, 0x4e, 0x5c, + 0x23, 0x92, 0x98, 0x08, 0xea, 0x50, 0x05, 0xed, 0xea, 0x50, 0x15, 0x65, 0xe2, 0x4a, 0x7d, 0x6f, + 0x91, 0x16, 0xda, 0x8b, 0x13, 0x49, 0x62, 0xa2, 0xac, 0x0e, 0x55, 0xd0, 0x33, 0x1d, 0xaa, 0x22, + 0x14, 0x87, 0x6c, 0x42, 0xae, 0x08, 0xfa, 0x20, 0x6e, 0x18, 0x0a, 0x99, 0x08, 0x6b, 0x59, 0x05, + 0x7d, 0xa8, 0x65, 0x55, 0xb4, 0x1f, 0x57, 0xae, 0x61, 0x75, 0xac, 0x26, 0x7a, 0x1e, 0x27, 0x53, + 0xc8, 0x44, 0x07, 0x5a, 0x56, 0x41, 0x2f, 0xb4, 0xac, 0x8a, 0x8c, 0x93, 0x1f, 0x60, 0x76, 0x71, + 0x2d, 0x36, 0xd4, 0x21, 0x3c, 0x82, 0x87, 0xcd, 0xab, 0x73, 0x97, 0xd8, 0x67, 0x57, 0xa4, 0xee, + 0x36, 0x9a, 0xd6, 0xf9, 0xca, 0x4b, 0xfc, 0x19, 0x2c, 0xac, 0x26, 0xa8, 0x37, 0x4e, 0x2d, 0xdb, + 0xee, 0xa5, 0xd5, 0xbe, 0x40, 0xff, 0x82, 0xda, 0x2f, 0xe0, 0xf5, 0x43, 0x1e, 0xbc, 0x79, 0xc8, + 0x83, 0x7f, 0x1e, 0xf2, 0xe0, 0xd7, 0xc7, 0x7c, 0xe2, 0xcd, 0x63, 0x3e, 0xf1, 0xd7, 0x63, 0x3e, + 0x01, 0xf3, 0x3e, 0x5f, 0x77, 0x83, 0xd6, 0xe4, 0x4d, 0x1d, 0x5e, 0xcb, 0xd0, 0x35, 0xf8, 0xe9, + 0xbb, 0x27, 0x9c, 0xd1, 0xd9, 0x2f, 0xf6, 0x80, 0xb2, 0xf9, 0x7f, 0x87, 0x6e, 0x4a, 0x45, 0x2a, + 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xd4, 0x39, 0x3e, 0x61, 0x08, 0x00, 0x00, } func (m *ResourceLogs) Marshal() (dAtA []byte, err error) { @@ -855,10 +854,7 @@ func (m *ResourceLogs) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogs } if (iNdEx + skippy) > l { @@ -975,10 +971,7 @@ func (m *InstrumentationLibraryLogs) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogs } if (iNdEx + skippy) > l { @@ -1283,10 +1276,7 @@ func (m *LogRecord) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthLogs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthLogs } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/metrics/v1/metrics.pb.go similarity index 94% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/metrics/v1/metrics.pb.go index 963162699df..344c895487e 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1/metrics.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/metrics/v1/metrics.pb.go @@ -14,8 +14,8 @@ import ( proto "github.com/gogo/protobuf/proto" go_opentelemetry_io_collector_internal_data "go.opentelemetry.io/collector/internal/data" - v11 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1" + v11 "go.opentelemetry.io/collector/internal/data/protogen/common/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/resource/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -911,7 +911,7 @@ type IntDataPoint struct { Value int64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` // (Optional) List of exemplars collected from // measurements that were used to form the data point - Exemplars []*IntExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Exemplars []IntExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars"` } func (m *IntDataPoint) Reset() { *m = IntDataPoint{} } @@ -975,7 +975,7 @@ func (m *IntDataPoint) GetValue() int64 { return 0 } -func (m *IntDataPoint) GetExemplars() []*IntExemplar { +func (m *IntDataPoint) GetExemplars() []IntExemplar { if m != nil { return m.Exemplars } @@ -1009,7 +1009,7 @@ type DoubleDataPoint struct { Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` // (Optional) List of exemplars collected from // measurements that were used to form the data point - Exemplars []*DoubleExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Exemplars []DoubleExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars"` } func (m *DoubleDataPoint) Reset() { *m = DoubleDataPoint{} } @@ -1073,7 +1073,7 @@ func (m *DoubleDataPoint) GetValue() float64 { return 0 } -func (m *DoubleDataPoint) GetExemplars() []*DoubleExemplar { +func (m *DoubleDataPoint) GetExemplars() []DoubleExemplar { if m != nil { return m.Exemplars } @@ -1138,7 +1138,7 @@ type IntHistogramDataPoint struct { ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` // (Optional) List of exemplars collected from // measurements that were used to form the data point - Exemplars []*IntExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Exemplars []IntExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars"` } func (m *IntHistogramDataPoint) Reset() { *m = IntHistogramDataPoint{} } @@ -1223,7 +1223,7 @@ func (m *IntHistogramDataPoint) GetExplicitBounds() []float64 { return nil } -func (m *IntHistogramDataPoint) GetExemplars() []*IntExemplar { +func (m *IntHistogramDataPoint) GetExemplars() []IntExemplar { if m != nil { return m.Exemplars } @@ -1288,7 +1288,7 @@ type DoubleHistogramDataPoint struct { ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` // (Optional) List of exemplars collected from // measurements that were used to form the data point - Exemplars []*DoubleExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + Exemplars []DoubleExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars"` } func (m *DoubleHistogramDataPoint) Reset() { *m = DoubleHistogramDataPoint{} } @@ -1373,7 +1373,7 @@ func (m *DoubleHistogramDataPoint) GetExplicitBounds() []float64 { return nil } -func (m *DoubleHistogramDataPoint) GetExemplars() []*DoubleExemplar { +func (m *DoubleHistogramDataPoint) GetExemplars() []DoubleExemplar { if m != nil { return m.Exemplars } @@ -1740,86 +1740,86 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xc1, 0x6b, 0x1b, 0x47, - 0x17, 0xd7, 0x4a, 0xb6, 0x2c, 0x3f, 0xc9, 0x92, 0xbf, 0x21, 0x9f, 0xb3, 0x18, 0xa2, 0x38, 0x4a, - 0x49, 0xdc, 0x24, 0x96, 0x88, 0x43, 0x42, 0x69, 0x29, 0x54, 0xb2, 0x14, 0x5b, 0x8d, 0xec, 0xa8, - 0x2b, 0xd9, 0x25, 0x25, 0xb0, 0xac, 0xb4, 0x53, 0x65, 0xe8, 0xee, 0x8c, 0xba, 0x3b, 0x6b, 0xec, - 0x6b, 0xa1, 0xb7, 0x42, 0x0b, 0x3d, 0xb5, 0xfd, 0x87, 0x72, 0xcc, 0xa1, 0x90, 0x52, 0x68, 0x28, - 0x09, 0xf4, 0xd2, 0x53, 0xef, 0x3d, 0x94, 0x99, 0xdd, 0xb5, 0x24, 0x7b, 0x6d, 0xc9, 0x4d, 0x0a, - 0x76, 0x6e, 0x6f, 0xde, 0xbc, 0xf7, 0x9b, 0xf7, 0x7e, 0xef, 0xcd, 0xdb, 0x91, 0xe0, 0x16, 0xeb, - 0x63, 0xca, 0xb1, 0x85, 0x6d, 0xcc, 0x9d, 0xfd, 0x52, 0xdf, 0x61, 0x9c, 0x95, 0x84, 0x4c, 0xba, - 0x6e, 0x69, 0xf7, 0x76, 0x28, 0x16, 0xe5, 0x06, 0xca, 0x8f, 0x58, 0xfb, 0xca, 0x62, 0x68, 0xb2, - 0x7b, 0x7b, 0xf1, 0x42, 0x8f, 0xf5, 0x98, 0x8f, 0x21, 0x24, 0xdf, 0x60, 0xf1, 0x46, 0xd4, 0x19, - 0x5d, 0x66, 0xdb, 0x8c, 0x8a, 0x23, 0x7c, 0x29, 0xb0, 0x2d, 0x46, 0xd9, 0x3a, 0xd8, 0x65, 0x9e, - 0xd3, 0xc5, 0xc2, 0x3a, 0x94, 0x7d, 0xfb, 0xc2, 0x1f, 0x0a, 0xe4, 0xb4, 0x40, 0xb5, 0xe9, 0x07, - 0x82, 0x1e, 0x40, 0x2a, 0xb4, 0x52, 0x95, 0x25, 0x65, 0x39, 0xbd, 0xfa, 0x6e, 0x31, 0x2a, 0xf0, - 0x03, 0xa8, 0xdd, 0xdb, 0xc5, 0x10, 0xa3, 0x32, 0xf5, 0xf4, 0xc5, 0xe5, 0x98, 0x76, 0x00, 0x80, - 0xbe, 0x56, 0xe0, 0x32, 0xa1, 0x2e, 0x77, 0x3c, 0x1b, 0x53, 0x6e, 0x70, 0xc2, 0xa8, 0x6e, 0x91, - 0x8e, 0x63, 0x38, 0xfb, 0x7a, 0x90, 0xb9, 0x1a, 0x5f, 0x4a, 0x2c, 0xa7, 0x57, 0x3f, 0x2c, 0x9e, - 0xcc, 0x4e, 0xb1, 0x3e, 0x0a, 0xd3, 0xf0, 0x51, 0x82, 0xa8, 0xb5, 0x4b, 0xe4, 0xa4, 0xed, 0xc2, - 0x73, 0x05, 0x2e, 0x9d, 0x08, 0x80, 0x38, 0x5c, 0x3c, 0x26, 0xd0, 0x80, 0x85, 0xbb, 0x91, 0x01, - 0x06, 0xf4, 0x1f, 0x1b, 0x5f, 0xc0, 0xc8, 0x42, 0x74, 0x78, 0xe8, 0x23, 0x98, 0x19, 0xa5, 0xe1, - 0xda, 0x38, 0x1a, 0xfc, 0x78, 0xb5, 0xd0, 0xad, 0xf0, 0xed, 0x34, 0x24, 0x7d, 0x1d, 0x42, 0x30, - 0x45, 0x0d, 0xdb, 0xaf, 0xda, 0xac, 0x26, 0x65, 0xb4, 0x04, 0x69, 0x13, 0xbb, 0x5d, 0x87, 0xf4, - 0xc5, 0xb1, 0x6a, 0x5c, 0x6e, 0x0d, 0xab, 0x84, 0x97, 0x47, 0x09, 0x57, 0x13, 0xbe, 0x97, 0x90, - 0xd1, 0x3a, 0xcc, 0x12, 0xca, 0xf5, 0x9e, 0xe1, 0xf5, 0xb0, 0x3a, 0x25, 0xd3, 0x5f, 0x1e, 0x5f, - 0x1f, 0xbe, 0x2e, 0xec, 0x37, 0x62, 0x5a, 0x8a, 0x04, 0x32, 0x6a, 0x42, 0xc6, 0x64, 0x5e, 0xc7, - 0xc2, 0x01, 0xd6, 0xb4, 0xc4, 0xba, 0x39, 0x0e, 0xab, 0x2a, 0x7d, 0x42, 0xb8, 0xb4, 0x39, 0x58, - 0xa2, 0x32, 0xcc, 0x88, 0xd0, 0x5c, 0xcf, 0x56, 0x93, 0x12, 0xec, 0xda, 0x04, 0x81, 0xb5, 0x3c, - 0x7b, 0x23, 0xa6, 0x25, 0x89, 0x94, 0xd0, 0xc7, 0x00, 0x41, 0x50, 0x02, 0x65, 0xe6, 0x84, 0x1e, - 0x3f, 0x12, 0x92, 0x0f, 0x34, 0x6b, 0x86, 0x0b, 0xd4, 0x82, 0x39, 0x11, 0xce, 0x13, 0xe2, 0x72, - 0xd6, 0x73, 0x0c, 0x5b, 0x4d, 0x49, 0xb8, 0x5b, 0x13, 0x04, 0xb5, 0x11, 0xfa, 0x6c, 0xc4, 0xb4, - 0x0c, 0x19, 0x5a, 0xa3, 0xc7, 0x30, 0x1f, 0x04, 0x38, 0xc0, 0x9d, 0x95, 0xb8, 0xa5, 0xc9, 0xc2, - 0x1c, 0x86, 0xce, 0x99, 0xa3, 0x2a, 0xb4, 0x03, 0xd9, 0x41, 0xfa, 0xb6, 0x68, 0xf0, 0xb4, 0xc4, - 0x5e, 0x99, 0x98, 0x02, 0xe1, 0xb4, 0x11, 0xd3, 0xe6, 0xcc, 0x61, 0x45, 0x25, 0x09, 0x53, 0xa6, - 0xc1, 0x8d, 0xc2, 0x23, 0x48, 0x85, 0xbd, 0x80, 0x36, 0x21, 0x2d, 0x74, 0x7a, 0x9f, 0x11, 0xca, - 0x5d, 0x55, 0x91, 0x3d, 0x3e, 0x09, 0x39, 0x55, 0x83, 0x1b, 0x4d, 0xe1, 0xa4, 0x81, 0x19, 0x8a, - 0x6e, 0x41, 0x87, 0xf4, 0x50, 0x6b, 0xa0, 0x66, 0x14, 0xfa, 0x84, 0x14, 0x45, 0x1f, 0xf0, 0xa7, - 0x02, 0x49, 0xbf, 0x5f, 0xde, 0x70, 0xe8, 0x88, 0xc1, 0x45, 0xa3, 0xd7, 0x73, 0x70, 0xcf, 0x9f, - 0x2d, 0x1c, 0xdb, 0x7d, 0xe6, 0x18, 0x16, 0xe1, 0xfb, 0xf2, 0x52, 0x66, 0x57, 0xef, 0x8d, 0x83, - 0x2e, 0x0f, 0xdc, 0xdb, 0x03, 0x6f, 0x6d, 0xc1, 0x88, 0xd4, 0xa3, 0x2b, 0x90, 0x21, 0xae, 0x6e, - 0x33, 0xca, 0x38, 0xa3, 0xa4, 0x2b, 0xef, 0x77, 0x4a, 0x4b, 0x13, 0x77, 0x33, 0x54, 0x15, 0xfe, - 0x52, 0x60, 0xf6, 0xa0, 0xa8, 0x6f, 0x9e, 0xcd, 0x33, 0x99, 0xf3, 0x73, 0x05, 0x32, 0xc3, 0x97, - 0x0f, 0xed, 0x44, 0xa5, 0x7d, 0xf7, 0x34, 0xf7, 0xf7, 0x6c, 0x24, 0x5f, 0xf8, 0x4d, 0x81, 0xdc, - 0xa1, 0xeb, 0x8f, 0x1e, 0x45, 0x25, 0xf7, 0xde, 0x29, 0x87, 0xc8, 0x19, 0xc9, 0xef, 0x09, 0xcc, - 0x8d, 0x4c, 0x20, 0xf4, 0x69, 0x54, 0x72, 0xf7, 0x4e, 0x35, 0xc5, 0xa2, 0xa7, 0xc0, 0xf7, 0x71, - 0xd9, 0x23, 0x07, 0x9b, 0xe8, 0x01, 0x24, 0x2d, 0xa3, 0x83, 0xad, 0xf0, 0x90, 0x95, 0x31, 0x6f, - 0x81, 0x16, 0x77, 0x08, 0xed, 0x3d, 0xc0, 0xfb, 0x3b, 0x86, 0xe5, 0x85, 0xaf, 0xa2, 0x00, 0x02, - 0x95, 0xe0, 0x82, 0xcb, 0x0d, 0x87, 0xeb, 0x9c, 0xd8, 0x58, 0xf7, 0x28, 0xd9, 0xd3, 0xa9, 0x41, - 0x99, 0x64, 0x2d, 0xa9, 0xfd, 0x4f, 0xee, 0xb5, 0x89, 0x8d, 0xb7, 0x29, 0xd9, 0xdb, 0x32, 0x28, - 0x43, 0xef, 0x40, 0xf6, 0x90, 0x69, 0x42, 0x9a, 0x66, 0xf8, 0xb0, 0xd5, 0x05, 0x98, 0xde, 0x15, - 0xa7, 0xc9, 0xef, 0xf5, 0xbc, 0xe6, 0x2f, 0x50, 0x1d, 0x66, 0xf1, 0x1e, 0xb6, 0xfb, 0x96, 0xe1, - 0xb8, 0xea, 0xb4, 0x0c, 0xfe, 0xe6, 0x04, 0xbd, 0x5d, 0x0b, 0x7c, 0xb4, 0x81, 0x77, 0xe1, 0x87, - 0x78, 0xd8, 0x5f, 0xe7, 0x98, 0x18, 0x25, 0x24, 0xa6, 0x71, 0x94, 0x98, 0xe2, 0x64, 0xad, 0x13, - 0xc5, 0xcd, 0xdf, 0x71, 0xf8, 0x7f, 0xe4, 0x48, 0x38, 0x2f, 0x0c, 0x75, 0x99, 0x47, 0xb9, 0x64, - 0x28, 0xa9, 0xf9, 0x0b, 0x34, 0x0f, 0x09, 0xf1, 0x3e, 0x9a, 0x96, 0xed, 0x24, 0x44, 0x74, 0x15, - 0xe6, 0x3a, 0x5e, 0xf7, 0x0b, 0xcc, 0x75, 0x69, 0xe1, 0xaa, 0xc9, 0xa5, 0x84, 0x00, 0xf3, 0x95, - 0x6b, 0x52, 0x87, 0xae, 0x43, 0x0e, 0xef, 0xf5, 0x2d, 0xd2, 0x25, 0x5c, 0xef, 0x30, 0x8f, 0x9a, - 0xae, 0x3a, 0xb3, 0x94, 0x58, 0x56, 0xb4, 0x6c, 0xa8, 0xae, 0x48, 0xed, 0x68, 0x6b, 0xa6, 0x5e, - 0xab, 0x35, 0xbf, 0x4a, 0x80, 0x7a, 0xdc, 0xd0, 0x7a, 0x3b, 0x2a, 0xa0, 0xfc, 0x17, 0x15, 0x68, - 0x1c, 0xad, 0xc0, 0x6b, 0xdc, 0x81, 0x1f, 0x13, 0xb0, 0x10, 0x3d, 0x5c, 0xdf, 0xaa, 0x12, 0x30, - 0xc8, 0x7d, 0xe9, 0x19, 0x94, 0x13, 0x0b, 0xeb, 0x72, 0x94, 0xf8, 0x45, 0x48, 0xaf, 0xde, 0xff, - 0x77, 0x5f, 0x9e, 0xa2, 0xcc, 0xb1, 0xcc, 0x3f, 0x09, 0x40, 0xb5, 0x6c, 0x08, 0x2f, 0x37, 0xdc, - 0xc5, 0x35, 0xc8, 0x1d, 0x32, 0x41, 0x8b, 0x90, 0x0a, 0x8d, 0xe4, 0xaf, 0x3d, 0x45, 0x3b, 0x58, - 0x0f, 0xc6, 0x5d, 0x7c, 0x68, 0xdc, 0x15, 0x7e, 0x8e, 0x43, 0x7a, 0xe8, 0xf2, 0xa0, 0xc7, 0x90, - 0xfb, 0x9c, 0x58, 0x1c, 0x3b, 0xd8, 0xd4, 0x5f, 0xbf, 0x34, 0xd9, 0x10, 0xab, 0xe1, 0x97, 0xe8, - 0x28, 0xe3, 0xf1, 0x93, 0x06, 0x73, 0x62, 0xf8, 0x8b, 0xd5, 0x82, 0x19, 0xb7, 0x6f, 0x50, 0x9d, - 0x98, 0xb2, 0x12, 0x99, 0xca, 0xfb, 0xe2, 0x88, 0x5f, 0x5f, 0x5c, 0x5e, 0xed, 0xb1, 0x43, 0xb1, - 0x11, 0x56, 0xea, 0x32, 0xcb, 0xc2, 0x5d, 0xce, 0x9c, 0x12, 0xa1, 0x1c, 0x3b, 0xd4, 0xb0, 0x4a, - 0xe2, 0x43, 0x5e, 0x6c, 0xf5, 0x0d, 0x5a, 0xaf, 0x6a, 0x49, 0x01, 0x55, 0x37, 0xd1, 0x0e, 0xa4, - 0xb8, 0x63, 0x74, 0xb1, 0x40, 0x9d, 0x96, 0xa8, 0x1f, 0x04, 0xa8, 0x77, 0x4e, 0x83, 0xda, 0x16, - 0x18, 0xf5, 0xaa, 0x36, 0x23, 0xc1, 0xea, 0x66, 0xe1, 0x79, 0x1c, 0xb2, 0xa3, 0x37, 0xe2, 0xec, - 0x31, 0xab, 0x9c, 0x47, 0x66, 0x6f, 0x7c, 0xa3, 0xc0, 0x42, 0xf4, 0x03, 0x11, 0x5d, 0x87, 0xab, - 0xe5, 0xf5, 0x75, 0xad, 0xb6, 0x5e, 0x6e, 0xd7, 0x1f, 0x6e, 0xe9, 0xed, 0xda, 0x66, 0xf3, 0xa1, - 0x56, 0x6e, 0xd4, 0xdb, 0x8f, 0xf4, 0xed, 0xad, 0x56, 0xb3, 0xb6, 0x56, 0xbf, 0x5f, 0xaf, 0x55, - 0xe7, 0x63, 0xe8, 0x0a, 0x5c, 0x3a, 0xce, 0xb0, 0x5a, 0x6b, 0xb4, 0xcb, 0xf3, 0x0a, 0xba, 0x06, - 0x85, 0xe3, 0x4c, 0xd6, 0xb6, 0x37, 0xb7, 0x1b, 0xe5, 0x76, 0x7d, 0xa7, 0x36, 0x1f, 0xaf, 0xfc, - 0xa4, 0x3c, 0x7d, 0x99, 0x57, 0x9e, 0xbd, 0xcc, 0x2b, 0xbf, 0xbf, 0xcc, 0x2b, 0xdf, 0xbd, 0xca, - 0xc7, 0x9e, 0xbd, 0xca, 0xc7, 0x7e, 0x79, 0x95, 0x8f, 0xc1, 0x15, 0xc2, 0xc6, 0xdc, 0xfc, 0x4a, - 0x26, 0xf8, 0x97, 0xa9, 0x29, 0x36, 0x9a, 0xca, 0x67, 0x5b, 0xa7, 0xa0, 0xa6, 0x34, 0x62, 0xb8, - 0x22, 0xb1, 0x57, 0x7a, 0x98, 0x0e, 0xfd, 0xcf, 0xd8, 0x49, 0x4a, 0xed, 0x9d, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x00, 0x76, 0x79, 0x73, 0x90, 0x14, 0x00, 0x00, + // 1257 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xda, 0x89, 0xe3, 0x3c, 0x3b, 0x76, 0x18, 0x95, 0x74, 0x15, 0xa9, 0x6e, 0xea, 0xa2, + 0x36, 0xf4, 0x87, 0xad, 0xa6, 0x6a, 0x85, 0x40, 0x08, 0x9c, 0xc4, 0x4d, 0x4c, 0x93, 0xd6, 0x4c, + 0x9c, 0xa0, 0xa2, 0x4a, 0xab, 0xb5, 0x77, 0x70, 0x47, 0xec, 0xce, 0x98, 0xdd, 0xd9, 0x28, 0xb9, + 0x22, 0x21, 0x71, 0xa8, 0x04, 0x57, 0xb8, 0xf0, 0xef, 0xf4, 0xd8, 0x03, 0x52, 0x11, 0x12, 0x15, + 0x6a, 0x25, 0x2e, 0x9c, 0xf8, 0x0f, 0xd0, 0xcc, 0xee, 0xc6, 0x76, 0xb2, 0x8e, 0x1d, 0x5a, 0xa4, + 0xb4, 0xb7, 0xb7, 0x6f, 0xde, 0x7c, 0xf3, 0xbd, 0xef, 0xbd, 0x79, 0xbb, 0x36, 0x5c, 0xe3, 0x5d, + 0xc2, 0x04, 0xb1, 0x89, 0x43, 0x84, 0xbb, 0x5f, 0xe9, 0xba, 0x5c, 0xf0, 0x8a, 0xb4, 0x69, 0xdb, + 0xab, 0xec, 0xde, 0x88, 0xcc, 0xb2, 0x5a, 0x40, 0xc5, 0x81, 0xe8, 0xc0, 0x59, 0x8e, 0x42, 0x76, + 0x6f, 0xcc, 0x9f, 0xe9, 0xf0, 0x0e, 0x0f, 0x30, 0xa4, 0x15, 0x04, 0xcc, 0x5f, 0x89, 0x3b, 0xa3, + 0xcd, 0x1d, 0x87, 0x33, 0x79, 0x44, 0x60, 0x85, 0xb1, 0xe5, 0xb8, 0x58, 0x97, 0x78, 0xdc, 0x77, + 0xdb, 0x44, 0x46, 0x47, 0x76, 0x10, 0x5f, 0xfa, 0x4b, 0x83, 0x02, 0x0e, 0x5d, 0x9b, 0x01, 0x11, + 0x74, 0x17, 0x32, 0x51, 0x94, 0xae, 0x2d, 0x68, 0x8b, 0xd9, 0xa5, 0xf7, 0xcb, 0x71, 0xc4, 0x0f, + 0xa0, 0x76, 0x6f, 0x94, 0x23, 0x8c, 0xe5, 0x89, 0x27, 0xcf, 0xcf, 0x27, 0xf0, 0x01, 0x00, 0xfa, + 0x4e, 0x83, 0xf3, 0x94, 0x79, 0xc2, 0xf5, 0x1d, 0xc2, 0x84, 0x29, 0x28, 0x67, 0x86, 0x4d, 0x5b, + 0xae, 0xe9, 0xee, 0x1b, 0x61, 0xe6, 0x7a, 0x72, 0x21, 0xb5, 0x98, 0x5d, 0xfa, 0xb8, 0x7c, 0xbc, + 0x3a, 0xe5, 0xfa, 0x20, 0xcc, 0x46, 0x80, 0x12, 0xb2, 0xc6, 0xe7, 0xe8, 0x71, 0xcb, 0xa5, 0x67, + 0x1a, 0x9c, 0x3b, 0x16, 0x00, 0x09, 0x38, 0x3b, 0x84, 0x68, 0xa8, 0xc2, 0xad, 0x58, 0x82, 0xa1, + 0xfc, 0x43, 0xf9, 0x85, 0x8a, 0xcc, 0xc5, 0xd3, 0x43, 0x9f, 0xc2, 0xd4, 0xa0, 0x0c, 0x97, 0x46, + 0xc9, 0x10, 0xf0, 0xc5, 0xd1, 0xb6, 0xd2, 0x0f, 0x93, 0x90, 0x0e, 0x7c, 0x08, 0xc1, 0x04, 0x33, + 0x9d, 0xa0, 0x6a, 0xd3, 0x58, 0xd9, 0x68, 0x01, 0xb2, 0x16, 0xf1, 0xda, 0x2e, 0xed, 0xca, 0x63, + 0xf5, 0xa4, 0x5a, 0xea, 0x77, 0xc9, 0x5d, 0x3e, 0xa3, 0x42, 0x4f, 0x05, 0xbb, 0xa4, 0x8d, 0xd6, + 0x60, 0x9a, 0x32, 0x61, 0x74, 0x4c, 0xbf, 0x43, 0xf4, 0x09, 0x95, 0xfe, 0xe2, 0xe8, 0xfa, 0x88, + 0x35, 0x19, 0xbf, 0x9e, 0xc0, 0x19, 0x1a, 0xda, 0xa8, 0x01, 0x39, 0x8b, 0xfb, 0x2d, 0x9b, 0x84, + 0x58, 0x93, 0x0a, 0xeb, 0xea, 0x28, 0xac, 0x55, 0xb5, 0x27, 0x82, 0xcb, 0x5a, 0xbd, 0x47, 0x54, + 0x85, 0x29, 0x49, 0xcd, 0xf3, 0x1d, 0x3d, 0xad, 0xc0, 0x2e, 0x8d, 0x41, 0x6c, 0xcb, 0x77, 0xd6, + 0x13, 0x38, 0x4d, 0x95, 0x85, 0x3e, 0x03, 0x08, 0x49, 0x49, 0x94, 0xa9, 0x63, 0x7a, 0xfc, 0x08, + 0xa5, 0x00, 0x68, 0xda, 0x8a, 0x1e, 0xd0, 0x16, 0xcc, 0x48, 0x3a, 0x8f, 0xa8, 0x27, 0x78, 0xc7, + 0x35, 0x1d, 0x3d, 0xa3, 0xe0, 0xae, 0x8d, 0x41, 0x6a, 0x3d, 0xda, 0xb3, 0x9e, 0xc0, 0x39, 0xda, + 0xf7, 0x8c, 0x1e, 0xc2, 0x6c, 0x48, 0xb0, 0x87, 0x3b, 0xad, 0x70, 0x2b, 0xe3, 0xd1, 0xec, 0x87, + 0x2e, 0x58, 0x83, 0x2e, 0xb4, 0x03, 0xf9, 0x5e, 0xfa, 0x8e, 0x6c, 0xf0, 0xac, 0xc2, 0xbe, 0x3e, + 0xb6, 0x04, 0x72, 0xd3, 0x7a, 0x02, 0xcf, 0x58, 0xfd, 0x8e, 0xe5, 0x34, 0x4c, 0x58, 0xa6, 0x30, + 0x4b, 0x0f, 0x20, 0x13, 0xf5, 0x02, 0xda, 0x84, 0xac, 0xf4, 0x19, 0x5d, 0x4e, 0x99, 0xf0, 0x74, + 0x4d, 0xf5, 0xf8, 0x38, 0xe2, 0xac, 0x9a, 0xc2, 0x6c, 0xc8, 0x4d, 0x18, 0xac, 0xc8, 0xf4, 0x4a, + 0x06, 0x64, 0xfb, 0x5a, 0x03, 0x35, 0xe2, 0xd0, 0xc7, 0x94, 0x28, 0xfe, 0x80, 0xbf, 0x35, 0x48, + 0x07, 0xfd, 0xf2, 0x9a, 0xa9, 0x23, 0x0e, 0x67, 0xcd, 0x4e, 0xc7, 0x25, 0x9d, 0x60, 0xb6, 0x08, + 0xe2, 0x74, 0xb9, 0x6b, 0xda, 0x54, 0xec, 0xab, 0x4b, 0x99, 0x5f, 0xba, 0x3d, 0x0a, 0xba, 0xda, + 0xdb, 0xde, 0xec, 0xed, 0xc6, 0x73, 0x66, 0xac, 0x1f, 0x5d, 0x80, 0x1c, 0xf5, 0x0c, 0x87, 0x33, + 0x2e, 0x38, 0xa3, 0x6d, 0x75, 0xbf, 0x33, 0x38, 0x4b, 0xbd, 0xcd, 0xc8, 0x55, 0xfa, 0x47, 0x83, + 0xe9, 0x83, 0xa2, 0xbe, 0x7e, 0x35, 0x4f, 0x65, 0xce, 0xcf, 0x34, 0xc8, 0xf5, 0x5f, 0x3e, 0xb4, + 0x13, 0x97, 0xf6, 0xad, 0x93, 0xdc, 0xdf, 0xd3, 0x91, 0x7c, 0xe9, 0x0f, 0x0d, 0x0a, 0x87, 0xae, + 0x3f, 0x7a, 0x10, 0x97, 0xdc, 0x07, 0x27, 0x1c, 0x22, 0xa7, 0x24, 0xbf, 0x47, 0x30, 0x33, 0x30, + 0x81, 0xd0, 0x17, 0x71, 0xc9, 0xdd, 0x3e, 0xd1, 0x14, 0x8b, 0x9f, 0x02, 0x3f, 0x25, 0x55, 0x8f, + 0x1c, 0x2c, 0xa2, 0xbb, 0x90, 0xb6, 0xcd, 0x16, 0xb1, 0xa3, 0x43, 0xae, 0x8f, 0xf8, 0x16, 0xd8, + 0x12, 0x2e, 0x65, 0x9d, 0xbb, 0x64, 0x7f, 0xc7, 0xb4, 0xfd, 0xe8, 0xab, 0x28, 0x84, 0x40, 0x15, + 0x38, 0xe3, 0x09, 0xd3, 0x15, 0x86, 0xa0, 0x0e, 0x31, 0x7c, 0x46, 0xf7, 0x0c, 0x66, 0x32, 0xae, + 0x54, 0x4b, 0xe3, 0x77, 0xd4, 0x5a, 0x93, 0x3a, 0x64, 0x9b, 0xd1, 0xbd, 0x7b, 0x26, 0xe3, 0xe8, + 0x3d, 0xc8, 0x1f, 0x0a, 0x4d, 0xa9, 0xd0, 0x9c, 0xe8, 0x8f, 0x3a, 0x03, 0x93, 0xbb, 0xf2, 0x34, + 0xf5, 0xbe, 0x9e, 0xc5, 0xc1, 0x03, 0xba, 0x0f, 0xd3, 0x64, 0x8f, 0x38, 0x5d, 0xdb, 0x74, 0x3d, + 0x7d, 0x52, 0x91, 0xbf, 0x3a, 0x46, 0x6f, 0xd7, 0xc2, 0x3d, 0x21, 0xf5, 0x1e, 0x46, 0xe9, 0x97, + 0x64, 0xd4, 0x65, 0x6f, 0xb0, 0x3c, 0x5a, 0x24, 0x0f, 0x3e, 0x2a, 0x4f, 0x79, 0xbc, 0x06, 0x1a, + 0xae, 0xd0, 0xb7, 0x29, 0x78, 0x37, 0x76, 0x3c, 0xbc, 0x29, 0x3a, 0xb5, 0xb9, 0xcf, 0x84, 0xd2, + 0x29, 0x8d, 0x83, 0x07, 0x34, 0x0b, 0x29, 0xf9, 0xad, 0x34, 0xa9, 0x5a, 0x4b, 0x9a, 0xe8, 0x22, + 0xcc, 0xb4, 0xfc, 0xf6, 0xd7, 0x44, 0x18, 0x2a, 0xc2, 0xd3, 0xd3, 0x0b, 0x29, 0x09, 0x16, 0x38, + 0x57, 0x94, 0x0f, 0x5d, 0x86, 0x02, 0xd9, 0xeb, 0xda, 0xb4, 0x4d, 0x85, 0xd1, 0xe2, 0x3e, 0xb3, + 0x3c, 0x7d, 0x6a, 0x21, 0xb5, 0xa8, 0xe1, 0x7c, 0xe4, 0x5e, 0x56, 0xde, 0xc1, 0x36, 0xcd, 0xbc, + 0x86, 0x36, 0xfd, 0x3e, 0x05, 0xfa, 0xb0, 0x31, 0xf6, 0x76, 0xd4, 0x41, 0xfb, 0x3f, 0xea, 0x80, + 0x8f, 0xd6, 0xe1, 0x95, 0xef, 0xc3, 0xcf, 0x29, 0x98, 0x8b, 0x1f, 0xba, 0x6f, 0x55, 0x21, 0x38, + 0x14, 0xbe, 0xf1, 0x4d, 0x26, 0xa8, 0x4d, 0x0c, 0x35, 0x5c, 0x82, 0x52, 0x64, 0x97, 0xee, 0xfc, + 0xb7, 0x37, 0x52, 0x59, 0xe5, 0x58, 0x15, 0x9f, 0x87, 0xa0, 0x38, 0x1f, 0xc1, 0xab, 0x05, 0x6f, + 0x7e, 0x05, 0x0a, 0x87, 0x42, 0xd0, 0x3c, 0x64, 0xa2, 0x20, 0xf5, 0x2b, 0x50, 0xc3, 0x07, 0xcf, + 0xbd, 0x01, 0x98, 0xec, 0x1b, 0x80, 0xa5, 0x5f, 0x93, 0x90, 0xed, 0xbb, 0x48, 0xe8, 0x21, 0x14, + 0xbe, 0xa2, 0xb6, 0x20, 0x2e, 0xb1, 0x8c, 0x57, 0x2f, 0x4d, 0x3e, 0xc2, 0xda, 0x08, 0x4a, 0x74, + 0x54, 0xf1, 0xe4, 0x71, 0xa3, 0x3a, 0xd5, 0xff, 0x26, 0xdb, 0x82, 0x29, 0xaf, 0x6b, 0x32, 0x83, + 0x5a, 0xaa, 0x12, 0xb9, 0xe5, 0x0f, 0xe5, 0x11, 0xbf, 0x3f, 0x3f, 0xbf, 0xd4, 0xe1, 0x87, 0xb8, + 0x51, 0x5e, 0x69, 0x73, 0xdb, 0x26, 0x6d, 0xc1, 0xdd, 0x0a, 0x65, 0x82, 0xb8, 0xcc, 0xb4, 0x2b, + 0xf2, 0x05, 0x5f, 0xde, 0xea, 0x9a, 0xac, 0xbe, 0x8a, 0xd3, 0x12, 0xaa, 0x6e, 0xa1, 0x1d, 0xc8, + 0x08, 0xd7, 0x6c, 0x13, 0x89, 0x3a, 0xa9, 0x50, 0x3f, 0x0a, 0x51, 0x6f, 0x9e, 0x04, 0xb5, 0x29, + 0x31, 0xea, 0xab, 0x78, 0x4a, 0x81, 0xd5, 0xad, 0xd2, 0xb3, 0x24, 0xe4, 0x07, 0xef, 0xc5, 0xe9, + 0x53, 0x56, 0x7b, 0x13, 0x95, 0xbd, 0xf2, 0x58, 0x83, 0xb9, 0xf8, 0x0f, 0x47, 0x74, 0x19, 0x2e, + 0x56, 0xd7, 0xd6, 0x70, 0x6d, 0xad, 0xda, 0xac, 0xdf, 0xbf, 0x67, 0x34, 0x6b, 0x9b, 0x8d, 0xfb, + 0xb8, 0xba, 0x51, 0x6f, 0x3e, 0x30, 0xb6, 0xef, 0x6d, 0x35, 0x6a, 0x2b, 0xf5, 0x3b, 0xf5, 0xda, + 0xea, 0x6c, 0x02, 0x5d, 0x80, 0x73, 0xc3, 0x02, 0x57, 0x6b, 0x1b, 0xcd, 0xea, 0xac, 0x86, 0x2e, + 0x41, 0x69, 0x58, 0xc8, 0xca, 0xf6, 0xe6, 0xf6, 0x46, 0xb5, 0x59, 0xdf, 0xa9, 0xcd, 0x26, 0x97, + 0x1f, 0x6b, 0x4f, 0x5e, 0x14, 0xb5, 0xa7, 0x2f, 0x8a, 0xda, 0x9f, 0x2f, 0x8a, 0xda, 0x8f, 0x2f, + 0x8b, 0x89, 0xa7, 0x2f, 0x8b, 0x89, 0xdf, 0x5e, 0x16, 0x13, 0x70, 0x81, 0xf2, 0x11, 0x37, 0x7f, + 0x39, 0x17, 0xfe, 0xfb, 0xd4, 0x90, 0x0b, 0x0d, 0xed, 0xcb, 0x4f, 0x4e, 0x20, 0x4d, 0xf0, 0xef, + 0x5e, 0x87, 0xb0, 0xbe, 0x3f, 0x1c, 0x5b, 0x69, 0xe5, 0xbc, 0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x25, 0x35, 0xe9, 0x7a, 0x99, 0x14, 0x00, 0x00, } func (m *ResourceMetrics) Marshal() (dAtA []byte, err error) { @@ -3609,10 +3609,7 @@ func (m *ResourceMetrics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -3729,10 +3726,7 @@ func (m *InstrumentationLibraryMetrics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4123,10 +4117,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4210,10 +4201,7 @@ func (m *IntGauge) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4297,10 +4285,7 @@ func (m *DoubleGauge) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4423,10 +4408,7 @@ func (m *IntSum) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4549,10 +4531,7 @@ func (m *DoubleSum) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4655,10 +4634,7 @@ func (m *IntHistogram) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4761,10 +4737,7 @@ func (m *DoubleHistogram) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4848,10 +4821,7 @@ func (m *DoubleSummary) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -4988,7 +4958,7 @@ func (m *IntDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Exemplars = append(m.Exemplars, &IntExemplar{}) + m.Exemplars = append(m.Exemplars, IntExemplar{}) if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4999,10 +4969,7 @@ func (m *IntDataPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -5140,7 +5107,7 @@ func (m *DoubleDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Exemplars = append(m.Exemplars, &DoubleExemplar{}) + m.Exemplars = append(m.Exemplars, DoubleExemplar{}) if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5151,10 +5118,7 @@ func (m *DoubleDataPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -5407,7 +5371,7 @@ func (m *IntHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Exemplars = append(m.Exemplars, &IntExemplar{}) + m.Exemplars = append(m.Exemplars, IntExemplar{}) if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5418,10 +5382,7 @@ func (m *IntHistogramDataPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -5675,7 +5636,7 @@ func (m *DoubleHistogramDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Exemplars = append(m.Exemplars, &DoubleExemplar{}) + m.Exemplars = append(m.Exemplars, DoubleExemplar{}) if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5686,10 +5647,7 @@ func (m *DoubleHistogramDataPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -5848,10 +5806,7 @@ func (m *DoubleSummaryDataPoint) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -5923,10 +5878,7 @@ func (m *DoubleSummaryDataPoint_ValueAtQuantile) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -6096,10 +6048,7 @@ func (m *IntExemplar) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { @@ -6270,10 +6219,7 @@ func (m *DoubleExemplar) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetrics } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1/resource.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/resource/v1/resource.pb.go similarity index 91% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1/resource.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/resource/v1/resource.pb.go index 519b6e0a7a4..95a287ab1cf 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1/resource.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/resource/v1/resource.pb.go @@ -12,7 +12,7 @@ import ( _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/common/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -91,7 +91,7 @@ func init() { } var fileDescriptor_446f73eacf88f3f5 = []byte{ - // 285 bytes of a gzipped FileDescriptorProto + // 280 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0xcb, 0x2f, 0x48, 0xcd, 0x2b, 0x49, 0xcd, 0x49, 0xcd, 0x4d, 0x2d, 0x29, 0xaa, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x2f, 0x4a, 0x2d, 0xce, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x2f, 0x33, 0x84, 0xb3, 0xf5, 0xc0, 0x52, @@ -103,13 +103,13 @@ var fileDescriptor_446f73eacf88f3f5 = []byte{ 0x95, 0x61, 0x89, 0x39, 0xa5, 0xa9, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x21, 0x19, 0x20, 0x64, 0xc1, 0x25, 0x91, 0x52, 0x94, 0x5f, 0x50, 0x90, 0x9a, 0x12, 0x8f, 0x10, 0x8d, 0x4f, 0xce, 0x2f, 0xcd, 0x2b, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x0d, 0x12, 0x83, 0xca, 0x3b, 0xc2, 0xa5, - 0x9d, 0x41, 0xb2, 0x4e, 0xf3, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, - 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x81, - 0x4b, 0x29, 0x33, 0x5f, 0x8f, 0x40, 0xb0, 0x38, 0xf1, 0xc2, 0x7c, 0x14, 0x00, 0x92, 0x0a, 0x60, - 0x8c, 0xf2, 0x4f, 0x47, 0xd7, 0x94, 0x09, 0x0a, 0x91, 0x9c, 0x9c, 0xd4, 0xe4, 0x92, 0xfc, 0x22, - 0xfd, 0xcc, 0xbc, 0x92, 0xd4, 0xa2, 0xbc, 0xc4, 0x1c, 0xfd, 0x94, 0xc4, 0x92, 0x44, 0x7d, 0x14, - 0x85, 0xba, 0x60, 0xd3, 0x75, 0xd3, 0x53, 0xf3, 0x90, 0x23, 0x2a, 0x89, 0x0d, 0x2c, 0x6c, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x4a, 0x6b, 0xf7, 0x11, 0xd2, 0x01, 0x00, 0x00, + 0x9d, 0x41, 0xb2, 0x4e, 0xfd, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, + 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0xc0, + 0xa5, 0x94, 0x99, 0xaf, 0x47, 0x20, 0x58, 0x9c, 0x78, 0x61, 0x3e, 0x0a, 0x00, 0x49, 0x05, 0x30, + 0x46, 0x39, 0xa4, 0xa3, 0x6b, 0xca, 0x04, 0x85, 0x48, 0x4e, 0x4e, 0x6a, 0x72, 0x49, 0x7e, 0x91, + 0x7e, 0x66, 0x5e, 0x49, 0x6a, 0x51, 0x5e, 0x62, 0x8e, 0x7e, 0x4a, 0x62, 0x49, 0x22, 0x24, 0xbc, + 0xd2, 0x53, 0xf3, 0x90, 0x63, 0x26, 0x89, 0x0d, 0x2c, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0x4e, 0x00, 0x89, 0x9d, 0xc3, 0x01, 0x00, 0x00, } func (m *Resource) Marshal() (dAtA []byte, err error) { @@ -277,10 +277,7 @@ func (m *Resource) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthResource - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthResource } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1/trace.pb.go b/vendor/go.opentelemetry.io/collector/internal/data/protogen/trace/v1/trace.pb.go similarity index 88% rename from vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1/trace.pb.go rename to vendor/go.opentelemetry.io/collector/internal/data/protogen/trace/v1/trace.pb.go index ca5f6e700a9..38bf594d79e 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1/trace.pb.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/protogen/trace/v1/trace.pb.go @@ -14,8 +14,8 @@ import ( proto "github.com/gogo/protobuf/proto" go_opentelemetry_io_collector_internal_data "go.opentelemetry.io/collector/internal/data" - v11 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1" - v1 "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1" + v11 "go.opentelemetry.io/collector/internal/data/protogen/common/v1" + v1 "go.opentelemetry.io/collector/internal/data/protogen/resource/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -391,7 +391,7 @@ type Span struct { DroppedLinksCount uint32 `protobuf:"varint,14,opt,name=dropped_links_count,json=droppedLinksCount,proto3" json:"dropped_links_count,omitempty"` // An optional final status for this span. Semantically when Status isn't set, it means // span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0). - Status *Status `protobuf:"bytes,15,opt,name=status,proto3" json:"status,omitempty"` + Status Status `protobuf:"bytes,15,opt,name=status,proto3" json:"status"` } func (m *Span) Reset() { *m = Span{} } @@ -504,11 +504,11 @@ func (m *Span) GetDroppedLinksCount() uint32 { return 0 } -func (m *Span) GetStatus() *Status { +func (m *Span) GetStatus() Status { if m != nil { return m.Status } - return nil + return Status{} } // Event is a time-stamped annotation of the span, consisting of user-supplied @@ -748,84 +748,84 @@ func init() { } var fileDescriptor_5c407ac9c675a601 = []byte{ - // 1227 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4f, 0x6f, 0xdb, 0xc6, - 0x13, 0x15, 0x6d, 0x49, 0x76, 0xc6, 0xb6, 0xcc, 0xec, 0xcf, 0xc9, 0x8f, 0x71, 0x1a, 0x59, 0x50, - 0xdd, 0x44, 0x49, 0x1a, 0xa9, 0x71, 0x50, 0x20, 0xfd, 0x87, 0x96, 0x22, 0xd7, 0x09, 0x61, 0x9a, - 0x14, 0x96, 0x94, 0x9b, 0xf6, 0xc2, 0x32, 0xe6, 0xd6, 0x20, 0x22, 0x91, 0x02, 0xb5, 0x32, 0x92, - 0x43, 0xbf, 0x43, 0x2f, 0x3d, 0xf4, 0x1b, 0x05, 0x05, 0x0a, 0xe4, 0x58, 0xa4, 0x6d, 0x50, 0xc4, - 0x5f, 0xa3, 0x87, 0x62, 0x97, 0x94, 0x6d, 0x19, 0xa2, 0x9c, 0xa0, 0xc8, 0xa5, 0x17, 0x63, 0x39, - 0xf3, 0xe6, 0xbd, 0xc7, 0x99, 0x59, 0xda, 0x86, 0x46, 0x3c, 0xa0, 0x11, 0xa3, 0x3d, 0xda, 0xa7, - 0x2c, 0x79, 0xd6, 0x1a, 0x24, 0x31, 0x8b, 0x5b, 0x2c, 0xf1, 0xf7, 0x69, 0xeb, 0xf0, 0x6e, 0x7a, - 0x68, 0x8a, 0x20, 0x7a, 0x6f, 0x02, 0x99, 0x06, 0x9b, 0x29, 0xe0, 0xf0, 0xee, 0xfa, 0xda, 0x41, - 0x7c, 0x10, 0xa7, 0xd5, 0xfc, 0x94, 0xa6, 0xd7, 0x6f, 0x4d, 0x63, 0xdf, 0x8f, 0xfb, 0xfd, 0x38, - 0xe2, 0xf4, 0xe9, 0x29, 0xc3, 0x36, 0xa7, 0x61, 0x13, 0x3a, 0x8c, 0x47, 0x49, 0x6a, 0x66, 0x7c, - 0x4e, 0xf1, 0xf5, 0xdf, 0x25, 0x58, 0x21, 0x59, 0xc8, 0x19, 0xf8, 0xd1, 0x10, 0xed, 0xc0, 0xe2, - 0x18, 0xa3, 0x48, 0x35, 0xa9, 0xb1, 0xb4, 0x75, 0xb3, 0x39, 0xcd, 0xf4, 0x31, 0xd1, 0xe1, 0xdd, - 0xe6, 0x98, 0xa1, 0x5d, 0x7c, 0xfe, 0x6a, 0xa3, 0x40, 0x8e, 0x09, 0xd0, 0x0f, 0x70, 0x2d, 0x8c, - 0x86, 0x2c, 0x19, 0xf5, 0x69, 0xc4, 0x7c, 0x16, 0xc6, 0x91, 0xd7, 0x0b, 0x1f, 0x27, 0x7e, 0xf2, - 0xcc, 0x1b, 0x72, 0x35, 0x65, 0xae, 0x36, 0xdf, 0x58, 0xda, 0xfa, 0xa4, 0x39, 0xab, 0x2d, 0x4d, - 0x63, 0x92, 0xc2, 0x4c, 0x19, 0x84, 0x5d, 0x72, 0x35, 0xcc, 0x4f, 0xd6, 0x7f, 0x95, 0xe0, 0xea, - 0x8c, 0x62, 0xc4, 0xe0, 0xff, 0x39, 0xf6, 0xb2, 0x57, 0xff, 0x78, 0xaa, 0xb1, 0xac, 0xe3, 0xb9, - 0xce, 0xb2, 0x36, 0x5c, 0x9e, 0x6e, 0x0d, 0xdd, 0x87, 0xd2, 0xe9, 0x97, 0xaf, 0xcf, 0x7e, 0x79, - 0xee, 0x94, 0xa4, 0x05, 0xf5, 0x3f, 0x96, 0xa1, 0xc8, 0x9f, 0xd1, 0x1e, 0x2c, 0x0a, 0x80, 0x17, - 0x06, 0xc2, 0xe9, 0x72, 0xfb, 0x33, 0x2e, 0xf9, 0xf2, 0xd5, 0xc6, 0xbd, 0x83, 0xf8, 0x0c, 0x5f, - 0xc8, 0x97, 0xa5, 0xd7, 0xa3, 0xfb, 0x2c, 0x4e, 0x5a, 0x61, 0xc4, 0x68, 0x12, 0xf9, 0xbd, 0x56, - 0xe0, 0x33, 0xbf, 0xe9, 0x72, 0x0e, 0x43, 0x27, 0x0b, 0x82, 0xcc, 0x08, 0x90, 0x03, 0x0b, 0x5c, - 0x89, 0xd3, 0xce, 0x09, 0xda, 0x4f, 0x33, 0xda, 0xad, 0xb7, 0xa1, 0xe5, 0x16, 0x0d, 0x9d, 0x94, - 0x39, 0x95, 0x11, 0xa0, 0x0d, 0x58, 0x4a, 0xcd, 0x0e, 0x99, 0xcf, 0xa8, 0x32, 0x5f, 0x93, 0x1a, - 0x17, 0x08, 0x88, 0x90, 0xc3, 0x23, 0xe8, 0x3b, 0xa8, 0x0c, 0xfc, 0x84, 0x46, 0xcc, 0x1b, 0x8b, - 0x17, 0xff, 0xb5, 0xf8, 0x72, 0xca, 0xe8, 0xa4, 0x16, 0x10, 0x14, 0x23, 0xbf, 0x4f, 0x95, 0x92, - 0xd0, 0x16, 0x67, 0xf4, 0x25, 0x14, 0x9f, 0x84, 0x51, 0xa0, 0x94, 0x6b, 0x52, 0xa3, 0xb2, 0x75, - 0xfb, 0xfc, 0x29, 0x88, 0x1f, 0x3b, 0x61, 0x14, 0x10, 0x51, 0x88, 0x5a, 0xb0, 0x36, 0x64, 0x7e, - 0xc2, 0x3c, 0x16, 0xf6, 0xa9, 0x37, 0x8a, 0xc2, 0xa7, 0x5e, 0xe4, 0x47, 0xb1, 0xb2, 0x50, 0x93, - 0x1a, 0x65, 0x72, 0x51, 0xe4, 0xdc, 0xb0, 0x4f, 0xbb, 0x51, 0xf8, 0xd4, 0xf2, 0xa3, 0x18, 0xdd, - 0x06, 0x44, 0xa3, 0xe0, 0x2c, 0x7c, 0x51, 0xc0, 0x57, 0x69, 0x14, 0x4c, 0x80, 0x77, 0x01, 0x7c, - 0xc6, 0x92, 0xf0, 0xf1, 0x88, 0xd1, 0xa1, 0x72, 0x41, 0xac, 0xca, 0x8d, 0x73, 0xd6, 0x71, 0x87, - 0x3e, 0xdb, 0xf3, 0x7b, 0xa3, 0xf1, 0x3d, 0x3c, 0x45, 0x80, 0xee, 0x83, 0x12, 0x24, 0xf1, 0x60, - 0x40, 0x03, 0xef, 0x24, 0xea, 0xed, 0xc7, 0xa3, 0x88, 0x29, 0x50, 0x93, 0x1a, 0x2b, 0xe4, 0x72, - 0x96, 0x57, 0x8f, 0xd3, 0x1a, 0xcf, 0xa2, 0xaf, 0xa0, 0x4c, 0x0f, 0x69, 0xc4, 0x86, 0xca, 0x92, - 0x30, 0xd1, 0x78, 0x83, 0x4e, 0x61, 0x5e, 0x40, 0xb2, 0x3a, 0xf4, 0x11, 0xac, 0x8d, 0xb5, 0xd3, - 0x48, 0xa6, 0xbb, 0x2c, 0x74, 0x51, 0x96, 0x13, 0x35, 0x99, 0xe6, 0x17, 0x50, 0xea, 0x85, 0xd1, - 0x93, 0xa1, 0xb2, 0x32, 0xe3, 0xbd, 0x27, 0x25, 0xcd, 0x30, 0x7a, 0x42, 0xd2, 0x2a, 0xd4, 0x84, - 0xff, 0x8d, 0x05, 0x45, 0x20, 0xd3, 0xab, 0x08, 0xbd, 0x8b, 0x59, 0x8a, 0x17, 0x64, 0x72, 0x9f, - 0x43, 0x99, 0xef, 0xe6, 0x68, 0xa8, 0xac, 0x8a, 0x6b, 0xbf, 0x79, 0x8e, 0x9e, 0xc0, 0x92, 0xac, - 0x66, 0xfd, 0x17, 0x09, 0x4a, 0xc2, 0x3c, 0xda, 0x84, 0xca, 0x99, 0xe1, 0x4a, 0x62, 0xb8, 0xcb, - 0xec, 0xf4, 0x64, 0xc7, 0xcb, 0x38, 0x77, 0x6a, 0x19, 0x27, 0xa7, 0x3d, 0xff, 0x2e, 0xa7, 0x5d, - 0x9c, 0x35, 0xed, 0xf5, 0x3f, 0xe7, 0xa0, 0xc8, 0x3b, 0xf3, 0x1f, 0xfb, 0xc4, 0x4c, 0xf6, 0xb7, - 0xf8, 0x2e, 0xfb, 0x5b, 0x9a, 0xd5, 0xdf, 0xfa, 0xcf, 0x12, 0x2c, 0x8e, 0xbf, 0x23, 0xe8, 0x0a, - 0x5c, 0x72, 0x3a, 0xaa, 0xe5, 0xed, 0x18, 0x96, 0xee, 0x75, 0x2d, 0xa7, 0x83, 0x35, 0x63, 0xdb, - 0xc0, 0xba, 0x5c, 0x40, 0x97, 0x01, 0x9d, 0xa4, 0x0c, 0xcb, 0xc5, 0xc4, 0x52, 0x4d, 0x59, 0x42, - 0x6b, 0x20, 0x9f, 0xc4, 0x1d, 0x4c, 0xf6, 0x30, 0x91, 0xe7, 0x26, 0xa3, 0x9a, 0x69, 0x60, 0xcb, - 0x95, 0xe7, 0x27, 0x39, 0x3a, 0xc4, 0xd6, 0xbb, 0x1a, 0x26, 0x72, 0x71, 0x32, 0xae, 0xd9, 0x96, - 0xd3, 0xdd, 0xc5, 0x44, 0x2e, 0xd5, 0xff, 0x5e, 0x80, 0x72, 0xba, 0xdb, 0xe8, 0x7b, 0x58, 0x0d, - 0xe8, 0x20, 0xa1, 0xfb, 0x3e, 0xa3, 0x81, 0xb7, 0x1f, 0x07, 0xe9, 0x1f, 0x03, 0x95, 0xf3, 0x7e, - 0x55, 0xa7, 0xe5, 0x4d, 0xfd, 0xb8, 0x36, 0x0d, 0x68, 0x71, 0x40, 0xdb, 0x73, 0x8a, 0x44, 0x2a, - 0x27, 0xac, 0x3c, 0x86, 0x14, 0x58, 0xe8, 0xd3, 0xe1, 0xd0, 0x3f, 0x18, 0x5f, 0x87, 0xf1, 0x23, - 0xd2, 0xa0, 0x28, 0x64, 0xe7, 0x85, 0x6c, 0xeb, 0x8d, 0x64, 0x4f, 0xc4, 0x88, 0x28, 0xae, 0xbf, - 0x2c, 0xc1, 0xda, 0x34, 0x2f, 0xe8, 0x1a, 0x5c, 0xd1, 0x71, 0x87, 0x60, 0x4d, 0x75, 0xb1, 0xee, - 0x39, 0xae, 0xea, 0x76, 0x1d, 0x4f, 0xb3, 0x75, 0xec, 0xd9, 0x3b, 0x72, 0x01, 0x6d, 0x42, 0x2d, - 0x27, 0xad, 0xa9, 0x96, 0x86, 0x4d, 0x13, 0xeb, 0xb2, 0x84, 0x1a, 0xb0, 0x99, 0x83, 0xea, 0x5a, - 0x3b, 0x96, 0xfd, 0xb5, 0xe5, 0x61, 0x42, 0x6c, 0x3e, 0x9f, 0xdb, 0x70, 0x23, 0x07, 0x69, 0x58, - 0x7b, 0xaa, 0x69, 0xe8, 0x9e, 0x4a, 0x1e, 0x74, 0x77, 0xd3, 0xb1, 0x7d, 0x08, 0x8d, 0x1c, 0xb0, - 0x8e, 0x55, 0xdd, 0x34, 0x2c, 0xec, 0xe1, 0x47, 0x1a, 0xc6, 0x3a, 0xd6, 0xe5, 0xe2, 0x0c, 0xab, - 0x96, 0xed, 0x7a, 0xdb, 0x76, 0xd7, 0xd2, 0xe5, 0x12, 0xba, 0x09, 0x1f, 0xe4, 0xa0, 0x54, 0x93, - 0x60, 0x55, 0xff, 0xc6, 0xc3, 0x8f, 0x0c, 0xc7, 0x75, 0xe4, 0xf2, 0x0c, 0xf9, 0x0e, 0x26, 0xbb, - 0x86, 0xe3, 0x18, 0xb6, 0xe5, 0xe9, 0xd8, 0xe2, 0x7b, 0xba, 0x80, 0xee, 0xc0, 0xcd, 0x1c, 0x34, - 0xc1, 0x8e, 0xdd, 0x25, 0x1a, 0x37, 0xfb, 0x50, 0xed, 0x3a, 0x2e, 0xd6, 0xe5, 0x45, 0xd4, 0x84, - 0x5b, 0x39, 0xf0, 0x6d, 0xd5, 0x30, 0x31, 0x5f, 0x53, 0xac, 0xd9, 0x96, 0x6e, 0xb8, 0x86, 0x6d, - 0xc9, 0x17, 0x50, 0x1d, 0xaa, 0x79, 0xbe, 0xdb, 0x36, 0xe1, 0x9c, 0x80, 0x6e, 0xc0, 0xfb, 0x79, - 0xb3, 0xec, 0xba, 0x9e, 0xbd, 0xed, 0x11, 0xd5, 0x7a, 0x80, 0xe5, 0xa5, 0x99, 0xf3, 0x32, 0x76, - 0x3b, 0x26, 0xe6, 0x03, 0xc0, 0xba, 0xbc, 0x3c, 0xa3, 0x5d, 0xe3, 0xab, 0x98, 0x8d, 0x76, 0x05, - 0x5d, 0x87, 0x7a, 0x2e, 0xa9, 0xba, 0xa7, 0x1a, 0xa6, 0xda, 0x36, 0xb1, 0x5c, 0x99, 0x31, 0x27, - 0x5d, 0x75, 0x55, 0xcf, 0xb4, 0x1d, 0x47, 0x5e, 0x45, 0xb7, 0xe0, 0x7a, 0x3e, 0x5b, 0xd7, 0x7d, - 0x88, 0x2d, 0xd7, 0x10, 0x39, 0x59, 0xae, 0x5b, 0x00, 0xa7, 0x36, 0xfa, 0x12, 0x5c, 0x9c, 0x84, - 0x3b, 0xd8, 0x95, 0x0b, 0x08, 0x41, 0xe5, 0xcc, 0x76, 0x4b, 0x67, 0xa1, 0xd9, 0x92, 0xb6, 0x7f, - 0x92, 0x9e, 0xbf, 0xae, 0x4a, 0x2f, 0x5e, 0x57, 0xa5, 0xbf, 0x5e, 0x57, 0xa5, 0x1f, 0x8f, 0xaa, - 0x85, 0x17, 0x47, 0xd5, 0xc2, 0x6f, 0x47, 0xd5, 0x02, 0x6c, 0x84, 0xf1, 0xcc, 0x0b, 0xd8, 0x06, - 0xf1, 0x9d, 0xef, 0xf0, 0x60, 0x47, 0xfa, 0xd6, 0x7c, 0x8b, 0x4f, 0x79, 0x6b, 0x02, 0x78, 0x47, - 0xf0, 0xde, 0x39, 0xa0, 0xd1, 0xf1, 0xff, 0x4f, 0x8f, 0xcb, 0x22, 0x76, 0xef, 0x9f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x9f, 0x4d, 0x03, 0x35, 0x66, 0x0d, 0x00, 0x00, + // 1224 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x41, 0x6f, 0xdb, 0x46, + 0x13, 0x15, 0x6d, 0x49, 0x76, 0xc6, 0xb6, 0xcc, 0xec, 0xe7, 0xe4, 0x63, 0x9c, 0x46, 0x16, 0x54, + 0x37, 0x51, 0x92, 0x56, 0x6a, 0x1c, 0x14, 0x48, 0x5b, 0x04, 0x2d, 0x45, 0xae, 0x13, 0xc2, 0x34, + 0x29, 0x2c, 0x29, 0x37, 0xed, 0x85, 0x65, 0xcc, 0xad, 0x41, 0x44, 0x22, 0x05, 0x6a, 0x65, 0x24, + 0x87, 0x5e, 0x7b, 0xee, 0xb5, 0xff, 0x28, 0x28, 0x50, 0x20, 0xc7, 0x22, 0x45, 0x83, 0xc2, 0xfe, + 0x1b, 0x3d, 0x14, 0xbb, 0xa4, 0x6c, 0xcb, 0x10, 0xe5, 0x04, 0x45, 0x2e, 0xbd, 0x18, 0xd4, 0xcc, + 0x9b, 0xf7, 0xde, 0xce, 0xcc, 0xd2, 0x12, 0x34, 0xe2, 0x01, 0x8d, 0x18, 0xed, 0xd1, 0x3e, 0x65, + 0xc9, 0x8b, 0xd6, 0x20, 0x89, 0x59, 0xdc, 0x62, 0x89, 0xbf, 0x4f, 0x5b, 0x87, 0xf7, 0xd2, 0x87, + 0xa6, 0x08, 0xa2, 0x0f, 0x26, 0x90, 0x69, 0xb0, 0x99, 0x02, 0x0e, 0xef, 0xad, 0xaf, 0x1d, 0xc4, + 0x07, 0x71, 0x5a, 0xcd, 0x9f, 0xd2, 0xf4, 0xfa, 0x9d, 0x69, 0xec, 0xfb, 0x71, 0xbf, 0x1f, 0x47, + 0x9c, 0x3e, 0x7d, 0xca, 0xb0, 0xcd, 0x69, 0xd8, 0x84, 0x0e, 0xe3, 0x51, 0x92, 0x9a, 0x19, 0x3f, + 0xa7, 0xf8, 0xfa, 0x1f, 0x12, 0xac, 0x90, 0x2c, 0xe4, 0x0c, 0xfc, 0x68, 0x88, 0x76, 0x60, 0x71, + 0x8c, 0x51, 0xa4, 0x9a, 0xd4, 0x58, 0xda, 0xba, 0xdd, 0x9c, 0x66, 0xfa, 0x84, 0xe8, 0xf0, 0x5e, + 0x73, 0xcc, 0xd0, 0x2e, 0xbe, 0x7c, 0xb3, 0x51, 0x20, 0x27, 0x04, 0xe8, 0x47, 0xb8, 0x11, 0x46, + 0x43, 0x96, 0x8c, 0xfa, 0x34, 0x62, 0x3e, 0x0b, 0xe3, 0xc8, 0xeb, 0x85, 0x4f, 0x13, 0x3f, 0x79, + 0xe1, 0x0d, 0xb9, 0x9a, 0x32, 0x57, 0x9b, 0x6f, 0x2c, 0x6d, 0x7d, 0xde, 0x9c, 0xd5, 0x96, 0xa6, + 0x31, 0x49, 0x61, 0xa6, 0x0c, 0xc2, 0x2e, 0xb9, 0x1e, 0xe6, 0x27, 0xeb, 0xbf, 0x49, 0x70, 0x7d, + 0x46, 0x31, 0x62, 0xf0, 0xff, 0x1c, 0x7b, 0xd9, 0xd1, 0x3f, 0x9b, 0x6a, 0x2c, 0xeb, 0x78, 0xae, + 0xb3, 0xac, 0x0d, 0x57, 0xa7, 0x5b, 0x43, 0x0f, 0xa0, 0x74, 0xf6, 0xf0, 0xf5, 0xd9, 0x87, 0xe7, + 0x4e, 0x49, 0x5a, 0x50, 0x3f, 0x5a, 0x86, 0x22, 0xff, 0x8c, 0xf6, 0x60, 0x51, 0x00, 0xbc, 0x30, + 0x10, 0x4e, 0x97, 0xdb, 0x5f, 0x72, 0xc9, 0xd7, 0x6f, 0x36, 0xee, 0x1f, 0xc4, 0xe7, 0xf8, 0x42, + 0xbe, 0x2c, 0xbd, 0x1e, 0xdd, 0x67, 0x71, 0xd2, 0x0a, 0x23, 0x46, 0x93, 0xc8, 0xef, 0xb5, 0x02, + 0x9f, 0xf9, 0x4d, 0x97, 0x73, 0x18, 0x3a, 0x59, 0x10, 0x64, 0x46, 0x80, 0x1c, 0x58, 0xe0, 0x4a, + 0x9c, 0x76, 0x4e, 0xd0, 0x7e, 0x91, 0xd1, 0x6e, 0xbd, 0x0b, 0x2d, 0xb7, 0x68, 0xe8, 0xa4, 0xcc, + 0xa9, 0x8c, 0x00, 0x6d, 0xc0, 0x52, 0x6a, 0x76, 0xc8, 0x7c, 0x46, 0x95, 0xf9, 0x9a, 0xd4, 0xb8, + 0x44, 0x40, 0x84, 0x1c, 0x1e, 0x41, 0xdf, 0x43, 0x65, 0xe0, 0x27, 0x34, 0x62, 0xde, 0x58, 0xbc, + 0xf8, 0xaf, 0xc5, 0x97, 0x53, 0x46, 0x27, 0xb5, 0x80, 0xa0, 0x18, 0xf9, 0x7d, 0xaa, 0x94, 0x84, + 0xb6, 0x78, 0x46, 0x5f, 0x41, 0xf1, 0x59, 0x18, 0x05, 0x4a, 0xb9, 0x26, 0x35, 0x2a, 0x5b, 0x77, + 0x2f, 0x9e, 0x82, 0xf8, 0xb3, 0x13, 0x46, 0x01, 0x11, 0x85, 0xa8, 0x05, 0x6b, 0x43, 0xe6, 0x27, + 0xcc, 0x63, 0x61, 0x9f, 0x7a, 0xa3, 0x28, 0x7c, 0xee, 0x45, 0x7e, 0x14, 0x2b, 0x0b, 0x35, 0xa9, + 0x51, 0x26, 0x97, 0x45, 0xce, 0x0d, 0xfb, 0xb4, 0x1b, 0x85, 0xcf, 0x2d, 0x3f, 0x8a, 0xd1, 0x5d, + 0x40, 0x34, 0x0a, 0xce, 0xc3, 0x17, 0x05, 0x7c, 0x95, 0x46, 0xc1, 0x04, 0x78, 0x17, 0xc0, 0x67, + 0x2c, 0x09, 0x9f, 0x8e, 0x18, 0x1d, 0x2a, 0x97, 0xc4, 0xaa, 0xdc, 0xba, 0x60, 0x1d, 0x77, 0xe8, + 0x8b, 0x3d, 0xbf, 0x37, 0x1a, 0xdf, 0xc3, 0x33, 0x04, 0xe8, 0x01, 0x28, 0x41, 0x12, 0x0f, 0x06, + 0x34, 0xf0, 0x4e, 0xa3, 0xde, 0x7e, 0x3c, 0x8a, 0x98, 0x02, 0x35, 0xa9, 0xb1, 0x42, 0xae, 0x66, + 0x79, 0xf5, 0x24, 0xad, 0xf1, 0x2c, 0xfa, 0x1a, 0xca, 0xf4, 0x90, 0x46, 0x6c, 0xa8, 0x2c, 0x09, + 0x13, 0x8d, 0xb7, 0xe8, 0x14, 0xe6, 0x05, 0x24, 0xab, 0x43, 0x9f, 0xc2, 0xda, 0x58, 0x3b, 0x8d, + 0x64, 0xba, 0xcb, 0x42, 0x17, 0x65, 0x39, 0x51, 0x93, 0x69, 0x3e, 0x84, 0x52, 0x2f, 0x8c, 0x9e, + 0x0d, 0x95, 0x95, 0x19, 0xe7, 0x9e, 0x94, 0x34, 0xc3, 0xe8, 0x19, 0x49, 0xab, 0x50, 0x13, 0xfe, + 0x37, 0x16, 0x14, 0x81, 0x4c, 0xaf, 0x22, 0xf4, 0x2e, 0x67, 0x29, 0x5e, 0x90, 0xc9, 0xb5, 0xa1, + 0xcc, 0x77, 0x73, 0x34, 0x54, 0x56, 0xc5, 0xb5, 0xdf, 0xbc, 0x40, 0x4f, 0x60, 0xb3, 0x26, 0x67, + 0x95, 0xeb, 0xbf, 0x4a, 0x50, 0x12, 0x47, 0x40, 0x9b, 0x50, 0x39, 0x37, 0x62, 0x49, 0x8c, 0x78, + 0x99, 0x9d, 0x9d, 0xef, 0x78, 0x25, 0xe7, 0xce, 0xac, 0xe4, 0xe4, 0xcc, 0xe7, 0xdf, 0xe7, 0xcc, + 0x8b, 0xb3, 0x66, 0xbe, 0xfe, 0xe7, 0x1c, 0x14, 0x79, 0x7f, 0xfe, 0x63, 0x2f, 0x9a, 0xc9, 0xfe, + 0x16, 0xdf, 0x67, 0x7f, 0x4b, 0xb3, 0xfa, 0x5b, 0xff, 0x45, 0x82, 0xc5, 0xf1, 0xdb, 0x04, 0x5d, + 0x83, 0x2b, 0x4e, 0x47, 0xb5, 0xbc, 0x1d, 0xc3, 0xd2, 0xbd, 0xae, 0xe5, 0x74, 0xb0, 0x66, 0x6c, + 0x1b, 0x58, 0x97, 0x0b, 0xe8, 0x2a, 0xa0, 0xd3, 0x94, 0x61, 0xb9, 0x98, 0x58, 0xaa, 0x29, 0x4b, + 0x68, 0x0d, 0xe4, 0xd3, 0xb8, 0x83, 0xc9, 0x1e, 0x26, 0xf2, 0xdc, 0x64, 0x54, 0x33, 0x0d, 0x6c, + 0xb9, 0xf2, 0xfc, 0x24, 0x47, 0x87, 0xd8, 0x7a, 0x57, 0xc3, 0x44, 0x2e, 0x4e, 0xc6, 0x35, 0xdb, + 0x72, 0xba, 0xbb, 0x98, 0xc8, 0xa5, 0xfa, 0xdf, 0x0b, 0x50, 0x4e, 0x37, 0x1c, 0xfd, 0x00, 0xab, + 0x01, 0x1d, 0x24, 0x74, 0xdf, 0x67, 0x34, 0xf0, 0xf6, 0xe3, 0x20, 0xfd, 0x4a, 0x50, 0xb9, 0xe8, + 0x1f, 0x76, 0x5a, 0xde, 0xd4, 0x4f, 0x6a, 0xd3, 0x80, 0x16, 0x07, 0xb4, 0x3d, 0xa7, 0x48, 0xa4, + 0x72, 0xca, 0xca, 0x63, 0x48, 0x81, 0x85, 0x3e, 0x1d, 0x0e, 0xfd, 0x83, 0xf1, 0x75, 0x18, 0x7f, + 0x44, 0x1a, 0x14, 0x85, 0xec, 0xbc, 0x90, 0x6d, 0xbd, 0x95, 0xec, 0xa9, 0x18, 0x11, 0xc5, 0xf5, + 0xd7, 0x25, 0x58, 0x9b, 0xe6, 0x05, 0xdd, 0x80, 0x6b, 0x3a, 0xee, 0x10, 0xac, 0xa9, 0x2e, 0xd6, + 0x3d, 0xc7, 0x55, 0xdd, 0xae, 0xe3, 0x69, 0xb6, 0x8e, 0x3d, 0x7b, 0x47, 0x2e, 0xa0, 0x4d, 0xa8, + 0xe5, 0xa4, 0x35, 0xd5, 0xd2, 0xb0, 0x69, 0x62, 0x5d, 0x96, 0x50, 0x03, 0x36, 0x73, 0x50, 0x5d, + 0x6b, 0xc7, 0xb2, 0xbf, 0xb1, 0x3c, 0x4c, 0x88, 0xcd, 0xe7, 0x73, 0x17, 0x6e, 0xe5, 0x20, 0x0d, + 0x6b, 0x4f, 0x35, 0x0d, 0xdd, 0x53, 0xc9, 0xa3, 0xee, 0x6e, 0x3a, 0xb6, 0x8f, 0xa1, 0x91, 0x03, + 0xd6, 0xb1, 0xaa, 0x9b, 0x86, 0x85, 0x3d, 0xfc, 0x44, 0xc3, 0x58, 0xc7, 0xba, 0x5c, 0x9c, 0x61, + 0xd5, 0xb2, 0x5d, 0x6f, 0xdb, 0xee, 0x5a, 0xba, 0x5c, 0x42, 0xb7, 0xe1, 0xa3, 0x1c, 0x94, 0x6a, + 0x12, 0xac, 0xea, 0xdf, 0x7a, 0xf8, 0x89, 0xe1, 0xb8, 0x8e, 0x5c, 0x9e, 0x21, 0xdf, 0xc1, 0x64, + 0xd7, 0x70, 0x1c, 0xc3, 0xb6, 0x3c, 0x1d, 0x5b, 0x7c, 0x4f, 0x17, 0xd0, 0x27, 0x70, 0x3b, 0x07, + 0x4d, 0xb0, 0x63, 0x77, 0x89, 0xc6, 0xcd, 0x3e, 0x56, 0xbb, 0x8e, 0x8b, 0x75, 0x79, 0x11, 0x35, + 0xe1, 0x4e, 0x0e, 0x7c, 0x5b, 0x35, 0x4c, 0xcc, 0xd7, 0x14, 0x6b, 0xb6, 0xa5, 0x1b, 0xae, 0x61, + 0x5b, 0xf2, 0x25, 0x54, 0x87, 0x6a, 0x9e, 0xef, 0xb6, 0x4d, 0x38, 0x27, 0xa0, 0x5b, 0xf0, 0x61, + 0xde, 0x2c, 0xbb, 0xae, 0x67, 0x6f, 0x7b, 0x44, 0xb5, 0x1e, 0x61, 0x79, 0x69, 0xe6, 0xbc, 0x8c, + 0xdd, 0x8e, 0x89, 0xf9, 0x00, 0xb0, 0x2e, 0x2f, 0xcf, 0x68, 0xd7, 0xf8, 0x2a, 0x66, 0xa3, 0x5d, + 0x41, 0x37, 0xa1, 0x9e, 0x4b, 0xaa, 0xee, 0xa9, 0x86, 0xa9, 0xb6, 0x4d, 0x2c, 0x57, 0x66, 0xcc, + 0x49, 0x57, 0x5d, 0xd5, 0x33, 0x6d, 0xc7, 0x91, 0x57, 0xd1, 0x1d, 0xb8, 0x99, 0xcf, 0xd6, 0x75, + 0x1f, 0x63, 0xcb, 0x35, 0x44, 0x4e, 0x96, 0xeb, 0x16, 0xc0, 0x99, 0x8d, 0xbe, 0x02, 0x97, 0x27, + 0xe1, 0x0e, 0x76, 0xe5, 0x02, 0x42, 0x50, 0x39, 0xb7, 0xdd, 0xd2, 0x79, 0x68, 0xb6, 0xa4, 0xed, + 0x9f, 0xa4, 0x97, 0x47, 0x55, 0xe9, 0xd5, 0x51, 0x55, 0xfa, 0xeb, 0xa8, 0x2a, 0xfd, 0x7c, 0x5c, + 0x2d, 0xbc, 0x3a, 0xae, 0x16, 0x7e, 0x3f, 0xae, 0x16, 0x60, 0x23, 0x8c, 0x67, 0x5e, 0xc0, 0x36, + 0x88, 0xf7, 0x7c, 0x87, 0x07, 0x3b, 0xd2, 0x77, 0x0f, 0xdf, 0xe1, 0x55, 0x9e, 0xfe, 0x52, 0x39, + 0xa0, 0xd1, 0xc9, 0xcf, 0xa6, 0xa7, 0x65, 0x11, 0xba, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x46, 0x9b, 0x55, 0x34, 0x5d, 0x0d, 0x00, 0x00, } func (m *ResourceSpans) Marshal() (dAtA []byte, err error) { @@ -942,18 +942,16 @@ func (m *Span) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTrace(dAtA, i, uint64(size)) + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x7a + i -= size + i = encodeVarintTrace(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x7a if m.DroppedLinksCount != 0 { i = encodeVarintTrace(dAtA, i, uint64(m.DroppedLinksCount)) i-- @@ -1340,10 +1338,8 @@ func (m *Span) Size() (n int) { if m.DroppedLinksCount != 0 { n += 1 + sovTrace(uint64(m.DroppedLinksCount)) } - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovTrace(uint64(l)) - } + l = m.Status.Size() + n += 1 + l + sovTrace(uint64(l)) return n } @@ -1525,10 +1521,7 @@ func (m *ResourceSpans) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { @@ -1645,10 +1638,7 @@ func (m *InstrumentationLibrarySpans) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { @@ -2082,9 +2072,6 @@ func (m *Span) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Status == nil { - m.Status = &Status{} - } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2095,10 +2082,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { @@ -2243,10 +2227,7 @@ func (m *Span_Event) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { @@ -2447,10 +2428,7 @@ func (m *Span_Link) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { @@ -2570,10 +2548,7 @@ func (m *Status) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthTrace - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthTrace } if (iNdEx + skippy) > l { diff --git a/vendor/go.opentelemetry.io/collector/internal/data/spanid.go b/vendor/go.opentelemetry.io/collector/internal/data/spanid.go index 0a9c1f605a0..8412d6e3d15 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/spanid.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/spanid.go @@ -36,7 +36,7 @@ func NewSpanID(bytes [8]byte) SpanID { // HexString returns hex representation of the ID. func (sid SpanID) HexString() string { - if !sid.IsValid() { + if sid.IsEmpty() { return "" } return hex.EncodeToString(sid.id[:]) @@ -44,7 +44,7 @@ func (sid SpanID) HexString() string { // Size returns the size of the data to serialize. func (sid *SpanID) Size() int { - if !sid.IsValid() { + if sid.IsEmpty() { return 0 } return spanIDSize @@ -56,8 +56,8 @@ func (sid SpanID) Equal(that SpanID) bool { } // IsValid returns true if id contains at least one non-zero byte. -func (sid SpanID) IsValid() bool { - return sid.id != [8]byte{} +func (sid SpanID) IsEmpty() bool { + return sid.id == [8]byte{} } // Bytes returns the byte array representation of the SpanID. @@ -67,7 +67,7 @@ func (sid SpanID) Bytes() [8]byte { // MarshalTo converts trace ID into a binary representation. Called by Protobuf serialization. func (sid *SpanID) MarshalTo(data []byte) (n int, err error) { - if !sid.IsValid() { + if sid.IsEmpty() { return 0, nil } return marshalBytes(data, sid.id[:]) @@ -90,7 +90,7 @@ func (sid *SpanID) Unmarshal(data []byte) error { // MarshalJSON converts SpanID into a hex string enclosed in quotes. func (sid SpanID) MarshalJSON() ([]byte, error) { - if !sid.IsValid() { + if sid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(sid.id[:]) diff --git a/vendor/go.opentelemetry.io/collector/internal/data/traceid.go b/vendor/go.opentelemetry.io/collector/internal/data/traceid.go index c3d7f2f2a02..da063f39323 100644 --- a/vendor/go.opentelemetry.io/collector/internal/data/traceid.go +++ b/vendor/go.opentelemetry.io/collector/internal/data/traceid.go @@ -38,7 +38,7 @@ func NewTraceID(bytes [16]byte) TraceID { // HexString returns hex representation of the ID. func (tid TraceID) HexString() string { - if !tid.IsValid() { + if tid.IsEmpty() { return "" } return hex.EncodeToString(tid.id[:]) @@ -46,7 +46,7 @@ func (tid TraceID) HexString() string { // Size returns the size of the data to serialize. func (tid *TraceID) Size() int { - if !tid.IsValid() { + if tid.IsEmpty() { return 0 } return traceIDSize @@ -58,8 +58,8 @@ func (tid TraceID) Equal(that TraceID) bool { } // IsValid returns true if id contains at leas one non-zero byte. -func (tid TraceID) IsValid() bool { - return tid.id != [16]byte{} +func (tid TraceID) IsEmpty() bool { + return tid.id == [16]byte{} } // Bytes returns the byte array representation of the TraceID. @@ -69,7 +69,7 @@ func (tid TraceID) Bytes() [16]byte { // MarshalTo converts trace ID into a binary representation. Called by Protobuf serialization. func (tid *TraceID) MarshalTo(data []byte) (n int, err error) { - if !tid.IsValid() { + if tid.IsEmpty() { return 0, nil } return marshalBytes(data, tid.id[:]) @@ -92,7 +92,7 @@ func (tid *TraceID) Unmarshal(data []byte) error { // MarshalJSON converts trace id into a hex string enclosed in quotes. func (tid TraceID) MarshalJSON() ([]byte, error) { - if !tid.IsValid() { + if tid.IsEmpty() { return []byte(`""`), nil } return marshalJSON(tid.id[:]) diff --git a/vendor/go.opentelemetry.io/collector/internal/middleware/compression.go b/vendor/go.opentelemetry.io/collector/internal/middleware/compression.go index 13504e80953..8b0f3cdd09e 100644 --- a/vendor/go.opentelemetry.io/collector/internal/middleware/compression.go +++ b/vendor/go.opentelemetry.io/collector/internal/middleware/compression.go @@ -15,12 +15,69 @@ package middleware import ( + "bytes" "compress/gzip" "compress/zlib" "io" "net/http" ) +const ( + headerContentEncoding = "Content-Encoding" + headerValueGZIP = "gzip" +) + +type CompressRoundTripper struct { + http.RoundTripper +} + +func NewCompressRoundTripper(rt http.RoundTripper) *CompressRoundTripper { + return &CompressRoundTripper{ + RoundTripper: rt, + } +} + +func (r *CompressRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + + if req.Header.Get(headerContentEncoding) != "" { + // If the header already specifies a content encoding then skip compression + // since we don't want to compress it again. This is a safeguard that normally + // should not happen since CompressRoundTripper is not intended to be used + // with http clients which already do their own compression. + return r.RoundTripper.RoundTrip(req) + } + + // Gzip the body. + buf := bytes.NewBuffer([]byte{}) + gzipWriter := gzip.NewWriter(buf) + _, copyErr := io.Copy(gzipWriter, req.Body) + closeErr := req.Body.Close() + + if err := gzipWriter.Close(); err != nil { + return nil, err + } + + if copyErr != nil { + return nil, copyErr + } + if closeErr != nil { + return nil, closeErr + } + + // Create a new request since the docs say that we cannot modify the "req" + // (see https://golang.org/pkg/net/http/#RoundTripper). + cReq, err := http.NewRequestWithContext(req.Context(), req.Method, req.URL.String(), buf) + if err != nil { + return nil, err + } + + // Clone the headers and add gzip encoding header. + cReq.Header = req.Header.Clone() + cReq.Header.Add(headerContentEncoding, headerValueGZIP) + + return r.RoundTripper.RoundTrip(cReq) +} + type ErrorHandler func(w http.ResponseWriter, r *http.Request, errorMsg string, statusCode int) type decompressor struct { diff --git a/vendor/go.opentelemetry.io/collector/internal/otlp_wrapper.go b/vendor/go.opentelemetry.io/collector/internal/otlp_wrapper.go index 5b1fa36bd09..f367322d7a5 100644 --- a/vendor/go.opentelemetry.io/collector/internal/otlp_wrapper.go +++ b/vendor/go.opentelemetry.io/collector/internal/otlp_wrapper.go @@ -14,7 +14,7 @@ package internal -import otlplogs "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1" +import otlplogs "go.opentelemetry.io/collector/internal/data/protogen/logs/v1" // OtlpLogsWrapper is an intermediary struct that is declared in an internal package // as a way to prevent certain functions of pdata.Logs data type to be callable by diff --git a/vendor/go.opentelemetry.io/collector/obsreport/doc.go b/vendor/go.opentelemetry.io/collector/obsreport/doc.go index e8124eedcdf..42798d83628 100644 --- a/vendor/go.opentelemetry.io/collector/obsreport/doc.go +++ b/vendor/go.opentelemetry.io/collector/obsreport/doc.go @@ -65,9 +65,8 @@ // * Data loss should be recorded only when the component itself remove the data // from the pipeline. Legacy metrics for receivers used "dropped" in their names // but these could be non-zero under normal operations and reflected no actual -// data loss when components like the "queued_retry" are used. New metrics -// were renamed to avoid this misunderstanding. Here are the general -// recommendations to report data loss: +// data loss when exporters with "sending_queue" are used. New metrics were renamed +// to avoid this misunderstanding. Here are the general recommendations to report data loss: // // * Receivers reporting errors to clients typically result in the client // re-sending the same data so it is more correct to report "receive errors", diff --git a/vendor/go.opentelemetry.io/collector/obsreport/obsreport_receiver.go b/vendor/go.opentelemetry.io/collector/obsreport/obsreport_receiver.go index 33148a03372..81ce50d8f59 100644 --- a/vendor/go.opentelemetry.io/collector/obsreport/obsreport_receiver.go +++ b/vendor/go.opentelemetry.io/collector/obsreport/obsreport_receiver.go @@ -110,7 +110,7 @@ type StartReceiveOption func(*StartReceiveOptions) // // Example: // -// func (r *receiver) ClientConnect(ctx context.Context, rcvChan <-chan consumerdata.TraceData) { +// func (r *receiver) ClientConnect(ctx context.Context, rcvChan <-chan pdata.Traces) { // longLivedCtx := obsreport.ReceiverContext(ctx, r.config.Name(), r.transport, "") // for { // // Since the context outlives the individual receive operations call obsreport using @@ -124,7 +124,7 @@ type StartReceiveOption func(*StartReceiveOptions) // td, ok := <-rcvChan // var err error // if ok { -// err = r.nextConsumer.ConsumeTraceData(ctx, td) +// err = r.nextConsumer.ConsumeTraces(ctx, td) // } // obsreport.EndTraceDataReceiveOp( // ctx, diff --git a/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/README.md b/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/README.md index 782716ee8c9..e30ef771eb8 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/README.md +++ b/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/README.md @@ -53,8 +53,8 @@ protocols: Several helper files are leveraged to provide additional capabilities automatically: -- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configgrpc/README.md) including CORS -- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configtls/README.md) +- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/README.md) including CORS +- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md) ## Remote Sampling @@ -77,7 +77,7 @@ receivers: protocols: grpc: remote_sampling: - fetch_endpoint: "jaeger-collector:1234" + host_endpoint: "jaeger-collector:1234" ``` Remote sampling can also be directly served by the collector by providing a diff --git a/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/trace_receiver.go b/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/trace_receiver.go index c88307b29ca..d1a06900bed 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/trace_receiver.go +++ b/vendor/go.opentelemetry.io/collector/receiver/jaegerreceiver/trace_receiver.go @@ -49,6 +49,7 @@ import ( "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/obsreport" jaegertranslator "go.opentelemetry.io/collector/translator/trace/jaeger" ) @@ -233,7 +234,7 @@ func (jr *jReceiver) Shutdown(context.Context) error { jr.grpc.Stop() jr.grpc = nil } - err = componenterror.CombineErrors(errs) + err = consumererror.CombineErrors(errs) }) return err diff --git a/vendor/go.opentelemetry.io/collector/receiver/kafkareceiver/otlp_unmarshaller.go b/vendor/go.opentelemetry.io/collector/receiver/kafkareceiver/otlp_unmarshaller.go index b73978606b2..9e63989ba2e 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/kafkareceiver/otlp_unmarshaller.go +++ b/vendor/go.opentelemetry.io/collector/receiver/kafkareceiver/otlp_unmarshaller.go @@ -16,7 +16,7 @@ package kafkareceiver import ( "go.opentelemetry.io/collector/consumer/pdata" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1" ) type otlpProtoUnmarshaller struct { diff --git a/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/README.md b/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/README.md index d119506cbc6..518eec38779 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/README.md +++ b/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/README.md @@ -25,9 +25,9 @@ The following settings are configurable: Several helper files are leveraged to provide additional capabilities automatically: -- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configgrpc/README.md) including CORS -- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configtls/README.md) -- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/exporterhelper/README.md) +- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/README.md) including CORS +- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md) +- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) ## Writing with HTTP/JSON diff --git a/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/octrace/opencensus.go b/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/octrace/opencensus.go index cf490841535..9185c60fd98 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/octrace/opencensus.go +++ b/vendor/go.opentelemetry.io/collector/receiver/opencensusreceiver/octrace/opencensus.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/collector/client" "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerdata" + "go.opentelemetry.io/collector/consumer/pdata" "go.opentelemetry.io/collector/obsreport" "go.opentelemetry.io/collector/translator/internaldata" ) @@ -136,31 +136,20 @@ func (ocr *Receiver) processReceivedMsg( resource = recv.Resource } - td := consumerdata.TraceData{ - Node: lastNonNilNode, - Resource: resource, - Spans: recv.Spans, - SourceFormat: "oc_trace", - } - + td := internaldata.OCToTraces(lastNonNilNode, resource, recv.Spans) err := ocr.sendToNextConsumer(longLivedRPCCtx, td) return lastNonNilNode, resource, err } -func (ocr *Receiver) sendToNextConsumer(longLivedRPCCtx context.Context, tracedata consumerdata.TraceData) error { +func (ocr *Receiver) sendToNextConsumer(longLivedRPCCtx context.Context, td pdata.Traces) error { ctx := obsreport.StartTraceDataReceiveOp( longLivedRPCCtx, ocr.instanceName, receiverTransport, obsreport.WithLongLivedCtx()) - var err error - numSpans := len(tracedata.Spans) - if numSpans != 0 { - err = ocr.nextConsumer.ConsumeTraces(ctx, internaldata.OCToTraceData(tracedata)) - } - - obsreport.EndTraceDataReceiveOp(ctx, receiverDataFormat, numSpans, err) + err := ocr.nextConsumer.ConsumeTraces(ctx, td) + obsreport.EndTraceDataReceiveOp(ctx, receiverDataFormat, td.SpanCount(), err) return err } diff --git a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/README.md b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/README.md index 259590ac00c..5eff4b51c80 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/README.md +++ b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/README.md @@ -1,7 +1,7 @@ # OTLP Receiver Receives data via gRPC or HTTP using [OTLP]( -https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/protocol/otlp.md) +https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md) format. Supported pipeline types: traces, metrics, logs @@ -33,9 +33,9 @@ The following settings are configurable: Several helper files are leveraged to provide additional capabilities automatically: -- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configgrpc/README.md) including CORS -- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configtls/README.md) -- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/exporterhelper/README.md) +- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/README.md) including CORS +- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md) +- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) ## Writing with HTTP/JSON @@ -52,7 +52,8 @@ port is `55681`. The HTTP/JSON endpoint can also optionally configure [CORS](https://fetch.spec.whatwg.org/#cors-protocol), which is enabled by -specifying a list of allowed CORS origins in the `cors_allowed_origins` field: +specifying a list of allowed CORS origins in the `cors_allowed_origins` +and optionally headers in `cors_allowed_headers`: ```yaml receivers: @@ -64,4 +65,6 @@ receivers: - http://test.com # Origins can have wildcards with *, use * by itself to match any origin. - https://*.example.com + cors_allowed_headers: + - TestHeader ``` diff --git a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/logs/otlp.go b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/logs/otlp.go index 149a1c110bd..ae9434893cd 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/logs/otlp.go +++ b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/logs/otlp.go @@ -21,7 +21,7 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/pdata" "go.opentelemetry.io/collector/internal" - collectorlog "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1" + collectorlog "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1" "go.opentelemetry.io/collector/obsreport" ) diff --git a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/metrics/otlp.go b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/metrics/otlp.go index c5a16f3ebf9..7b1bdfad1bf 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/metrics/otlp.go +++ b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/metrics/otlp.go @@ -20,7 +20,7 @@ import ( "go.opentelemetry.io/collector/client" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/pdata" - collectormetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1" + collectormetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1" "go.opentelemetry.io/collector/obsreport" ) diff --git a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/otlp.go b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/otlp.go index 6601e0ee84a..875ea52b350 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/otlp.go +++ b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/otlp.go @@ -30,9 +30,9 @@ import ( "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" - collectorlog "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1" - collectormetrics "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1" - collectortrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1" + collectorlog "go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1" + collectormetrics "go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1" + collectortrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1" "go.opentelemetry.io/collector/receiver/otlpreceiver/logs" "go.opentelemetry.io/collector/receiver/otlpreceiver/metrics" "go.opentelemetry.io/collector/receiver/otlpreceiver/trace" diff --git a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/trace/otlp.go b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/trace/otlp.go index dee90adaf75..6dd2d3cf887 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/trace/otlp.go +++ b/vendor/go.opentelemetry.io/collector/receiver/otlpreceiver/trace/otlp.go @@ -20,8 +20,8 @@ import ( "go.opentelemetry.io/collector/client" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/pdata" - collectortrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1" + collectortrace "go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1" "go.opentelemetry.io/collector/obsreport" ) @@ -55,28 +55,22 @@ func (r *Receiver) Export(ctx context.Context, req *collectortrace.ExportTraceSe ctxWithReceiverName := obsreport.ReceiverContext(ctx, r.instanceName, receiverTransport) // Perform backward compatibility conversion of Span Status code according to - // OTLP specification. - // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L231 - // - // If code==STATUS_CODE_UNSET then the value of `deprecated_code` is the - // carrier of the overall status according to these rules: - // - // if deprecated_code==DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret - // the overall status to be STATUS_CODE_UNSET. - // - // if deprecated_code!=DEPRECATED_STATUS_CODE_OK then the receiver MUST interpret - // the overall status to be STATUS_CODE_ERROR. - // - // If code!=STATUS_CODE_UNSET then the value of `deprecated_code` MUST be - // ignored, the `code` field is the sole carrier of the status. + // OTLP specification as we are a new receiver and sender (we are pushing data to the pipelines): + // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L239 + // See https://github.com/open-telemetry/opentelemetry-proto/blob/59c488bfb8fb6d0458ad6425758b70259ff4a2bd/opentelemetry/proto/trace/v1/trace.proto#L253 for _, rss := range req.ResourceSpans { for _, ils := range rss.InstrumentationLibrarySpans { for _, span := range ils.Spans { - if span.Status != nil { - if span.Status.Code == otlptrace.Status_STATUS_CODE_UNSET && - span.Status.DeprecatedCode != otlptrace.Status_DEPRECATED_STATUS_CODE_OK { + switch span.Status.Code { + case otlptrace.Status_STATUS_CODE_UNSET: + if span.Status.DeprecatedCode != otlptrace.Status_DEPRECATED_STATUS_CODE_OK { span.Status.Code = otlptrace.Status_STATUS_CODE_ERROR } + case otlptrace.Status_STATUS_CODE_OK: + // If status code is set then overwrites deprecated. + span.Status.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_OK + case otlptrace.Status_STATUS_CODE_ERROR: + span.Status.DeprecatedCode = otlptrace.Status_DEPRECATED_STATUS_CODE_UNKNOWN_ERROR } } } diff --git a/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/README.md b/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/README.md index 9c73ad6d53f..019d29bc344 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/README.md +++ b/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/README.md @@ -24,6 +24,6 @@ The following settings are configurable: Several helper files are leveraged to provide additional capabilities automatically: -- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configgrpc/README.md) including CORS -- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/config/configtls/README.md) -- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/exporterhelper/README.md) +- [gRPC settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/README.md) including CORS +- [TLS and mTLS settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md) +- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) diff --git a/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/trace_receiver.go b/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/trace_receiver.go index dec39db0a96..796a76467fe 100644 --- a/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/trace_receiver.go +++ b/vendor/go.opentelemetry.io/collector/receiver/zipkinreceiver/trace_receiver.go @@ -27,8 +27,7 @@ import ( "strings" "sync" - "github.com/apache/thrift/lib/go/thrift" - "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" + jaegerzipkin "github.com/jaegertracing/jaeger/model/converter/thrift/zipkin" zipkinmodel "github.com/openzipkin/zipkin-go/model" "github.com/openzipkin/zipkin-go/proto/zipkin_proto3" @@ -117,7 +116,7 @@ func (zr *ZipkinReceiver) Start(ctx context.Context, host component.Host) error // v1ToTraceSpans parses Zipkin v1 JSON traces and converts them to OpenCensus Proto spans. func (zr *ZipkinReceiver) v1ToTraceSpans(blob []byte, hdr http.Header) (reqs pdata.Traces, err error) { if hdr.Get("Content-Type") == "application/x-thrift" { - zSpans, err := deserializeThrift(blob) + zSpans, err := jaegerzipkin.DeserializeThrift(blob) if err != nil { return pdata.NewTraces(), err } @@ -127,34 +126,6 @@ func (zr *ZipkinReceiver) v1ToTraceSpans(blob []byte, hdr http.Header) (reqs pda return zipkin.V1JSONBatchToInternalTraces(blob, zr.config.ParseStringTags) } -// deserializeThrift decodes Thrift bytes to a list of spans. -// This code comes from jaegertracing/jaeger, ideally we should have imported -// it but this was creating many conflicts so brought the code to here. -// https://github.com/jaegertracing/jaeger/blob/6bc0c122bfca8e737a747826ae60a22a306d7019/model/converter/thrift/zipkin/deserialize.go#L36 -func deserializeThrift(b []byte) ([]*zipkincore.Span, error) { - buffer := thrift.NewTMemoryBuffer() - buffer.Write(b) - - transport := thrift.NewTBinaryProtocolTransport(buffer) - _, size, err := transport.ReadListBegin() // Ignore the returned element type - if err != nil { - return nil, err - } - - // We don't depend on the size returned by ReadListBegin to preallocate the array because it - // sometimes returns a nil error on bad input and provides an unreasonably large int for size - var spans []*zipkincore.Span - for i := 0; i < size; i++ { - zs := &zipkincore.Span{} - if err = zs.Read(transport); err != nil { - return nil, err - } - spans = append(spans, zs) - } - - return spans, nil -} - // v2ToTraceSpans parses Zipkin v2 JSON or Protobuf traces and converts them to OpenCensus Proto spans. func (zr *ZipkinReceiver) v2ToTraceSpans(blob []byte, hdr http.Header) (reqs pdata.Traces, err error) { // This flag's reference is from: diff --git a/vendor/go.opentelemetry.io/collector/translator/conventions/aws.go b/vendor/go.opentelemetry.io/collector/translator/conventions/aws.go new file mode 100644 index 00000000000..733c3cc569e --- /dev/null +++ b/vendor/go.opentelemetry.io/collector/translator/conventions/aws.go @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package conventions + +// OpenTelemetry semantic convention values for AWS-specific resource attributes +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud_provider/aws/README.md +const ( + AttributeAWSECSContainerARN = "aws.ecs.container.arn" + AttributeAWSECSClusterARN = "aws.ecs.cluster.arn" + AttributeAWSECSLaunchType = "aws.ecs.launchtype" + AttributeAWSECSTaskARN = "aws.ecs.task.arn" + AttributeAWSECSTaskFamily = "aws.ecs.task.family" + AttributeAWSLogGroupNames = "aws.log.group.names" + AttributeAWSLogGroupARNs = "aws.log.group.arns" + AttributeAWSLogStreamNames = "aws.log.stream.names" + AttributeAWSLogStreamARNs = "aws.log.stream.arns" +) + +// OpenTelemetry Semantic Convention values for Resource attribute "aws.ecs.launchtype" values. +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud_provider/aws/ecs.md +const ( + AttributeAWSECSLaunchTypeEC2 = "ec2" + AttributeAWSECSLaunchTypeFargate = "fargate" +) diff --git a/vendor/go.opentelemetry.io/collector/translator/conventions/opentelemetry.go b/vendor/go.opentelemetry.io/collector/translator/conventions/opentelemetry.go index 3f3b81cdf55..2cb6b4d27f8 100644 --- a/vendor/go.opentelemetry.io/collector/translator/conventions/opentelemetry.go +++ b/vendor/go.opentelemetry.io/collector/translator/conventions/opentelemetry.go @@ -15,64 +15,67 @@ package conventions // OpenTelemetry Semantic Convention values for Resource attribute names. -// See: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions/README.md +// See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions/README.md const ( - AttributeCloudAccount = "cloud.account.id" - AttributeCloudProvider = "cloud.provider" - AttributeCloudRegion = "cloud.region" - AttributeCloudZone = "cloud.zone" - AttributeContainerID = "container.id" - AttributeContainerImage = "container.image.name" - AttributeContainerName = "container.name" - AttributeContainerTag = "container.image.tag" - AttributeDeploymentEnvironment = "deployment.environment" - AttributeFaasID = "faas.id" - AttributeFaasInstance = "faas.instance" - AttributeFaasName = "faas.name" - AttributeFaasVersion = "faas.version" - AttributeHostID = "host.id" - AttributeHostImageID = "host.image.id" - AttributeHostImageName = "host.image.name" - AttributeHostImageVersion = "host.image.version" - AttributeHostName = "host.name" - AttributeHostType = "host.type" - AttributeK8sCluster = "k8s.cluster.name" - AttributeK8sContainer = "k8s.container.name" - AttributeK8sCronJob = "k8s.cronjob.name" - AttributeK8sCronJobUID = "k8s.cronjob.uid" - AttributeK8sDaemonSet = "k8s.daemonset.name" - AttributeK8sDaemonSetUID = "k8s.daemonset.uid" - AttributeK8sDeployment = "k8s.deployment.name" - AttributeK8sDeploymentUID = "k8s.deployment.uid" - AttributeK8sJob = "k8s.job.name" - AttributeK8sJobUID = "k8s.job.uid" - AttributeK8sNamespace = "k8s.namespace.name" - AttributeK8sPod = "k8s.pod.name" - AttributeK8sPodUID = "k8s.pod.uid" - AttributeK8sReplicaSet = "k8s.replicaset.name" - AttributeK8sReplicaSetUID = "k8s.replicaset.uid" - AttributeK8sStatefulSet = "k8s.statefulset.name" - AttributeK8sStatefulSetUID = "k8s.statefulset.uid" - AttributeOSType = "os.type" - AttributeOSDescription = "os.description" - AttributeProcessCommand = "process.command" - AttributeProcessCommandLine = "process.command_line" - AttributeProcessExecutableName = "process.executable.name" - AttributeProcessExecutablePath = "process.executable.path" - AttributeProcessID = "process.pid" - AttributeProcessOwner = "process.owner" - AttributeServiceInstance = "service.instance.id" - AttributeServiceName = "service.name" - AttributeServiceNamespace = "service.namespace" - AttributeServiceVersion = "service.version" - AttributeTelemetryAutoVersion = "telemetry.auto.version" - AttributeTelemetrySDKLanguage = "telemetry.sdk.language" - AttributeTelemetrySDKName = "telemetry.sdk.name" - AttributeTelemetrySDKVersion = "telemetry.sdk.version" + AttributeCloudAccount = "cloud.account.id" + AttributeCloudProvider = "cloud.provider" + AttributeCloudRegion = "cloud.region" + AttributeCloudZone = "cloud.zone" + AttributeCloudInfrastructureService = "cloud.infrastructure_service" + AttributeContainerID = "container.id" + AttributeContainerImage = "container.image.name" + AttributeContainerName = "container.name" + AttributeContainerTag = "container.image.tag" + AttributeDeploymentEnvironment = "deployment.environment" + AttributeFaasID = "faas.id" + AttributeFaasInstance = "faas.instance" + AttributeFaasName = "faas.name" + AttributeFaasVersion = "faas.version" + AttributeHostID = "host.id" + AttributeHostImageID = "host.image.id" + AttributeHostImageName = "host.image.name" + AttributeHostImageVersion = "host.image.version" + AttributeHostName = "host.name" + AttributeHostType = "host.type" + AttributeK8sCluster = "k8s.cluster.name" + AttributeK8sContainer = "k8s.container.name" + AttributeK8sCronJob = "k8s.cronjob.name" + AttributeK8sCronJobUID = "k8s.cronjob.uid" + AttributeK8sDaemonSet = "k8s.daemonset.name" + AttributeK8sDaemonSetUID = "k8s.daemonset.uid" + AttributeK8sDeployment = "k8s.deployment.name" + AttributeK8sDeploymentUID = "k8s.deployment.uid" + AttributeK8sJob = "k8s.job.name" + AttributeK8sJobUID = "k8s.job.uid" + AttributeK8sNamespace = "k8s.namespace.name" + AttributeK8sNodeName = "k8s.node.name" + AttributeK8sNodeUID = "k8s.node.uid" + AttributeK8sPod = "k8s.pod.name" + AttributeK8sPodUID = "k8s.pod.uid" + AttributeK8sReplicaSet = "k8s.replicaset.name" + AttributeK8sReplicaSetUID = "k8s.replicaset.uid" + AttributeK8sStatefulSet = "k8s.statefulset.name" + AttributeK8sStatefulSetUID = "k8s.statefulset.uid" + AttributeOSType = "os.type" + AttributeOSDescription = "os.description" + AttributeProcessCommand = "process.command" + AttributeProcessCommandLine = "process.command_line" + AttributeProcessExecutableName = "process.executable.name" + AttributeProcessExecutablePath = "process.executable.path" + AttributeProcessID = "process.pid" + AttributeProcessOwner = "process.owner" + AttributeServiceInstance = "service.instance.id" + AttributeServiceName = "service.name" + AttributeServiceNamespace = "service.namespace" + AttributeServiceVersion = "service.version" + AttributeTelemetryAutoVersion = "telemetry.auto.version" + AttributeTelemetrySDKLanguage = "telemetry.sdk.language" + AttributeTelemetrySDKName = "telemetry.sdk.name" + AttributeTelemetrySDKVersion = "telemetry.sdk.version" ) // OpenTelemetry Semantic Convention values for Resource attribute "telemetry.sdk.language" values. -// See: https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions/README.md +// See: https://github.com/open-telemetry/opentelemetry-specification/tree/main/specification/resource/semantic_conventions/README.md const ( AttributeSDKLangValueCPP = "cpp" AttributeSDKLangValueDotNET = "dotnet" @@ -87,13 +90,33 @@ const ( ) // OpenTelemetry Semantic Convention values for Resource attribute "cloud.provider" values. -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/cloud.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md const ( AttributeCloudProviderAWS = "aws" AttributeCloudProviderAzure = "azure" AttributeCloudProviderGCP = "gcp" ) +// OpenTelemetry Semantic Convention values for Resource attribute "cloud.infrastructure_service" values. +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md +const ( + AttributeCloudProviderAWSEC2 = "aws_ec2" + AttributeCloudProviderAWSECS = "aws_ecs" + AttributeCloudProviderAWSEKS = "aws_eks" + AttributeCloudProviderAWSLambda = "aws_lambda" + AttributeCloudProviderAWSElasticBeanstalk = "aws_elastic_beanstalk" + AttributeCloudProviderAzureVM = "azure_vm" + AttributeCloudProviderAzureContainerInstances = "azure_container_instances" + AttributeCloudProviderAzureAKS = "azure_aks" + AttributeCloudProviderAzureFunctions = "azure_functions" + AttributeCloudProviderAzureAppService = "azure_app_service" + AttributeCloudProviderGCPComputeEngine = "gcp_compute_engine" + AttributeCloudProviderGCPCloudRun = "gcp_cloud_run" + AttributeCloudProviderGCPGKE = "gcp_gke" + AttributeCloudProviderGCPCloudFunctions = "gcp_cloud_functions" + AttributeCloudProviderGCPAppEngine = "gcp_app_engine" +) + // GetResourceSemanticConventionAttributeNames a slice with all the Resource Semantic Conventions attribute names. func GetResourceSemanticConventionAttributeNames() []string { return []string{ @@ -101,6 +124,7 @@ func GetResourceSemanticConventionAttributeNames() []string { AttributeCloudProvider, AttributeCloudRegion, AttributeCloudZone, + AttributeCloudInfrastructureService, AttributeContainerID, AttributeContainerImage, AttributeContainerName, @@ -127,6 +151,8 @@ func GetResourceSemanticConventionAttributeNames() []string { AttributeK8sJob, AttributeK8sJobUID, AttributeK8sNamespace, + AttributeK8sNodeName, + AttributeK8sNodeUID, AttributeK8sPod, AttributeK8sPodUID, AttributeK8sReplicaSet, @@ -153,7 +179,7 @@ func GetResourceSemanticConventionAttributeNames() []string { } // OpenTelemetry Semantic Convention values for general Span attribute names. -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/span-general.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/span-general.md const ( AttributeComponent = "component" AttributeEnduserID = "enduser.id" @@ -177,7 +203,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for HTTP related attributes -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md const ( AttributeHTTPClientIP = "http.client_ip" AttributeHTTPFlavor = "http.flavor" @@ -200,7 +226,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for database related attributes -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/database.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/database.md const ( AttributeDBConnectionString = "db.connection_string" @@ -219,7 +245,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for gRPC related attributes -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/rpc.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md const ( AttributeMessageCompressedSize = "message.compressed_size" AttributeMessageID = "message.id" @@ -234,7 +260,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for FaaS related attributes -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/faas.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md const ( AttributeFaaSCron = "faas.cron" AttributeFaaSDocumentCollection = "faas.document.collection" @@ -252,7 +278,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for messaging system related attributes -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md const ( AttributeMessagingConversationID = "messaging.conversation_id" AttributeMessagingDestination = "messaging.destination" @@ -269,7 +295,7 @@ const ( ) // OpenTelemetry Semantic Convention attribute names for exceptions -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/exceptions.md const ( AttributeExceptionEventName = "exception" AttributeExceptionMessage = "exception.message" diff --git a/vendor/go.opentelemetry.io/collector/translator/internaldata/oc_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/internaldata/oc_to_traces.go index fca65899146..d5bb5a7c3ae 100644 --- a/vendor/go.opentelemetry.io/collector/translator/internaldata/oc_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/internaldata/oc_to_traces.go @@ -18,30 +18,29 @@ import ( "strings" occommon "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1" + ocresource "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" octrace "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1" "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/wrapperspb" - "go.opentelemetry.io/collector/consumer/consumerdata" "go.opentelemetry.io/collector/consumer/pdata" "go.opentelemetry.io/collector/translator/conventions" tracetranslator "go.opentelemetry.io/collector/translator/trace" ) -// OCToTraceData converts OC data format to Traces. -// Deprecated: use pdata.Traces instead. OCToTraceData may be used only by OpenCensus -// receiver and exporter implementations. -func OCToTraceData(td consumerdata.TraceData) pdata.Traces { +// OCToTraces may be used only by OpenCensus receiver and exporter implementations. +// Deprecated: use pdata.Traces instead. +func OCToTraces(node *occommon.Node, resource *ocresource.Resource, spans []*octrace.Span) pdata.Traces { traceData := pdata.NewTraces() - if td.Node == nil && td.Resource == nil && len(td.Spans) == 0 { + if node == nil && resource == nil && len(spans) == 0 { return traceData } - if len(td.Spans) == 0 { + if len(spans) == 0 { // At least one of the td.Node or td.Resource is not nil. Set the resource and return. rss := traceData.ResourceSpans() rss.Resize(1) - ocNodeResourceToInternal(td.Node, td.Resource, rss.At(0).Resource()) + ocNodeResourceToInternal(node, resource, rss.At(0).Resource()) return traceData } @@ -67,7 +66,7 @@ func OCToTraceData(td consumerdata.TraceData) pdata.Traces { // in one slice. combinedSpanCount := 0 distinctResourceCount := 0 - for _, ocSpan := range td.Spans { + for _, ocSpan := range spans { if ocSpan == nil { // Skip nil spans. continue @@ -84,7 +83,7 @@ func OCToTraceData(td consumerdata.TraceData) pdata.Traces { rss := traceData.ResourceSpans() rss.Resize(distinctResourceCount + 1) rs0 := rss.At(0) - ocNodeResourceToInternal(td.Node, td.Resource, rs0.Resource()) + ocNodeResourceToInternal(node, resource, rs0.Resource()) // Allocate a slice for spans that need to be combined into first ResourceSpans. ilss := rs0.InstrumentationLibrarySpans() @@ -100,7 +99,7 @@ func OCToTraceData(td consumerdata.TraceData) pdata.Traces { combinedSpanIdx := 0 // First ResourceSpans is used for the default resource, so start with 1. resourceSpanIdx := 1 - for _, ocSpan := range td.Spans { + for _, ocSpan := range spans { if ocSpan == nil { // Skip nil spans. continue @@ -115,7 +114,7 @@ func OCToTraceData(td consumerdata.TraceData) pdata.Traces { } else { // This span has a different Resource and must be placed in a different // ResourceSpans instance. Create a separate ResourceSpans item just for this span. - ocSpanToResourceSpans(ocSpan, td.Node, traceData.ResourceSpans().At(resourceSpanIdx)) + ocSpanToResourceSpans(ocSpan, node, traceData.ResourceSpans().At(resourceSpanIdx)) resourceSpanIdx++ } } @@ -177,19 +176,13 @@ func ocStatusToInternal(ocStatus *octrace.Status, ocAttrs *octrace.Span_Attribut if ocStatus == nil { return } - dest.InitEmpty() var code pdata.StatusCode switch ocStatus.Code { case trace.StatusCodeOK: code = pdata.StatusCodeUnset - - case trace.StatusCodeUnknown: - // It is an error. - fallthrough - default: - // all other OC status codes are also errors. + // all other OC status codes are errors. code = pdata.StatusCodeError } diff --git a/vendor/go.opentelemetry.io/collector/translator/internaldata/resource_to_oc.go b/vendor/go.opentelemetry.io/collector/translator/internaldata/resource_to_oc.go index 565a94d4e50..55a40dc3a48 100644 --- a/vendor/go.opentelemetry.io/collector/translator/internaldata/resource_to_oc.go +++ b/vendor/go.opentelemetry.io/collector/translator/internaldata/resource_to_oc.go @@ -39,23 +39,23 @@ type ocInferredResourceType struct { // NOTE: defined in the priority order (first match wins) var labelPresenceToResourceType = []ocInferredResourceType{ { - // See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/container.md + // See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/container.md labelKeyPresent: conventions.AttributeContainerName, resourceType: resourcekeys.ContainerType, }, { - // See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/k8s.md#pod + // See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/k8s.md#pod labelKeyPresent: conventions.AttributeK8sPod, // NOTE: OpenCensus is using "k8s" rather than "k8s.pod" for Pod resourceType: resourcekeys.K8SType, }, { - // See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/host.md + // See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md labelKeyPresent: conventions.AttributeHostName, resourceType: resourcekeys.HostType, }, { - // See https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/cloud.md + // See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/cloud.md labelKeyPresent: conventions.AttributeCloudProvider, resourceType: resourcekeys.CloudType, }, @@ -111,9 +111,6 @@ func internalResourceToOC(resource pdata.Resource) (*occommon.Node, *ocresource. } getProcessIdentifier(ocNode).Pid = uint32(pid) case conventions.AttributeTelemetrySDKVersion: - if ocNode.LibraryInfo == nil { - ocNode.LibraryInfo = &occommon.LibraryInfo{} - } getLibraryInfo(ocNode).CoreLibraryVersion = val case conventions.OCAttributeExporterVersion: getLibraryInfo(ocNode).ExporterVersion = val diff --git a/vendor/go.opentelemetry.io/collector/translator/internaldata/traces_to_oc.go b/vendor/go.opentelemetry.io/collector/translator/internaldata/traces_to_oc.go index 98c3f072862..e9b47c41278 100644 --- a/vendor/go.opentelemetry.io/collector/translator/internaldata/traces_to_oc.go +++ b/vendor/go.opentelemetry.io/collector/translator/internaldata/traces_to_oc.go @@ -18,48 +18,29 @@ import ( "fmt" "strings" + occommon "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1" + ocresource "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" octrace "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1" "go.opencensus.io/trace" "google.golang.org/protobuf/types/known/wrapperspb" - "go.opentelemetry.io/collector/consumer/consumerdata" "go.opentelemetry.io/collector/consumer/pdata" "go.opentelemetry.io/collector/translator/conventions" tracetranslator "go.opentelemetry.io/collector/translator/trace" ) -const sourceFormat = "otlp_trace" - var ( defaultProcessID = 0 ) -// TraceDataToOC may be used only by OpenCensus receiver and exporter implementations. +// ResourceSpansToOC may be used only by OpenCensus receiver and exporter implementations. +// Deprecated: Use pdata.Traces. // TODO: move this function to OpenCensus package. -func TraceDataToOC(td pdata.Traces) []consumerdata.TraceData { - resourceSpans := td.ResourceSpans() - - if resourceSpans.Len() == 0 { - return nil - } - - ocResourceSpansList := make([]consumerdata.TraceData, 0, resourceSpans.Len()) - - for i := 0; i < resourceSpans.Len(); i++ { - ocResourceSpansList = append(ocResourceSpansList, resourceSpansToOC(resourceSpans.At(i))) - } - - return ocResourceSpansList -} - -func resourceSpansToOC(rs pdata.ResourceSpans) consumerdata.TraceData { - ocTraceData := consumerdata.TraceData{ - SourceFormat: sourceFormat, - } - ocTraceData.Node, ocTraceData.Resource = internalResourceToOC(rs.Resource()) +func ResourceSpansToOC(rs pdata.ResourceSpans) (*occommon.Node, *ocresource.Resource, []*octrace.Span) { + node, resource := internalResourceToOC(rs.Resource()) ilss := rs.InstrumentationLibrarySpans() if ilss.Len() == 0 { - return ocTraceData + return node, resource, nil } // Approximate the number of the spans as the number of the spans in the first // instrumentation library info. @@ -72,8 +53,7 @@ func resourceSpansToOC(rs pdata.ResourceSpans) consumerdata.TraceData { ocSpans = append(ocSpans, spanToOC(spans.At(j))) } } - ocTraceData.Spans = ocSpans - return ocTraceData + return node, resource, ocSpans } func spanToOC(span pdata.Span) *octrace.Span { @@ -370,7 +350,7 @@ func linksToOC(links pdata.SpanLinkSlice, droppedCount uint32) *octrace.Span_Lin } func traceIDToOC(tid pdata.TraceID) []byte { - if !tid.IsValid() { + if tid.IsEmpty() { return nil } tidBytes := tid.Bytes() @@ -378,7 +358,7 @@ func traceIDToOC(tid pdata.TraceID) []byte { } func spanIDToOC(sid pdata.SpanID) []byte { - if !sid.IsValid() { + if sid.IsEmpty() { return nil } sidBytes := sid.Bytes() @@ -386,10 +366,6 @@ func spanIDToOC(sid pdata.SpanID) []byte { } func statusToOC(status pdata.SpanStatus) (*octrace.Status, *octrace.AttributeValue) { - if status.IsNil() { - return nil, nil - } - var attr *octrace.AttributeValue var oc int32 switch status.Code() { diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/big_endian_converter.go b/vendor/go.opentelemetry.io/collector/translator/trace/big_endian_converter.go index 25daea54e6d..f5411b9b759 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/big_endian_converter.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/big_endian_converter.go @@ -20,8 +20,7 @@ import ( "go.opentelemetry.io/collector/consumer/pdata" ) -// UInt64ToByteTraceID takes a two uint64 representation of a TraceID and -// converts it to a []byte representation. +// UInt64ToTraceID converts the pair of uint64 representation of a TraceID to pdata.TraceID. func UInt64ToTraceID(high, low uint64) pdata.TraceID { traceID := [16]byte{} binary.BigEndian.PutUint64(traceID[:8], high) @@ -29,79 +28,21 @@ func UInt64ToTraceID(high, low uint64) pdata.TraceID { return pdata.NewTraceID(traceID) } -// UInt64ToByteTraceID takes a two uint64 representation of a TraceID and -// converts it to a []byte representation. -func UInt64ToByteTraceID(high, low uint64) [16]byte { - traceID := [16]byte{} - binary.BigEndian.PutUint64(traceID[:8], high) - binary.BigEndian.PutUint64(traceID[8:], low) - return traceID -} - -// Int64ToByteTraceID takes a two int64 representation of a TraceID and -// converts it to a []byte representation. -func Int64ToTraceID(high, low int64) pdata.TraceID { - return UInt64ToTraceID(uint64(high), uint64(low)) -} - -// Int64ToByteTraceID takes a two int64 representation of a TraceID and -// converts it to a []byte representation. -func Int64ToByteTraceID(high, low int64) [16]byte { - return UInt64ToByteTraceID(uint64(high), uint64(low)) -} - -// BytesToUInt64TraceID takes a []byte representation of a TraceID and -// converts it to a two uint64 representation. -func BytesToUInt64TraceID(traceID [16]byte) (uint64, uint64) { - return binary.BigEndian.Uint64(traceID[:8]), binary.BigEndian.Uint64(traceID[8:]) -} - -// BytesToInt64TraceID takes a []byte representation of a TraceID and -// converts it to a two int64 representation. -func BytesToInt64TraceID(traceID [16]byte) (int64, int64) { - traceIDHigh, traceIDLow := BytesToUInt64TraceID(traceID) - return int64(traceIDHigh), int64(traceIDLow) -} - -// TraceIDToUInt64Pair takes a pdata.TraceID and converts it to a pair of uint64 representation. +// TraceIDToUInt64Pair converts the pdata.TraceID to a pair of uint64 representation. func TraceIDToUInt64Pair(traceID pdata.TraceID) (uint64, uint64) { - return BytesToUInt64TraceID(traceID.Bytes()) + bytes := traceID.Bytes() + return binary.BigEndian.Uint64(bytes[:8]), binary.BigEndian.Uint64(bytes[8:]) } -// UInt64ToByteSpanID takes a uint64 representation of a SpanID and -// converts it to a []byte representation. -func UInt64ToByteSpanID(id uint64) [8]byte { +// UInt64ToSpanID converts the uint64 representation of a SpanID to pdata.SpanID. +func UInt64ToSpanID(id uint64) pdata.SpanID { spanID := [8]byte{} binary.BigEndian.PutUint64(spanID[:], id) - return spanID -} - -// UInt64ToSpanID takes a uint64 representation of a SpanID and -// converts it to a pdata.SpanID representation. -func UInt64ToSpanID(id uint64) pdata.SpanID { - return pdata.NewSpanID(UInt64ToByteSpanID(id)) -} - -// Int64ToByteSpanID takes a int64 representation of a SpanID and -// converts it to a []byte representation. -func Int64ToByteSpanID(id int64) [8]byte { - return UInt64ToByteSpanID(uint64(id)) -} - -// Int64ToByteSpanID takes a int64 representation of a SpanID and -// converts it to a []byte representation. -func Int64ToSpanID(id int64) pdata.SpanID { - return UInt64ToSpanID(uint64(id)) -} - -// BytesToUInt64SpanID takes a []byte representation of a SpanID and -// converts it to a uint64 representation. -func BytesToUInt64SpanID(b [8]byte) uint64 { - return binary.BigEndian.Uint64(b[:]) + return pdata.NewSpanID(spanID) } -// BytesToInt64SpanID takes a []byte representation of a SpanID and -// converts it to a int64 representation. -func BytesToInt64SpanID(b [8]byte) int64 { - return int64(BytesToUInt64SpanID(b)) +// SpanIDToUInt64 converts the pdata.SpanID to uint64 representation. +func SpanIDToUInt64(spanID pdata.SpanID) uint64 { + bytes := spanID.Bytes() + return binary.BigEndian.Uint64(bytes[:]) } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/grpc_http_mapper.go b/vendor/go.opentelemetry.io/collector/translator/trace/grpc_http_mapper.go index f997f3a3a5e..13227f52dee 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/grpc_http_mapper.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/grpc_http_mapper.go @@ -51,7 +51,7 @@ var httpToOCCodeMap = map[int32]int32{ } // OCStatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-http.md func OCStatusCodeFromHTTP(code int32) int32 { if code >= 100 && code < 400 { return OCOK @@ -89,7 +89,7 @@ var ocToHTTPCodeMap = map[int32]int32{ } // HTTPStatusCodeFromOCStatus takes an OpenTelemetry status code and return the appropriate HTTP status code -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-http.md +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/data-http.md func HTTPStatusCodeFromOCStatus(code int32) int32 { if c, ok := ocToHTTPCodeMap[code]; ok { return c diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerproto_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerproto_to_traces.go index c6945d8bf89..c0923cb451e 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerproto_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerproto_to_traces.go @@ -142,7 +142,7 @@ func jSpansToInternal(spans []*model.Span) map[instrumentationLibrary]pdata.Inst if span == nil || reflect.DeepEqual(span, blankJaegerProtoSpan) { continue } - span, library := jSpanToInternal(span) + pSpan, library := jSpanToInternal(span) ils, found := spansByLibrary[library] if !found { ils = pdata.NewInstrumentationLibrarySpans() @@ -153,7 +153,7 @@ func jSpansToInternal(spans []*model.Span) map[instrumentationLibrary]pdata.Inst ils.InstrumentationLibrary().SetVersion(library.version) } } - ils.Spans().Append(span) + ils.Spans().Append(pSpan) } return spansByLibrary } @@ -266,7 +266,6 @@ func setInternalSpanStatus(attrs pdata.AttributeMap, dest pdata.SpanStatus) { } if statusExists { - dest.InitEmpty() dest.SetCode(statusCode) dest.SetMessage(statusMessage) } @@ -357,7 +356,7 @@ func jReferencesToSpanLinks(refs []model.SpanRef, excludeParentID model.SpanID, } link.SetTraceID(tracetranslator.UInt64ToTraceID(ref.TraceID.High, ref.TraceID.Low)) - link.SetSpanID(pdata.NewSpanID(tracetranslator.UInt64ToByteSpanID(uint64(ref.SpanID)))) + link.SetSpanID(tracetranslator.UInt64ToSpanID(uint64(ref.SpanID))) i++ } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerthrift_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerthrift_to_traces.go index c6aa7d21977..c18a206e431 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerthrift_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/jaegerthrift_to_traces.go @@ -97,15 +97,15 @@ func jThriftSpansToInternal(spans []*jaeger.Span, dest pdata.SpanSlice) { } func jThriftSpanToInternal(span *jaeger.Span, dest pdata.Span) { - dest.SetTraceID(tracetranslator.Int64ToTraceID(span.TraceIdHigh, span.TraceIdLow)) - dest.SetSpanID(tracetranslator.Int64ToSpanID(span.SpanId)) + dest.SetTraceID(tracetranslator.UInt64ToTraceID(uint64(span.TraceIdHigh), uint64(span.TraceIdLow))) + dest.SetSpanID(tracetranslator.UInt64ToSpanID(uint64(span.SpanId))) dest.SetName(span.OperationName) dest.SetStartTime(microsecondsToUnixNano(span.StartTime)) dest.SetEndTime(microsecondsToUnixNano(span.StartTime + span.Duration)) parentSpanID := span.ParentSpanId if parentSpanID != 0 { - dest.SetParentSpanID(tracetranslator.Int64ToSpanID(parentSpanID)) + dest.SetParentSpanID(tracetranslator.UInt64ToSpanID(uint64(parentSpanID))) } attrs := dest.Attributes() @@ -184,8 +184,8 @@ func jThriftReferencesToSpanLinks(refs []*jaeger.SpanRef, excludeParentID int64, continue } - link.SetTraceID(tracetranslator.Int64ToTraceID(ref.TraceIdHigh, ref.TraceIdLow)) - link.SetSpanID(pdata.NewSpanID(tracetranslator.Int64ToByteSpanID(ref.SpanId))) + link.SetTraceID(tracetranslator.UInt64ToTraceID(uint64(ref.TraceIdHigh), uint64(ref.TraceIdLow))) + link.SetSpanID(tracetranslator.UInt64ToSpanID(uint64(ref.SpanId))) i++ } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/traces_to_jaegerproto.go b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/traces_to_jaegerproto.go index 7a47c484c4e..978fabf07f8 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/traces_to_jaegerproto.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/jaeger/traces_to_jaegerproto.go @@ -202,21 +202,19 @@ func getJaegerProtoSpanTags(span pdata.Span, instrumentationLibrary pdata.Instru tagsCount++ } status := span.Status() - if !status.IsNil() { - statusCodeTag, statusCodeTagFound = getTagFromStatusCode(status.Code()) - if statusCodeTagFound { - tagsCount++ - } + statusCodeTag, statusCodeTagFound = getTagFromStatusCode(status.Code()) + if statusCodeTagFound { + tagsCount++ + } - errorTag, errorTagFound = getErrorTagFromStatusCode(status.Code()) - if errorTagFound { - tagsCount++ - } + errorTag, errorTagFound = getErrorTagFromStatusCode(status.Code()) + if errorTagFound { + tagsCount++ + } - statusMsgTag, statusMsgTagFound = getTagFromStatusMsg(status.Message()) - if statusMsgTagFound { - tagsCount++ - } + statusMsgTag, statusMsgTagFound = getTagFromStatusMsg(status.Message()) + if statusMsgTagFound { + tagsCount++ } traceStateTags, traceStateTagsFound := getTagsFromTraceState(span.TraceState()) @@ -263,7 +261,7 @@ func traceIDToJaegerProto(traceID pdata.TraceID) (model.TraceID, error) { } func spanIDToJaegerProto(spanID pdata.SpanID) (model.SpanID, error) { - uSpanID := tracetranslator.BytesToUInt64SpanID(spanID.Bytes()) + uSpanID := tracetranslator.SpanIDToUInt64(spanID) if uSpanID == 0 { return model.SpanID(0), errZeroSpanID } @@ -276,7 +274,7 @@ func makeJaegerProtoReferences( parentSpanID pdata.SpanID, traceID model.TraceID, ) ([]model.SpanRef, error) { - parentSpanIDSet := parentSpanID.IsValid() + parentSpanIDSet := !parentSpanID.IsEmpty() if !parentSpanIDSet && links.Len() == 0 { return nil, nil } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/protospan_translation.go b/vendor/go.opentelemetry.io/collector/translator/trace/protospan_translation.go index 4f778ea204e..903967b30cc 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/protospan_translation.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/protospan_translation.go @@ -26,13 +26,6 @@ import ( // Some of the keys used to represent OTLP constructs as tags or annotations in other formats. const ( - AnnotationDescriptionKey = "description" - - MessageEventIDKey = "message.id" - MessageEventTypeKey = "message.type" - MessageEventCompressedSizeKey = "message.compressed_size" - MessageEventUncompressedSizeKey = "message.uncompressed_size" - TagMessage = "message" TagSpanKind = "span.kind" @@ -59,7 +52,7 @@ const ( ) // OpenTracingSpanKind are possible values for TagSpanKind and match the OpenTracing -// conventions: https://github.com/opentracing/specification/blob/master/semantic_conventions.md +// conventions: https://github.com/opentracing/specification/blob/main/semantic_conventions.md // These values are used for representing span kinds that have no // equivalents in OpenCensus format. They are stored as values of TagSpanKind type OpenTracingSpanKind string @@ -278,33 +271,27 @@ func jsonMapToAttributeMap(attrs map[string]interface{}, dest pdata.AttributeMap func jsonArrayToAttributeArray(jArray []interface{}, dest pdata.AnyValueArray) { for _, val := range jArray { if val == nil { - av := pdata.NewAttributeValueNull() - dest.Append(av) + dest.Append(pdata.NewAttributeValueNull()) continue } if s, ok := val.(string); ok { - av := pdata.NewAttributeValueString(s) - dest.Append(av) + dest.Append(pdata.NewAttributeValueString(s)) } else if d, ok := val.(float64); ok { if math.Mod(d, 1.0) == 0.0 { - av := pdata.NewAttributeValueInt(int64(d)) - dest.Append(av) + dest.Append(pdata.NewAttributeValueInt(int64(d))) } else { - av := pdata.NewAttributeValueDouble(d) - dest.Append(av) + dest.Append(pdata.NewAttributeValueDouble(d)) } } else if b, ok := val.(bool); ok { - av := pdata.NewAttributeValueBool(b) - dest.Append(av) + dest.Append(pdata.NewAttributeValueBool(b)) } else { - av := pdata.NewAttributeValueString("") - dest.Append(av) + dest.Append(pdata.NewAttributeValueString("")) } } } // StatusCodeFromHTTP takes an HTTP status code and return the appropriate OpenTelemetry status code -// See: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#status +// See: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#status func StatusCodeFromHTTP(httpStatusCode int) pdata.StatusCode { if httpStatusCode >= 100 && httpStatusCode < 399 { return pdata.StatusCodeUnset diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/opencensus_helper.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/consumerdata.go similarity index 62% rename from vendor/go.opentelemetry.io/collector/translator/trace/opencensus_helper.go rename to vendor/go.opentelemetry.io/collector/translator/trace/zipkin/consumerdata.go index ac00f8ef662..6495ca93f28 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/opencensus_helper.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/consumerdata.go @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -package tracetranslator +package zipkin import ( + commonpb "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1" + resourcepb "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1" tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1" ) -// OCAttributeKeyExist returns true if a key in attribute of an OC Span exists. -// It returns false, if attributes is nil, the map itself is nil or the key wasn't found. -func OCAttributeKeyExist(ocAttributes *tracepb.Span_Attributes, key string) bool { - if ocAttributes == nil || ocAttributes.AttributeMap == nil { - return false - } - _, foundKey := ocAttributes.AttributeMap[key] - return foundKey +// traceData helper struct for zipkin conversion. +// TODO: Remove this when zipkin translates directly to pdata. +type traceData struct { + Node *commonpb.Node + Resource *resourcepb.Resource + Spans []*tracepb.Span } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/traces_to_zipkinv2.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/traces_to_zipkinv2.go index bd4988bdfc3..d06838dcd01 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/traces_to_zipkinv2.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/traces_to_zipkinv2.go @@ -101,11 +101,11 @@ func spanToZipkinSpan( zs := &zipkinmodel.SpanModel{} - if !span.TraceID().IsValid() { + if span.TraceID().IsEmpty() { return zs, errors.New("TraceID is invalid") } zs.TraceID = convertTraceID(span.TraceID()) - if !span.SpanID().IsValid() { + if span.SpanID().IsEmpty() { return zs, errors.New("SpanID is invalid") } zs.ID = convertSpanID(span.SpanID()) @@ -114,7 +114,7 @@ func spanToZipkinSpan( tags[tracetranslator.TagW3CTraceState] = string(span.TraceState()) } - if span.ParentSpanID().IsValid() { + if !span.ParentSpanID().IsEmpty() { id := convertSpanID(span.ParentSpanID()) zs.ParentID = &id } @@ -137,13 +137,11 @@ func spanToZipkinSpan( removeRedundentTags(redundantKeys, tags) status := span.Status() - if !status.IsNil() { - tags[tracetranslator.TagStatusCode] = status.Code().String() - if status.Message() != "" { - tags[tracetranslator.TagStatusMsg] = status.Message() - if int32(status.Code()) > 0 { - zs.Err = fmt.Errorf("%s", status.Message()) - } + tags[tracetranslator.TagStatusCode] = status.Code().String() + if status.Message() != "" { + tags[tracetranslator.TagStatusMsg] = status.Message() + if int32(status.Code()) > 0 { + zs.Err = fmt.Errorf("%s", status.Message()) } } @@ -349,5 +347,5 @@ func convertTraceID(t pdata.TraceID) zipkinmodel.TraceID { } func convertSpanID(s pdata.SpanID) zipkinmodel.ID { - return zipkinmodel.ID(tracetranslator.BytesToUInt64SpanID(s.Bytes())) + return zipkinmodel.ID(tracetranslator.SpanIDToUInt64(s)) } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_protospan.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_protospan.go index b1dbb23dc2c..cf7bdbf1451 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_protospan.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_protospan.go @@ -27,12 +27,11 @@ import ( "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" "google.golang.org/protobuf/types/known/timestamppb" - "go.opentelemetry.io/collector/consumer/consumerdata" tracetranslator "go.opentelemetry.io/collector/translator/trace" ) // v1ThriftBatchToOCProto converts Zipkin v1 spans to OC Proto. -func v1ThriftBatchToOCProto(zSpans []*zipkincore.Span) ([]consumerdata.TraceData, error) { +func v1ThriftBatchToOCProto(zSpans []*zipkincore.Span) ([]traceData, error) { ocSpansAndParsedAnnotations := make([]ocSpanAndParsedAnnotations, 0, len(zSpans)) for _, zSpan := range zSpans { ocSpan, parsedAnnotations := zipkinV1ThriftToOCSpan(zSpan) @@ -56,11 +55,11 @@ func zipkinV1ThriftToOCSpan(zSpan *zipkincore.Span) (*tracepb.Span, *annotationP // failures on the receivers in general are silent at this moment, so letting them // proceed for now. We should validate the traceID, spanID and parentID are good with // OC proto requirements. - traceID := tracetranslator.Int64ToByteTraceID(traceIDHigh, zSpan.TraceID) - spanID := tracetranslator.Int64ToByteSpanID(zSpan.ID) + traceID := tracetranslator.UInt64ToTraceID(uint64(traceIDHigh), uint64(zSpan.TraceID)).Bytes() + spanID := tracetranslator.UInt64ToSpanID(uint64(zSpan.ID)).Bytes() var parentID []byte if zSpan.ParentID != nil { - parentIDBytes := tracetranslator.Int64ToByteSpanID(*zSpan.ParentID) + parentIDBytes := tracetranslator.UInt64ToSpanID(uint64(*zSpan.ParentID)).Bytes() parentID = parentIDBytes[:] } diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_traces.go index 7c3fa6d7fb2..f435c8800de 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_thrift_to_traces.go @@ -23,11 +23,10 @@ import ( func V1ThriftBatchToInternalTraces(zSpans []*zipkincore.Span) (pdata.Traces, error) { traces := pdata.NewTraces() - ocTraces, _ := v1ThriftBatchToOCProto(zSpans) for _, td := range ocTraces { - tmp := internaldata.OCToTraceData(td) + tmp := internaldata.OCToTraces(td.Node, td.Resource, td.Spans) tmp.ResourceSpans().MoveAndAppendTo(traces.ResourceSpans()) } return traces, nil diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_protospan.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_protospan.go index 27863fe8c1c..7d1deac464d 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_protospan.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_protospan.go @@ -27,7 +27,6 @@ import ( "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" "google.golang.org/protobuf/types/known/timestamppb" - "go.opentelemetry.io/collector/consumer/consumerdata" "go.opentelemetry.io/collector/consumer/pdata" tracetranslator "go.opentelemetry.io/collector/translator/trace" ) @@ -86,7 +85,7 @@ type binaryAnnotation struct { } // v1JSONBatchToOCProto converts a JSON blob with a list of Zipkin v1 spans to OC Proto. -func v1JSONBatchToOCProto(blob []byte, parseStringTags bool) ([]consumerdata.TraceData, error) { +func v1JSONBatchToOCProto(blob []byte, parseStringTags bool) ([]traceData, error) { var zSpans []*zipkinV1Span if err := json.Unmarshal(blob, &zSpans); err != nil { return nil, fmt.Errorf("%s: %w", msgZipkinV1JSONUnmarshalError, err) @@ -113,15 +112,15 @@ type ocSpanAndParsedAnnotations struct { parsedAnnotations *annotationParseResult } -func zipkinToOCProtoBatch(ocSpansAndParsedAnnotations []ocSpanAndParsedAnnotations) ([]consumerdata.TraceData, error) { +func zipkinToOCProtoBatch(ocSpansAndParsedAnnotations []ocSpanAndParsedAnnotations) ([]traceData, error) { // Service to batch maps the service name to the trace request with the corresponding node. - svcToTD := make(map[string]*consumerdata.TraceData) + svcToTD := make(map[string]*traceData) for _, curr := range ocSpansAndParsedAnnotations { req := getOrCreateNodeRequest(svcToTD, curr.parsedAnnotations.Endpoint) req.Spans = append(req.Spans, curr.ocSpan) } - tds := make([]consumerdata.TraceData, 0, len(svcToTD)) + tds := make([]traceData, 0, len(svcToTD)) for _, v := range svcToTD { tds = append(tds, *v) } @@ -415,7 +414,7 @@ func hexTraceIDToOCTraceID(hex string) ([]byte, error) { return nil, errHexTraceIDZero } - tidBytes := tracetranslator.UInt64ToByteTraceID(high, low) + tidBytes := tracetranslator.UInt64ToTraceID(high, low).Bytes() return tidBytes[:], nil } @@ -434,7 +433,7 @@ func hexIDToOCID(hex string) ([]byte, error) { return nil, errHexIDZero } - idBytes := tracetranslator.UInt64ToByteSpanID(idValue) + idBytes := tracetranslator.UInt64ToSpanID(idValue).Bytes() return idBytes[:], nil } @@ -448,7 +447,7 @@ func epochMicrosecondsToTimestamp(msecs int64) *timestamppb.Timestamp { return t } -func getOrCreateNodeRequest(m map[string]*consumerdata.TraceData, endpoint *endpoint) *consumerdata.TraceData { +func getOrCreateNodeRequest(m map[string]*traceData, endpoint *endpoint) *traceData { // this private function assumes that the caller never passes an nil endpoint nodeKey := endpoint.string() req := m[nodeKey] @@ -457,7 +456,7 @@ func getOrCreateNodeRequest(m map[string]*consumerdata.TraceData, endpoint *endp return req } - req = &consumerdata.TraceData{ + req = &traceData{ Node: &commonpb.Node{ ServiceInfo: &commonpb.ServiceInfo{Name: endpoint.ServiceName}, }, diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_traces.go index a323123764c..2f894cfbbe3 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv1_to_traces.go @@ -28,7 +28,7 @@ func V1JSONBatchToInternalTraces(blob []byte, parseStringTags bool) (pdata.Trace } for _, td := range ocTraces { - tmp := internaldata.OCToTraceData(td) + tmp := internaldata.OCToTraces(td.Node, td.Resource, td.Spans) tmp.ResourceSpans().MoveAndAppendTo(traces.ResourceSpans()) } return traces, nil diff --git a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv2_to_traces.go b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv2_to_traces.go index 95b1c80575f..b0743cea809 100644 --- a/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv2_to_traces.go +++ b/vendor/go.opentelemetry.io/collector/translator/trace/zipkin/zipkinv2_to_traces.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/collector/consumer/pdata" "go.opentelemetry.io/collector/internal/data" - otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1" + otlptrace "go.opentelemetry.io/collector/internal/data/protogen/trace/v1" "go.opentelemetry.io/collector/translator/conventions" tracetranslator "go.opentelemetry.io/collector/translator/trace" ) @@ -157,7 +157,6 @@ func zSpanToInternal(zspan *zipkinmodel.SpanModel, tags map[string]string, dest func populateSpanStatus(tags map[string]string, status pdata.SpanStatus) { if value, ok := tags[tracetranslator.TagStatusCode]; ok { - status.InitEmpty() status.SetCode(pdata.StatusCode(otlptrace.Status_StatusCode_value[value])) delete(tags, tracetranslator.TagStatusCode) if value, ok := tags[tracetranslator.TagStatusMsg]; ok { @@ -165,6 +164,13 @@ func populateSpanStatus(tags map[string]string, status pdata.SpanStatus) { delete(tags, tracetranslator.TagStatusMsg) } } + + if val, ok := tags[tracetranslator.TagError]; ok { + if val == "true" { + status.SetCode(pdata.StatusCodeError) + delete(tags, tracetranslator.TagError) + } + } } func zipkinKindToSpanKind(kind zipkinmodel.Kind, tags map[string]string) pdata.SpanKind { diff --git a/vendor/golang.org/x/text/unicode/bidi/bidi.go b/vendor/golang.org/x/text/unicode/bidi/bidi.go index e8edc54cc28..fd057601bd9 100644 --- a/vendor/golang.org/x/text/unicode/bidi/bidi.go +++ b/vendor/golang.org/x/text/unicode/bidi/bidi.go @@ -12,15 +12,14 @@ // and without notice. package bidi // import "golang.org/x/text/unicode/bidi" -// TODO: -// The following functionality would not be hard to implement, but hinges on -// the definition of a Segmenter interface. For now this is up to the user. -// - Iterate over paragraphs -// - Segmenter to iterate over runs directly from a given text. -// Also: +// TODO // - Transformer for reordering? // - Transformer (validator, really) for Bidi Rule. +import ( + "bytes" +) + // This API tries to avoid dealing with embedding levels for now. Under the hood // these will be computed, but the question is to which extent the user should // know they exist. We should at some point allow the user to specify an @@ -49,7 +48,9 @@ const ( Neutral ) -type options struct{} +type options struct { + defaultDirection Direction +} // An Option is an option for Bidi processing. type Option func(*options) @@ -66,12 +67,62 @@ type Option func(*options) // DefaultDirection sets the default direction for a Paragraph. The direction is // overridden if the text contains directional characters. func DefaultDirection(d Direction) Option { - panic("unimplemented") + return func(opts *options) { + opts.defaultDirection = d + } } // A Paragraph holds a single Paragraph for Bidi processing. type Paragraph struct { - // buffers + p []byte + o Ordering + opts []Option + types []Class + pairTypes []bracketType + pairValues []rune + runes []rune + options options +} + +// Initialize the p.pairTypes, p.pairValues and p.types from the input previously +// set by p.SetBytes() or p.SetString(). Also limit the input up to (and including) a paragraph +// separator (bidi class B). +// +// The function p.Order() needs these values to be set, so this preparation could be postponed. +// But since the SetBytes and SetStrings functions return the length of the input up to the paragraph +// separator, the whole input needs to be processed anyway and should not be done twice. +// +// The function has the same return values as SetBytes() / SetString() +func (p *Paragraph) prepareInput() (n int, err error) { + p.runes = bytes.Runes(p.p) + bytecount := 0 + // clear slices from previous SetString or SetBytes + p.pairTypes = nil + p.pairValues = nil + p.types = nil + + for _, r := range p.runes { + props, i := LookupRune(r) + bytecount += i + cls := props.Class() + if cls == B { + return bytecount, nil + } + p.types = append(p.types, cls) + if props.IsOpeningBracket() { + p.pairTypes = append(p.pairTypes, bpOpen) + p.pairValues = append(p.pairValues, r) + } else if props.IsBracket() { + // this must be a closing bracket, + // since IsOpeningBracket is not true + p.pairTypes = append(p.pairTypes, bpClose) + p.pairValues = append(p.pairValues, r) + } else { + p.pairTypes = append(p.pairTypes, bpNone) + p.pairValues = append(p.pairValues, 0) + } + } + return bytecount, nil } // SetBytes configures p for the given paragraph text. It replaces text @@ -80,70 +131,150 @@ type Paragraph struct { // consumed from b including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetBytes(b []byte, opts ...Option) (n int, err error) { - panic("unimplemented") + p.p = b + p.opts = opts + return p.prepareInput() } -// SetString configures p for the given paragraph text. It replaces text -// previously set by SetBytes or SetString. If b contains a paragraph separator +// SetString configures s for the given paragraph text. It replaces text +// previously set by SetBytes or SetString. If s contains a paragraph separator // it will only process the first paragraph and report the number of bytes -// consumed from b including this separator. Error may be non-nil if options are +// consumed from s including this separator. Error may be non-nil if options are // given. func (p *Paragraph) SetString(s string, opts ...Option) (n int, err error) { - panic("unimplemented") + p.p = []byte(s) + p.opts = opts + return p.prepareInput() } // IsLeftToRight reports whether the principle direction of rendering for this // paragraphs is left-to-right. If this returns false, the principle direction // of rendering is right-to-left. func (p *Paragraph) IsLeftToRight() bool { - panic("unimplemented") + return p.Direction() == LeftToRight } // Direction returns the direction of the text of this paragraph. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (p *Paragraph) Direction() Direction { - panic("unimplemented") + return p.o.Direction() } +// TODO: what happens if the position is > len(input)? This should return an error. + // RunAt reports the Run at the given position of the input text. // // This method can be used for computing line breaks on paragraphs. func (p *Paragraph) RunAt(pos int) Run { - panic("unimplemented") + c := 0 + runNumber := 0 + for i, r := range p.o.runes { + c += len(r) + if pos < c { + runNumber = i + } + } + return p.o.Run(runNumber) +} + +func calculateOrdering(levels []level, runes []rune) Ordering { + var curDir Direction + + prevDir := Neutral + prevI := 0 + + o := Ordering{} + // lvl = 0,2,4,...: left to right + // lvl = 1,3,5,...: right to left + for i, lvl := range levels { + if lvl%2 == 0 { + curDir = LeftToRight + } else { + curDir = RightToLeft + } + if curDir != prevDir { + if i > 0 { + o.runes = append(o.runes, runes[prevI:i]) + o.directions = append(o.directions, prevDir) + o.startpos = append(o.startpos, prevI) + } + prevI = i + prevDir = curDir + } + } + o.runes = append(o.runes, runes[prevI:]) + o.directions = append(o.directions, prevDir) + o.startpos = append(o.startpos, prevI) + return o } // Order computes the visual ordering of all the runs in a Paragraph. func (p *Paragraph) Order() (Ordering, error) { - panic("unimplemented") + if len(p.types) == 0 { + return Ordering{}, nil + } + + for _, fn := range p.opts { + fn(&p.options) + } + lvl := level(-1) + if p.options.defaultDirection == RightToLeft { + lvl = 1 + } + para, err := newParagraph(p.types, p.pairTypes, p.pairValues, lvl) + if err != nil { + return Ordering{}, err + } + + levels := para.getLevels([]int{len(p.types)}) + + p.o = calculateOrdering(levels, p.runes) + return p.o, nil } // Line computes the visual ordering of runs for a single line starting and // ending at the given positions in the original text. func (p *Paragraph) Line(start, end int) (Ordering, error) { - panic("unimplemented") + lineTypes := p.types[start:end] + para, err := newParagraph(lineTypes, p.pairTypes[start:end], p.pairValues[start:end], -1) + if err != nil { + return Ordering{}, err + } + levels := para.getLevels([]int{len(lineTypes)}) + o := calculateOrdering(levels, p.runes[start:end]) + return o, nil } // An Ordering holds the computed visual order of runs of a Paragraph. Calling // SetBytes or SetString on the originating Paragraph invalidates an Ordering. // The methods of an Ordering should only be called by one goroutine at a time. -type Ordering struct{} +type Ordering struct { + runes [][]rune + directions []Direction + startpos []int +} // Direction reports the directionality of the runs. // // The direction may be LeftToRight, RightToLeft, Mixed, or Neutral. func (o *Ordering) Direction() Direction { - panic("unimplemented") + return o.directions[0] } // NumRuns returns the number of runs. func (o *Ordering) NumRuns() int { - panic("unimplemented") + return len(o.runes) } // Run returns the ith run within the ordering. func (o *Ordering) Run(i int) Run { - panic("unimplemented") + r := Run{ + runes: o.runes[i], + direction: o.directions[i], + startpos: o.startpos[i], + } + return r } // TODO: perhaps with options. @@ -155,16 +286,19 @@ func (o *Ordering) Run(i int) Run { // A Run is a continuous sequence of characters of a single direction. type Run struct { + runes []rune + direction Direction + startpos int } // String returns the text of the run in its original order. func (r *Run) String() string { - panic("unimplemented") + return string(r.runes) } // Bytes returns the text of the run in its original order. func (r *Run) Bytes() []byte { - panic("unimplemented") + return []byte(r.String()) } // TODO: methods for @@ -174,25 +308,52 @@ func (r *Run) Bytes() []byte { // Direction reports the direction of the run. func (r *Run) Direction() Direction { - panic("unimplemented") + return r.direction } -// Position of the Run within the text passed to SetBytes or SetString of the +// Pos returns the position of the Run within the text passed to SetBytes or SetString of the // originating Paragraph value. func (r *Run) Pos() (start, end int) { - panic("unimplemented") + return r.startpos, r.startpos + len(r.runes) - 1 } // AppendReverse reverses the order of characters of in, appends them to out, // and returns the result. Modifiers will still follow the runes they modify. // Brackets are replaced with their counterparts. func AppendReverse(out, in []byte) []byte { - panic("unimplemented") + ret := make([]byte, len(in)+len(out)) + copy(ret, out) + inRunes := bytes.Runes(in) + + for i, r := range inRunes { + prop, _ := LookupRune(r) + if prop.IsBracket() { + inRunes[i] = prop.reverseBracket(r) + } + } + + for i, j := 0, len(inRunes)-1; i < j; i, j = i+1, j-1 { + inRunes[i], inRunes[j] = inRunes[j], inRunes[i] + } + copy(ret[len(out):], string(inRunes)) + + return ret } // ReverseString reverses the order of characters in s and returns a new string. // Modifiers will still follow the runes they modify. Brackets are replaced with // their counterparts. func ReverseString(s string) string { - panic("unimplemented") + input := []rune(s) + li := len(input) + ret := make([]rune, li) + for i, r := range input { + prop, _ := LookupRune(r) + if prop.IsBracket() { + ret[li-i-1] = prop.reverseBracket(r) + } else { + ret[li-i-1] = r + } + } + return string(ret) } diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/vendor/golang.org/x/text/unicode/bidi/core.go index 50deb6600a3..e4c0811016c 100644 --- a/vendor/golang.org/x/text/unicode/bidi/core.go +++ b/vendor/golang.org/x/text/unicode/bidi/core.go @@ -4,7 +4,10 @@ package bidi -import "log" +import ( + "fmt" + "log" +) // This implementation is a port based on the reference implementation found at: // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/ @@ -97,13 +100,20 @@ type paragraph struct { // rune (suggested is the rune of the open bracket for opening and matching // close brackets, after normalization). The embedding levels are optional, but // may be supplied to encode embedding levels of styled text. -// -// TODO: return an error. -func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) *paragraph { - validateTypes(types) - validatePbTypes(pairTypes) - validatePbValues(pairValues, pairTypes) - validateParagraphEmbeddingLevel(levels) +func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, levels level) (*paragraph, error) { + var err error + if err = validateTypes(types); err != nil { + return nil, err + } + if err = validatePbTypes(pairTypes); err != nil { + return nil, err + } + if err = validatePbValues(pairValues, pairTypes); err != nil { + return nil, err + } + if err = validateParagraphEmbeddingLevel(levels); err != nil { + return nil, err + } p := ¶graph{ initialTypes: append([]Class(nil), types...), @@ -115,7 +125,7 @@ func newParagraph(types []Class, pairTypes []bracketType, pairValues []rune, lev resultTypes: append([]Class(nil), types...), } p.run() - return p + return p, nil } func (p *paragraph) Len() int { return len(p.initialTypes) } @@ -1001,58 +1011,61 @@ func typeForLevel(level level) Class { return R } -// TODO: change validation to not panic - -func validateTypes(types []Class) { +func validateTypes(types []Class) error { if len(types) == 0 { - log.Panic("types is null") + return fmt.Errorf("types is null") } for i, t := range types[:len(types)-1] { if t == B { - log.Panicf("B type before end of paragraph at index: %d", i) + return fmt.Errorf("B type before end of paragraph at index: %d", i) } } + return nil } -func validateParagraphEmbeddingLevel(embeddingLevel level) { +func validateParagraphEmbeddingLevel(embeddingLevel level) error { if embeddingLevel != implicitLevel && embeddingLevel != 0 && embeddingLevel != 1 { - log.Panicf("illegal paragraph embedding level: %d", embeddingLevel) + return fmt.Errorf("illegal paragraph embedding level: %d", embeddingLevel) } + return nil } -func validateLineBreaks(linebreaks []int, textLength int) { +func validateLineBreaks(linebreaks []int, textLength int) error { prev := 0 for i, next := range linebreaks { if next <= prev { - log.Panicf("bad linebreak: %d at index: %d", next, i) + return fmt.Errorf("bad linebreak: %d at index: %d", next, i) } prev = next } if prev != textLength { - log.Panicf("last linebreak was %d, want %d", prev, textLength) + return fmt.Errorf("last linebreak was %d, want %d", prev, textLength) } + return nil } -func validatePbTypes(pairTypes []bracketType) { +func validatePbTypes(pairTypes []bracketType) error { if len(pairTypes) == 0 { - log.Panic("pairTypes is null") + return fmt.Errorf("pairTypes is null") } for i, pt := range pairTypes { switch pt { case bpNone, bpOpen, bpClose: default: - log.Panicf("illegal pairType value at %d: %v", i, pairTypes[i]) + return fmt.Errorf("illegal pairType value at %d: %v", i, pairTypes[i]) } } + return nil } -func validatePbValues(pairValues []rune, pairTypes []bracketType) { +func validatePbValues(pairValues []rune, pairTypes []bracketType) error { if pairValues == nil { - log.Panic("pairValues is null") + return fmt.Errorf("pairValues is null") } if len(pairTypes) != len(pairValues) { - log.Panic("pairTypes is different length from pairValues") + return fmt.Errorf("pairTypes is different length from pairValues") } + return nil } diff --git a/vendor/golang.org/x/tools/cmd/goimports/doc.go b/vendor/golang.org/x/tools/cmd/goimports/doc.go index 7033e4d4cff..f344d8014a5 100644 --- a/vendor/golang.org/x/tools/cmd/goimports/doc.go +++ b/vendor/golang.org/x/tools/cmd/goimports/doc.go @@ -1,3 +1,7 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + /* Command goimports updates your Go import lines, diff --git a/vendor/golang.org/x/tools/go/ast/astutil/util.go b/vendor/golang.org/x/tools/go/ast/astutil/util.go index 7630629824a..919d5305ab4 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/util.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/util.go @@ -1,3 +1,7 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package astutil import "go/ast" diff --git a/vendor/golang.org/x/tools/internal/gocommand/version.go b/vendor/golang.org/x/tools/internal/gocommand/version.go index 60d45ac0e64..0cebac6e668 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/version.go +++ b/vendor/golang.org/x/tools/internal/gocommand/version.go @@ -16,9 +16,20 @@ func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { inv.Verb = "list" inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`} inv.Env = append(append([]string{}, inv.Env...), "GO111MODULE=off") - // Unset any unneeded flags. + // Unset any unneeded flags, and remove them from BuildFlags, if they're + // present. inv.ModFile = "" inv.ModFlag = "" + var buildFlags []string + for _, flag := range inv.BuildFlags { + // Flags can be prefixed by one or two dashes. + f := strings.TrimPrefix(strings.TrimPrefix(flag, "-"), "-") + if strings.HasPrefix(f, "mod=") || strings.HasPrefix(f, "modfile=") { + continue + } + buildFlags = append(buildFlags, flag) + } + inv.BuildFlags = buildFlags stdoutBytes, err := r.Run(ctx, inv) if err != nil { return 0, err diff --git a/vendor/golang.org/x/tools/internal/imports/mod.go b/vendor/golang.org/x/tools/internal/imports/mod.go index ce3269a4306..901449a8205 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod.go +++ b/vendor/golang.org/x/tools/internal/imports/mod.go @@ -1,3 +1,7 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package imports import ( diff --git a/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/vendor/golang.org/x/tools/internal/imports/mod_cache.go index 5b4f03accdd..18dada495ca 100644 --- a/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ b/vendor/golang.org/x/tools/internal/imports/mod_cache.go @@ -1,3 +1,7 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package imports import ( diff --git a/vendor/gopkg.in/jcmturner/aescts.v1/.gitignore b/vendor/gopkg.in/jcmturner/aescts.v1/.gitignore deleted file mode 100644 index a1338d68517..00000000000 --- a/vendor/gopkg.in/jcmturner/aescts.v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ diff --git a/vendor/gopkg.in/jcmturner/aescts.v1/README.md b/vendor/gopkg.in/jcmturner/aescts.v1/README.md deleted file mode 100644 index d1fddf3a281..00000000000 --- a/vendor/gopkg.in/jcmturner/aescts.v1/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# AES CBC Ciphertext Stealing -[![GoDoc](https://godoc.org/gopkg.in/jcmturner/aescts.v1?status.svg)](https://godoc.org/gopkg.in/jcmturner/aescts.v1) [![Go Report Card](https://goreportcard.com/badge/gopkg.in/jcmturner/aescts.v1)](https://goreportcard.com/report/gopkg.in/jcmturner/aescts.v1) - -Encrypt and decrypt data using AES CBC Ciphertext stealing mode. - -Reference: https://en.wikipedia.org/wiki/Ciphertext_stealing#CBC_ciphertext_stealing - -To get the package, execute: -``` -go get gopkg.in/jcmturner/aescts.v1 -``` -To import this package, add the following line to your code: -```go -import "gopkg.in/jcmturner/aescts.v1" - -``` \ No newline at end of file diff --git a/vendor/gopkg.in/jcmturner/dnsutils.v1/.gitignore b/vendor/gopkg.in/jcmturner/dnsutils.v1/.gitignore deleted file mode 100644 index a1338d68517..00000000000 --- a/vendor/gopkg.in/jcmturner/dnsutils.v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ diff --git a/vendor/gopkg.in/jcmturner/dnsutils.v1/.travis.yml b/vendor/gopkg.in/jcmturner/dnsutils.v1/.travis.yml deleted file mode 100644 index cab4f7b861e..00000000000 --- a/vendor/gopkg.in/jcmturner/dnsutils.v1/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go - -go: - - 1.7.x - - 1.8.x - - 1.9.x - - master - -gobuild_args: -tags=integration -race - -sudo: required - -services: - - docker - -before_install: - - docker pull jcmturner/gokrb5:dns - - docker run -d -h kdc.test.gokrb5 -v /etc/localtime:/etc/localtime:ro -e "TEST_KDC_ADDR=127.0.0.1" -p 53:53 -p 53:53/udp --name dns jcmturner/gokrb5:dns - -before_script: - - sudo sed -i 's/nameserver .*/nameserver 127.0.0.1/g' /etc/resolv.conf - -env: - - DNSUTILS_OVERRIDE_NS="127.0.0.1:53" \ No newline at end of file diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/etype/etype.go b/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/etype/etype.go deleted file mode 100644 index ee7510e2512..00000000000 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/crypto/etype/etype.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package etype provides the Kerberos Encryption Type interface -package etype - -import "hash" - -// EType is the interface defining the Encryption Type. -type EType interface { - GetETypeID() int32 - GetHashID() int32 - GetKeyByteSize() int - GetKeySeedBitLength() int // key-generation seed length, k - GetDefaultStringToKeyParams() string // default string-to-key parameters (s2kparams) - StringToKey(string, salt, s2kparams string) ([]byte, error) // string-to-key (UTF-8 string, UTF-8 string, opaque)->(protocol-key) - RandomToKey(b []byte) []byte // random-to-key (bitstring[K])->(protocol-key) - GetHMACBitLength() int // HMAC output size, h - GetMessageBlockByteSize() int // message block size, m - EncryptData(key, data []byte) ([]byte, []byte, error) // E function - encrypt (specific-key, state, octet string)->(state, octet string) - EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error) - DecryptData(key, data []byte) ([]byte, error) // D function - DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error) - GetCypherBlockBitLength() int // cipher block size, c - GetConfounderByteSize() int // This is the same as the cipher block size but in bytes. - DeriveKey(protocolKey, usage []byte) ([]byte, error) // DK key-derivation (protocol-key, integer)->(specific-key) - DeriveRandom(protocolKey, usage []byte) ([]byte, error) // DR pseudo-random (protocol-key, octet-string)->(octet-string) - VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool - GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error) - VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool - GetHashFunc() func() hash.Hash -} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/AuthorizationData.go b/vendor/gopkg.in/jcmturner/gokrb5.v7/types/AuthorizationData.go deleted file mode 100644 index c9448008b55..00000000000 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/AuthorizationData.go +++ /dev/null @@ -1,123 +0,0 @@ -package types - -import ( - "github.com/jcmturner/gofork/encoding/asn1" -) - -// Reference: https://www.ietf.org/rfc/rfc4120.txt -// Section: 5.2.6 - -/* -AuthorizationData - --- NOTE: AuthorizationData is always used as an OPTIONAL field and --- should not be empty. -AuthorizationData ::= SEQUENCE OF SEQUENCE { -ad-type [0] Int32, -ad-data [1] OCTET STRING -} - -ad-data -This field contains authorization data to be interpreted according -to the value of the corresponding ad-type field. - -ad-type - This field specifies the format for the ad-data subfield. All -negative values are reserved for local use. Non-negative values -are reserved for registered use. - -Each sequence of type and data is referred to as an authorization -element. Elements MAY be application specific; however, there is a -common set of recursive elements that should be understood by all -implementations. These elements contain other elements embedded -within them, and the interpretation of the encapsulating element -determines which of the embedded elements must be interpreted, and -which may be ignored. - -These common authorization data elements are recursively defined, -meaning that the ad-data for these types will itself contain a -sequence of authorization data whose interpretation is affected by -the encapsulating element. Depending on the meaning of the -encapsulating element, the encapsulated elements may be ignored, -might be interpreted as issued directly by the KDC, or might be -stored in a separate plaintext part of the ticket. The types of the -encapsulating elements are specified as part of the Kerberos -specification because the behavior based on these values should be -understood across implementations, whereas other elements need only -be understood by the applications that they affect. - -Authorization data elements are considered critical if present in a -ticket or authenticator. If an unknown authorization data element -type is received by a server either in an AP-REQ or in a ticket -contained in an AP-REQ, then, unless it is encapsulated in a known -authorization data element amending the criticality of the elements -it contains, authentication MUST fail. Authorization data is -intended to restrict the use of a ticket. If the service cannot -determine whether the restriction applies to that service, then a -security weakness may result if the ticket can be used for that -service. Authorization elements that are optional can be enclosed in -an AD-IF-RELEVANT element. - -In the definitions that follow, the value of the ad-type for the -element will be specified as the least significant part of the -subsection number, and the value of the ad-data will be as shown in -the ASN.1 structure that follows the subsection heading. - - Contents of ad-data ad-type - - DER encoding of AD-IF-RELEVANT 1 - - DER encoding of AD-KDCIssued 4 - - DER encoding of AD-AND-OR 5 - - DER encoding of AD-MANDATORY-FOR-KDC 8 - -*/ - -// AuthorizationData implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6 -type AuthorizationData []AuthorizationDataEntry - -// AuthorizationDataEntry implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6 -type AuthorizationDataEntry struct { - ADType int32 `asn1:"explicit,tag:0"` - ADData []byte `asn1:"explicit,tag:1"` -} - -// ADIfRelevant implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.1 -type ADIfRelevant AuthorizationData - -// ADKDCIssued implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.2 -type ADKDCIssued struct { - ADChecksum Checksum `asn1:"explicit,tag:0"` - IRealm string `asn1:"optional,generalstring,explicit,tag:1"` - Isname PrincipalName `asn1:"optional,explicit,tag:2"` - Elements AuthorizationData `asn1:"explicit,tag:3"` -} - -// ADAndOr implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.3 -type ADAndOr struct { - ConditionCount int32 `asn1:"explicit,tag:0"` - Elements AuthorizationData `asn1:"explicit,tag:1"` -} - -// ADMandatoryForKDC implements RFC 4120 type: https://tools.ietf.org/html/rfc4120#section-5.2.6.4 -type ADMandatoryForKDC AuthorizationData - -// Unmarshal bytes into the ADKDCIssued. -func (a *ADKDCIssued) Unmarshal(b []byte) error { - _, err := asn1.Unmarshal(b, a) - return err -} - -// Unmarshal bytes into the AuthorizationData. -func (a *AuthorizationData) Unmarshal(b []byte) error { - _, err := asn1.Unmarshal(b, a) - return err -} - -// Unmarshal bytes into the AuthorizationDataEntry. -func (a *AuthorizationDataEntry) Unmarshal(b []byte) error { - _, err := asn1.Unmarshal(b, a) - return err -} diff --git a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/KerberosFlags.go b/vendor/gopkg.in/jcmturner/gokrb5.v7/types/KerberosFlags.go deleted file mode 100644 index bd75d5b5cd8..00000000000 --- a/vendor/gopkg.in/jcmturner/gokrb5.v7/types/KerberosFlags.go +++ /dev/null @@ -1,124 +0,0 @@ -package types - -// Reference: https://www.ietf.org/rfc/rfc4120.txt -// Section: 5.2.8 - -import ( - "github.com/jcmturner/gofork/encoding/asn1" -) - -/* -KerberosFlags - -For several message types, a specific constrained bit string type, -KerberosFlags, is used. - -KerberosFlags ::= BIT STRING (SIZE (32..MAX)) --- minimum number of bits shall be sent, --- but no fewer than 32 - -Compatibility note: The following paragraphs describe a change from -the RFC 1510 description of bit strings that would result in -incompatility in the case of an implementation that strictly -conformed to ASN.1 DER and RFC 1510. - -ASN.1 bit strings have multiple uses. The simplest use of a bit -string is to contain a vector of bits, with no particular meaning -attached to individual bits. This vector of bits is not necessarily -a multiple of eight bits long. The use in Kerberos of a bit string -as a compact boolean vector wherein each element has a distinct -meaning poses some problems. The natural notation for a compact -boolean vector is the ASN.1 "NamedBit" notation, and the DER require -that encodings of a bit string using "NamedBit" notation exclude any -trailing zero bits. This truncation is easy to neglect, especially -given C language implementations that naturally choose to store -boolean vectors as 32-bit integers. - -For example, if the notation for KDCOptions were to include the -"NamedBit" notation, as in RFC 1510, and a KDCOptions value to be -encoded had only the "forwardable" (bit number one) bit set, the DER -encoding MUST include only two bits: the first reserved bit -("reserved", bit number zero, value zero) and the one-valued bit (bit -number one) for "forwardable". - -Most existing implementations of Kerberos unconditionally send 32 -bits on the wire when encoding bit strings used as boolean vectors. -This behavior violates the ASN.1 syntax used for flag values in RFC -1510, but it occurs on such a widely installed base that the protocol -description is being modified to accommodate it. - -Consequently, this document removes the "NamedBit" notations for -individual bits, relegating them to comments. The size constraint on -the KerberosFlags type requires that at least 32 bits be encoded at -all times, though a lenient implementation MAY choose to accept fewer -than 32 bits and to treat the missing bits as set to zero. - -Currently, no uses of KerberosFlags specify more than 32 bits' worth -of flags, although future revisions of this document may do so. When -more than 32 bits are to be transmitted in a KerberosFlags value, -future revisions to this document will likely specify that the -smallest number of bits needed to encode the highest-numbered one- -valued bit should be sent. This is somewhat similar to the DER -encoding of a bit string that is declared with the "NamedBit" -notation. -*/ - -// NewKrbFlags returns an ASN1 BitString struct of the right size for KrbFlags. -func NewKrbFlags() asn1.BitString { - f := asn1.BitString{} - f.Bytes = make([]byte, 4) - f.BitLength = len(f.Bytes) * 8 - return f -} - -// SetFlags sets the flags of an ASN1 BitString. -func SetFlags(f *asn1.BitString, j []int) { - for _, i := range j { - SetFlag(f, i) - } -} - -// SetFlag sets a flag in an ASN1 BitString. -func SetFlag(f *asn1.BitString, i int) { - for l := len(f.Bytes); l < 4; l++ { - (*f).Bytes = append((*f).Bytes, byte(0)) - (*f).BitLength = len((*f).Bytes) * 8 - } - //Which byte? - b := i / 8 - //Which bit in byte - p := uint(7 - (i - 8*b)) - (*f).Bytes[b] = (*f).Bytes[b] | (1 << p) -} - -// UnsetFlags unsets flags in an ASN1 BitString. -func UnsetFlags(f *asn1.BitString, j []int) { - for _, i := range j { - UnsetFlag(f, i) - } -} - -// UnsetFlag unsets a flag in an ASN1 BitString. -func UnsetFlag(f *asn1.BitString, i int) { - for l := len(f.Bytes); l < 4; l++ { - (*f).Bytes = append((*f).Bytes, byte(0)) - (*f).BitLength = len((*f).Bytes) * 8 - } - //Which byte? - b := i / 8 - //Which bit in byte - p := uint(7 - (i - 8*b)) - (*f).Bytes[b] = (*f).Bytes[b] &^ (1 << p) -} - -// IsFlagSet tests if a flag is set in the ASN1 BitString. -func IsFlagSet(f *asn1.BitString, i int) bool { - //Which byte? - b := i / 8 - //Which bit in byte - p := uint(7 - (i - 8*b)) - if (*f).Bytes[b]&(1< 0 { - // [Go] A line comment was previously provided for the key. Handle it before - // the value so the inline comments are placed correctly. - if yaml_emitter_silent_nil_event(emitter, event) && len(emitter.line_comment) == 0 { - // Nothing other than the line comment will be written on the line. - emitter.line_comment = emitter.key_line_comment - emitter.key_line_comment = nil - } else { - // An actual value is coming, so emit the comment line. + // [Go] Line comments are generally associated with the value, but when there's + // no value on the same line as a mapping key they end up attached to the + // key itself. + if event.typ == yaml_SCALAR_EVENT { + if len(emitter.line_comment) == 0 { + // A scalar is coming and it has no line comments by itself yet, + // so just let it handle the line comment as usual. If it has a + // line comment, we can't have both so the one from the key is lost. + emitter.line_comment = emitter.key_line_comment + emitter.key_line_comment = nil + } + } else if event.sequence_style() != yaml_FLOW_SEQUENCE_STYLE && (event.typ == yaml_MAPPING_START_EVENT || event.typ == yaml_SEQUENCE_START_EVENT) { + // An indented block follows, so write the comment right now. emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment if !yaml_emitter_process_line_comment(emitter) { return false } emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment - // Indent in unless it's a block that will reindent anyway. - if event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || (event.typ != yaml_MAPPING_START_EVENT && event.typ != yaml_SEQUENCE_START_EVENT) { - emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) - if !yaml_emitter_write_indent(emitter) { - return false - } - } } } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) @@ -1896,7 +1894,7 @@ func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - if !put_break(emitter) { + if !yaml_emitter_process_line_comment(emitter) { return false } //emitter.indention = true @@ -1933,10 +1931,10 @@ func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) boo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - - if !put_break(emitter) { + if !yaml_emitter_process_line_comment(emitter) { return false } + //emitter.indention = true emitter.whitespace = true diff --git a/vendor/gopkg.in/yaml.v3/encode.go b/vendor/gopkg.in/yaml.v3/encode.go index 45e8d1e1b9f..de9e72a3e63 100644 --- a/vendor/gopkg.in/yaml.v3/encode.go +++ b/vendor/gopkg.in/yaml.v3/encode.go @@ -120,6 +120,11 @@ func (e *encoder) marshal(tag string, in reflect.Value) { e.nodev(in) return case Node: + if !in.CanAddr() { + var n = reflect.New(in.Type()).Elem() + n.Set(in) + in = n + } e.nodev(in.Addr()) return case time.Time: diff --git a/vendor/gopkg.in/yaml.v3/scannerc.go b/vendor/gopkg.in/yaml.v3/scannerc.go index d9a539c39ae..ca0070108f4 100644 --- a/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/vendor/gopkg.in/yaml.v3/scannerc.go @@ -2260,10 +2260,9 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l } } if parser.buffer[parser.buffer_pos] == '#' { - // TODO Test this and then re-enable it. - //if !yaml_parser_scan_line_comment(parser, start_mark) { - // return false - //} + if !yaml_parser_scan_line_comment(parser, start_mark) { + return false + } for !is_breakz(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -2892,6 +2891,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo var token_mark = token.start_mark var start_mark yaml_mark_t + var next_indent = parser.indent + if next_indent < 0 { + next_indent = 0 + } var recent_empty = false var first_empty = parser.newlines <= 1 @@ -2923,15 +2926,18 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo continue } c := parser.buffer[parser.buffer_pos+peek] - if is_breakz(parser.buffer, parser.buffer_pos+peek) || parser.flow_level > 0 && (c == ']' || c == '}') { + var close_flow = parser.flow_level > 0 && (c == ']' || c == '}') + if close_flow || is_breakz(parser.buffer, parser.buffer_pos+peek) { // Got line break or terminator. - if !recent_empty { - if first_empty && (start_mark.line == foot_line || start_mark.column-1 < parser.indent) { + if close_flow || !recent_empty { + if close_flow || first_empty && (start_mark.line == foot_line && token.typ != yaml_VALUE_TOKEN || start_mark.column-1 < next_indent) { // This is the first empty line and there were no empty lines before, // so this initial part of the comment is a foot of the prior token // instead of being a head for the following one. Split it up. + // Alternatively, this might also be the last comment inside a flow + // scope, so it must be a footer. if len(text) > 0 { - if start_mark.column-1 < parser.indent { + if start_mark.column-1 < next_indent { // If dedented it's unrelated to the prior token. token_mark = start_mark } @@ -2962,7 +2968,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo continue } - if len(text) > 0 && column < parser.indent+1 && column != start_mark.column { + if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.column) { // The comment at the different indentation is a foot of the // preceding data rather than a head of the upcoming one. parser.comments = append(parser.comments, yaml_comment_t{ @@ -3013,6 +3019,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo peek = 0 column = 0 line = parser.mark.line + next_indent = parser.indent + if next_indent < 0 { + next_indent = 0 + } } if len(text) > 0 { diff --git a/vendor/gopkg.in/yaml.v3/yaml.go b/vendor/gopkg.in/yaml.v3/yaml.go index 56e8a849031..8cec6da48d3 100644 --- a/vendor/gopkg.in/yaml.v3/yaml.go +++ b/vendor/gopkg.in/yaml.v3/yaml.go @@ -449,6 +449,11 @@ func (n *Node) ShortTag() string { case ScalarNode: tag, _ := resolve("", n.Value) return tag + case 0: + // Special case to make the zero value convenient. + if n.IsZero() { + return nullTag + } } return "" } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4f986d26443..d5629083eea 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -31,7 +31,7 @@ github.com/NYTimes/gziphandler github.com/PuerkitoBio/purell # github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 github.com/PuerkitoBio/urlesc -# github.com/Shopify/sarama v1.27.2 +# github.com/Shopify/sarama v1.28.0 github.com/Shopify/sarama # github.com/VividCortex/gohistogram v1.0.0 github.com/VividCortex/gohistogram @@ -323,7 +323,7 @@ github.com/gocql/gocql/internal/streams # github.com/gogo/googleapis v1.3.0 github.com/gogo/googleapis/google/api github.com/gogo/googleapis/google/rpc -# github.com/gogo/protobuf v1.3.1 +# github.com/gogo/protobuf v1.3.2 ## explicit github.com/gogo/protobuf/gogoproto github.com/gogo/protobuf/jsonpb @@ -375,7 +375,7 @@ github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value # github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2 github.com/google/pprof/profile -# github.com/google/uuid v1.1.2 +# github.com/google/uuid v1.2.0 ## explicit github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.0.5 @@ -505,9 +505,47 @@ github.com/jaegertracing/jaeger/thrift-gen/baggage github.com/jaegertracing/jaeger/thrift-gen/jaeger github.com/jaegertracing/jaeger/thrift-gen/sampling github.com/jaegertracing/jaeger/thrift-gen/zipkincore +# github.com/jcmturner/aescts/v2 v2.0.0 +github.com/jcmturner/aescts/v2 +# github.com/jcmturner/dnsutils/v2 v2.0.0 +github.com/jcmturner/dnsutils/v2 # github.com/jcmturner/gofork v1.0.0 github.com/jcmturner/gofork/encoding/asn1 github.com/jcmturner/gofork/x/crypto/pbkdf2 +# github.com/jcmturner/gokrb5/v8 v8.4.2 +github.com/jcmturner/gokrb5/v8/asn1tools +github.com/jcmturner/gokrb5/v8/client +github.com/jcmturner/gokrb5/v8/config +github.com/jcmturner/gokrb5/v8/credentials +github.com/jcmturner/gokrb5/v8/crypto +github.com/jcmturner/gokrb5/v8/crypto/common +github.com/jcmturner/gokrb5/v8/crypto/etype +github.com/jcmturner/gokrb5/v8/crypto/rfc3961 +github.com/jcmturner/gokrb5/v8/crypto/rfc3962 +github.com/jcmturner/gokrb5/v8/crypto/rfc4757 +github.com/jcmturner/gokrb5/v8/crypto/rfc8009 +github.com/jcmturner/gokrb5/v8/gssapi +github.com/jcmturner/gokrb5/v8/iana +github.com/jcmturner/gokrb5/v8/iana/addrtype +github.com/jcmturner/gokrb5/v8/iana/adtype +github.com/jcmturner/gokrb5/v8/iana/asnAppTag +github.com/jcmturner/gokrb5/v8/iana/chksumtype +github.com/jcmturner/gokrb5/v8/iana/errorcode +github.com/jcmturner/gokrb5/v8/iana/etypeID +github.com/jcmturner/gokrb5/v8/iana/flags +github.com/jcmturner/gokrb5/v8/iana/keyusage +github.com/jcmturner/gokrb5/v8/iana/msgtype +github.com/jcmturner/gokrb5/v8/iana/nametype +github.com/jcmturner/gokrb5/v8/iana/patype +github.com/jcmturner/gokrb5/v8/kadmin +github.com/jcmturner/gokrb5/v8/keytab +github.com/jcmturner/gokrb5/v8/krberror +github.com/jcmturner/gokrb5/v8/messages +github.com/jcmturner/gokrb5/v8/pac +github.com/jcmturner/gokrb5/v8/types +# github.com/jcmturner/rpc/v2 v2.0.3 +github.com/jcmturner/rpc/v2/mstypes +github.com/jcmturner/rpc/v2/ndr # github.com/jessevdk/go-flags v1.4.0 github.com/jessevdk/go-flags # github.com/jmespath/go-jmespath v0.4.0 @@ -618,7 +656,7 @@ github.com/openzipkin/zipkin-go/model github.com/openzipkin/zipkin-go/proto/zipkin_proto3 # github.com/pelletier/go-toml v1.8.0 github.com/pelletier/go-toml -# github.com/pierrec/lz4 v2.5.2+incompatible +# github.com/pierrec/lz4 v2.6.0+incompatible github.com/pierrec/lz4 github.com/pierrec/lz4/internal/xxh32 # github.com/pierrec/lz4/v4 v4.1.3 @@ -687,7 +725,7 @@ github.com/prometheus/client_golang/prometheus/push # github.com/prometheus/client_model v0.2.0 ## explicit github.com/prometheus/client_model/go -# github.com/prometheus/common v0.15.0 +# github.com/prometheus/common v0.17.0 ## explicit github.com/prometheus/common/config github.com/prometheus/common/expfmt @@ -750,7 +788,7 @@ github.com/prometheus/prometheus/web/api/v1 # github.com/prometheus/statsd_exporter v0.15.0 github.com/prometheus/statsd_exporter/pkg/mapper github.com/prometheus/statsd_exporter/pkg/mapper/fsm -# github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 +# github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 github.com/rcrowley/go-metrics # github.com/rs/cors v1.7.0 github.com/rs/cors @@ -773,7 +811,7 @@ github.com/shurcooL/vfsgen # github.com/sirupsen/logrus v1.6.0 ## explicit github.com/sirupsen/logrus -# github.com/soheilhy/cmux v0.1.4 +# github.com/soheilhy/cmux v0.1.4 => github.com/soheilhy/cmux v0.1.5 github.com/soheilhy/cmux # github.com/sony/gobreaker v0.4.1 github.com/sony/gobreaker @@ -784,7 +822,7 @@ github.com/spf13/afero github.com/spf13/afero/mem # github.com/spf13/cast v1.3.1 github.com/spf13/cast -# github.com/spf13/cobra v1.1.1 +# github.com/spf13/cobra v1.1.3 github.com/spf13/cobra # github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman @@ -795,7 +833,7 @@ github.com/spf13/pflag github.com/spf13/viper # github.com/stretchr/objx v0.2.0 github.com/stretchr/objx -# github.com/stretchr/testify v1.6.1 +# github.com/stretchr/testify v1.7.0 ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/mock @@ -895,6 +933,10 @@ github.com/willf/bitset # github.com/willf/bloom v2.0.3+incompatible ## explicit github.com/willf/bloom +# github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c +github.com/xdg-go/scram +# github.com/xdg/stringprep v1.0.0 +github.com/xdg/stringprep # github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 github.com/xiang90/probing # go.etcd.io/bbolt v1.3.5-0.20200615073812-232d8fc87f50 @@ -985,7 +1027,7 @@ go.mongodb.org/mongo-driver/bson/bsonrw go.mongodb.org/mongo-driver/bson/bsontype go.mongodb.org/mongo-driver/bson/primitive go.mongodb.org/mongo-driver/x/bsonx/bsoncore -# go.opencensus.io v0.22.5 +# go.opencensus.io v0.22.6 ## explicit go.opencensus.io go.opencensus.io/internal @@ -1006,7 +1048,7 @@ go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate -# go.opentelemetry.io/collector v0.16.0 +# go.opentelemetry.io/collector v0.21.0 ## explicit go.opentelemetry.io/collector/client go.opentelemetry.io/collector/component @@ -1029,14 +1071,14 @@ go.opentelemetry.io/collector/exporter/exporterhelper go.opentelemetry.io/collector/exporter/kafkaexporter go.opentelemetry.io/collector/internal go.opentelemetry.io/collector/internal/data -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/logs/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/metrics/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/collector/trace/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/logs/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/metrics/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/resource/v1 -go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1 +go.opentelemetry.io/collector/internal/data/protogen/collector/logs/v1 +go.opentelemetry.io/collector/internal/data/protogen/collector/metrics/v1 +go.opentelemetry.io/collector/internal/data/protogen/collector/trace/v1 +go.opentelemetry.io/collector/internal/data/protogen/common/v1 +go.opentelemetry.io/collector/internal/data/protogen/logs/v1 +go.opentelemetry.io/collector/internal/data/protogen/metrics/v1 +go.opentelemetry.io/collector/internal/data/protogen/resource/v1 +go.opentelemetry.io/collector/internal/data/protogen/trace/v1 go.opentelemetry.io/collector/internal/middleware go.opentelemetry.io/collector/obsreport go.opentelemetry.io/collector/receiver/jaegerreceiver @@ -1085,7 +1127,7 @@ go.uber.org/zap/internal/bufferpool go.uber.org/zap/internal/color go.uber.org/zap/internal/exit go.uber.org/zap/zapcore -# golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 +# golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad golang.org/x/crypto/argon2 golang.org/x/crypto/bcrypt golang.org/x/crypto/blake2b @@ -1100,7 +1142,7 @@ golang.org/x/lint/golint # golang.org/x/mod v0.3.0 golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.0.0-20201224014010-6772e930b67b +# golang.org/x/net v0.0.0-20210119194325-5f4716e94777 golang.org/x/net/bpf golang.org/x/net/context golang.org/x/net/context/ctxhttp @@ -1135,7 +1177,7 @@ golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc/eventlog -# golang.org/x/text v0.3.4 +# golang.org/x/text v0.3.5 golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi @@ -1144,7 +1186,7 @@ golang.org/x/text/width # golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 ## explicit golang.org/x/time/rate -# golang.org/x/tools v0.0.0-20201228162255-34cd474b9958 +# golang.org/x/tools v0.0.0-20210106214847-113979e3529a golang.org/x/tools/cmd/goimports golang.org/x/tools/go/ast/astutil golang.org/x/tools/go/gcexportdata @@ -1202,7 +1244,7 @@ google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/status google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/protobuf/field_mask -# google.golang.org/grpc v1.33.2 => google.golang.org/grpc v1.29.1 +# google.golang.org/grpc v1.35.0 => google.golang.org/grpc v1.29.1 ## explicit google.golang.org/grpc google.golang.org/grpc/attributes @@ -1311,44 +1353,6 @@ gopkg.in/fsnotify/fsnotify.v1 gopkg.in/inf.v0 # gopkg.in/ini.v1 v1.57.0 gopkg.in/ini.v1 -# gopkg.in/jcmturner/aescts.v1 v1.0.1 -gopkg.in/jcmturner/aescts.v1 -# gopkg.in/jcmturner/dnsutils.v1 v1.0.1 -gopkg.in/jcmturner/dnsutils.v1 -# gopkg.in/jcmturner/gokrb5.v7 v7.5.0 -gopkg.in/jcmturner/gokrb5.v7/asn1tools -gopkg.in/jcmturner/gokrb5.v7/client -gopkg.in/jcmturner/gokrb5.v7/config -gopkg.in/jcmturner/gokrb5.v7/credentials -gopkg.in/jcmturner/gokrb5.v7/crypto -gopkg.in/jcmturner/gokrb5.v7/crypto/common -gopkg.in/jcmturner/gokrb5.v7/crypto/etype -gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3961 -gopkg.in/jcmturner/gokrb5.v7/crypto/rfc3962 -gopkg.in/jcmturner/gokrb5.v7/crypto/rfc4757 -gopkg.in/jcmturner/gokrb5.v7/crypto/rfc8009 -gopkg.in/jcmturner/gokrb5.v7/gssapi -gopkg.in/jcmturner/gokrb5.v7/iana -gopkg.in/jcmturner/gokrb5.v7/iana/addrtype -gopkg.in/jcmturner/gokrb5.v7/iana/adtype -gopkg.in/jcmturner/gokrb5.v7/iana/asnAppTag -gopkg.in/jcmturner/gokrb5.v7/iana/chksumtype -gopkg.in/jcmturner/gokrb5.v7/iana/errorcode -gopkg.in/jcmturner/gokrb5.v7/iana/etypeID -gopkg.in/jcmturner/gokrb5.v7/iana/flags -gopkg.in/jcmturner/gokrb5.v7/iana/keyusage -gopkg.in/jcmturner/gokrb5.v7/iana/msgtype -gopkg.in/jcmturner/gokrb5.v7/iana/nametype -gopkg.in/jcmturner/gokrb5.v7/iana/patype -gopkg.in/jcmturner/gokrb5.v7/kadmin -gopkg.in/jcmturner/gokrb5.v7/keytab -gopkg.in/jcmturner/gokrb5.v7/krberror -gopkg.in/jcmturner/gokrb5.v7/messages -gopkg.in/jcmturner/gokrb5.v7/pac -gopkg.in/jcmturner/gokrb5.v7/types -# gopkg.in/jcmturner/rpc.v1 v1.1.0 -gopkg.in/jcmturner/rpc.v1/mstypes -gopkg.in/jcmturner/rpc.v1/ndr # gopkg.in/square/go-jose.v2 v2.5.1 gopkg.in/square/go-jose.v2 gopkg.in/square/go-jose.v2/cipher @@ -1356,7 +1360,7 @@ gopkg.in/square/go-jose.v2/json # gopkg.in/yaml.v2 v2.4.0 ## explicit gopkg.in/yaml.v2 -# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 +# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ## explicit gopkg.in/yaml.v3 # rsc.io/binaryregexp v0.2.0 @@ -1375,3 +1379,4 @@ sigs.k8s.io/yaml # k8s.io/client-go => k8s.io/client-go v0.19.2 # github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.4 # github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.8 +# github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5 From 44caae15b73cd2510c6e0d7025e36b4e45b40d5d Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Date: Mon, 5 Apr 2021 17:25:54 +0200 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 344dc2f3acb..5e65dc2e320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * [BUGFIX] Fixes issue where Tempo would not parse odd length trace ids [#605](https://github.com/grafana/tempo/pull/605) * [BUGFIX] Sort traces on flush to reduce unexpected recombination work by compactors [#606](https://github.com/grafana/tempo/pull/606) * [ENHANCEMENT] Add kafka receiver. [#613](https://github.com/grafana/tempo/pull/613) +* [ENHANCEMENT] Upgrade OTel collector to `v0.21.0`. [#613](https://github.com/grafana/tempo/pull/627) ## v0.6.0 From acaf4da2ab086438698580aba97ec63640d12624 Mon Sep 17 00:00:00 2001 From: Mario Rodriguez Date: Mon, 5 Apr 2021 17:41:41 +0200 Subject: [PATCH 3/3] Explain why cmux pin is necessary --- go.mod | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 8f38173859f..026d6ed8240 100644 --- a/go.mod +++ b/go.mod @@ -81,4 +81,7 @@ replace ( github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.8 ) +// Pin github.com/soheilhy/cmux to control grpc required version. +// Before v0.1.5 it contained examples in the root folder that imported grpc without a version, +// and therefore were importing grpc latest (which is problematic because we need github.com/soheilhy/cmux v0.1.5