Skip to content

Commit

Permalink
Merge branch 'main' into feat/default-tls12
Browse files Browse the repository at this point in the history
  • Loading branch information
kruskall authored May 22, 2024
2 parents aac914e + c77acef commit 3e43bee
Show file tree
Hide file tree
Showing 28 changed files with 2,435 additions and 176 deletions.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ List here all the items you have verified BEFORE sending this PR. Please DO NOT
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added an entry in `CHANGELOG.md`

## Author's Checklist

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/opentelemetry.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
# Look up results at https://ela.st/oblt-ci-cd-stats
# There will be one service per GitHub repository, including the org name, and one Transaction per Workflow.
name: OpenTelemetry Export Trace

on:
workflow_run:
workflows:
- golangci-lint
workflows: [ "*" ]
types: [completed]

permissions:
contents: read

jobs:
otel-export-trace:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.6
1.21.10
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ linters-settings:

gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.21.6"
go: "1.21.10"

nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
Expand Down Expand Up @@ -117,19 +117,19 @@ linters-settings:

staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.21.6"
go: "1.21.10"
# https://staticcheck.io/docs/options#checks
checks: ["all"]

stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.21.6"
go: "1.21.10"
# https://staticcheck.io/docs/options#checks
checks: ["all"]

unused:
# Select the Go version to target. The default is '1.13'.
go: "1.21.6"
go: "1.21.10"

gosec:
excludes:
Expand Down
116 changes: 58 additions & 58 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,36 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/
limitations under the License.


--------------------------------------------------------------------------------
Dependency : github.com/elastic/pkcs8
Version: v1.0.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]/LICENSE:

The MIT License (MIT)

Copyright (c) 2014 youmark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/fatih/color
Version: v1.13.0
Expand Down Expand Up @@ -1251,36 +1281,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


--------------------------------------------------------------------------------
Dependency : github.com/youmark/pkcs8
Version: v0.0.0-20201027041543-1326539a0a0a
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/youmark/[email protected]/LICENSE:

The MIT License (MIT)

Copyright (c) 2014 youmark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--------------------------------------------------------------------------------
Dependency : go.elastic.co/apm/module/apmhttp/v2
Version: v2.0.0
Expand Down Expand Up @@ -1917,11 +1917,11 @@ Contents of probable licence file $GOMODCACHE/go.elastic.co/go-licence-detector@

--------------------------------------------------------------------------------
Dependency : go.uber.org/zap
Version: v1.21.0
Version: v1.27.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.21.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/go.uber.org/zap@v1.27.0/LICENSE:

Copyright (c) 2016-2017 Uber Technologies, Inc.

Expand All @@ -1946,11 +1946,11 @@ THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/crypto
Version: v0.17.0
Version: v0.22.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.17.0/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/crypto@v0.22.0/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -1983,11 +1983,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/net
Version: v0.17.0
Version: v0.23.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.17.0/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/net@v0.23.0/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -2020,11 +2020,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/sys
Version: v0.15.0
Version: v0.19.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.15.0/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/sys@v0.19.0/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -2641,11 +2641,11 @@ Contents of probable licence file $GOMODCACHE/github.com/elastic/go-licenser@v0.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/go-sysinfo
Version: v1.7.1
Version: v1.14.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.7.1/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/elastic/go-sysinfo@v1.14.0/LICENSE.txt:


Apache License
Expand Down Expand Up @@ -3096,11 +3096,11 @@ SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/google/go-cmp
Version: v0.5.4
Version: v0.6.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.5.4/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/google/go-cmp@v0.6.0/LICENSE:

Copyright (c) 2017 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -3933,11 +3933,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/kr/text
Version: v0.1.0
Version: v0.2.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.1.0/License:
Contents of probable licence file $GOMODCACHE/github.com/kr/text@v0.2.0/License:

Copyright 2012 Keith Rarick

Expand Down Expand Up @@ -4111,11 +4111,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : github.com/prometheus/procfs
Version: v0.7.3
Version: v0.13.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.7.3/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/prometheus/procfs@v0.13.0/LICENSE:

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -4803,11 +4803,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

--------------------------------------------------------------------------------
Dependency : go.uber.org/atomic
Version: v1.9.0
Version: v1.7.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.uber.org/atomic@v1.9.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/go.uber.org/atomic@v1.7.0/LICENSE.txt:

Copyright (c) 2016 Uber Technologies, Inc.

Expand All @@ -4832,11 +4832,11 @@ THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : go.uber.org/goleak
Version: v1.1.12
Version: v1.3.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.1.12/LICENSE:
Contents of probable licence file $GOMODCACHE/go.uber.org/goleak@v1.3.0/LICENSE:

The MIT License (MIT)

Expand All @@ -4863,11 +4863,11 @@ THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : go.uber.org/multierr
Version: v1.8.0
Version: v1.11.0
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.8.0/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/go.uber.org/multierr@v1.11.0/LICENSE.txt:

Copyright (c) 2017-2021 Uber Technologies, Inc.

Expand Down Expand Up @@ -4966,11 +4966,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/sync
Version: v0.1.0
Version: v0.6.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.1.0/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/sync@v0.6.0/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -5003,11 +5003,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : golang.org/x/term
Version: v0.15.0
Version: v0.19.0
Licence type (autodetected): BSD-3-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.15.0/LICENSE:
Contents of probable licence file $GOMODCACHE/golang.org/x/term@v0.19.0/LICENSE:

Copyright (c) 2009 The Go Authors. All rights reserved.

Expand Down Expand Up @@ -5475,11 +5475,11 @@ limitations under the License.

--------------------------------------------------------------------------------
Dependency : howett.net/plist
Version: v1.0.0
Version: v1.0.1
Licence type (autodetected): BSD-2-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/howett.net/[email protected].0/LICENSE:
Contents of probable licence file $GOMODCACHE/howett.net/[email protected].1/LICENSE:

Copyright (c) 2013, Dustin L. Howett. All rights reserved.

Expand Down
16 changes: 16 additions & 0 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ func New(log *logp.Logger, mux *http.ServeMux, c *config.C) (*Server, error) {
if err != nil {
return nil, err
}
return new(log, mux, cfg)
}

// NewFromConfig creates a new API server from the given Config object.
func NewFromConfig(log *logp.Logger, mux *http.ServeMux, cfg Config) (*Server, error) {
return new(log, mux, cfg)
}

// new creates the server from a config struct
func new(log *logp.Logger, mux *http.ServeMux, cfg Config) (*Server, error) {
srv := &http.Server{ReadHeaderTimeout: cfg.Timeout}
l, err := makeListener(cfg)
if err != nil {
Expand Down Expand Up @@ -91,6 +101,12 @@ func (s *Server) Shutdown(ctx context.Context) error {
return s.srv.Shutdown(ctx)
}

// Addr returns the network address of the server
// This is useful for tests, where we usually pass the port as `0` to get allocated a random free port
func (s *Server) Addr() net.Addr {
return s.l.Addr()
}

// AttachHandler will attach a handler at the specified route and return an error instead of panicing.
func (s *Server) AttachHandler(route string, h http.Handler) (err error) {
defer func() {
Expand Down
Loading

0 comments on commit 3e43bee

Please sign in to comment.