Commit Graph
879 Commits
Author SHA1 Message Date
Zac Bergquist 693d110642 fix: use Go 1.18+ build tag syntax (#53746)
All of our supported release branches are well past Go 1.18, so
we don't need to support the old build tag syntax.

Changes made by running `go fix ./...`.
2025-04-07 12:35:51 +00:00
rosstimothy d002d1e43a Require that FnCache keys are comparable (#53565)
Adds an additional type constraint go FnCacheGet and FnCacheGetWithTTL
to enforce that all keys are comparable. This should allow the
removal of various compile time hashability checks that are in
place for existing keys of custom types.
2025-03-29 14:40:32 +00:00
Gabriel Corado 1db489562b Remove unused AWS SDK v1 references (#53537)
* refactor(aws): remove unused sdk v1 references

* refactor(aws): drop unused migration package

* chore: go mod tidy
2025-03-29 02:25:01 +00:00
Hugo Shaka c20095e9d6 Align semver libs (#52795)
* Convert autoupdate version handling to coreos/go-semver

* get the right version in installer endpoint + get rid of x/mod/semver

* depguard x/mod/semver

* Add nolint rules for existing x/mod/semver usages

* Add depguard explanation
2025-03-19 18:03:35 +00:00
Gabriel Corado bcf1625f9a Remove AWS SDK V1 references (#52990)
* refactor: remove references to aws sdk v1

* refactor(aws): remove legacy error conversion for s3

* refactor(awsoidc): remove unused clientv1

* refactor: code review suggestions

* refactor: move xml helper functions into alpnproxy package

* chore(gomod): move into lambda direct dep

* chore: fix import order
2025-03-18 15:43:12 +00:00
Dan Upton a79ad40713 lib/utils/typical: support == and != operators for integers (#52521)
* lib/utils/typical: support `==` and `!=` operators for integers

In #52460, we're adopting the Teleport predicate language for Workload Identity
rules. We currently allow you to match on the equality/inequality of the attested
process' PID, GID, and UID, but this wasn't supported in the predicate language.

We now check the operand types at compile-time and choose the correct
booleanOperator. If both operands are dynamically typed (e.g. `ifelse`) we do
not allow you to use the `==` or `!=` operators.

* Fix compile/parse time nomenclature

* Rename type parameters for clarity
2025-03-11 19:18:57 +00:00
Forrest ee8fd94082 implement ssh access decision method prototype (#52542)
* implement ssh access decision method prototype

* improve internal ssh extension handling
2025-03-11 10:31:55 +00:00
Zac Bergquist b0049ecc2a Remove the custom current user lookup function (#52144)
We added this function to mitigate slow user.Current() calls in
Windows Active Directory environments. Go 1.24 ships with an optimized
verison of user.Current, rendering this utility unnecessary.

Closes #41922
2025-03-04 23:43:54 +00:00
Rafał CieślakandGrzegorz Zdunek 468663ed91 Add version incompatibility warning to Connect (#51832)
* Refactor client version compat for reuse in lib/teleterm

* Remove ClustersService.getAuthSettigns, add test helper

* FormLogin: Nest AuthSettings under distinct prop

* Return client version status with auth settings

* Add UI for compatibility warning

* Do not use wildcards for TOO_OLD to mirror tsh

Also, handle TOO_OLD first to mirror lib/client/api.go.

* Adjust buttons to mirror the look of primaryAction/secondaryAction of Alert

* Do not show pre-release "-aa" suffix

* Fix title case in button

* Add skipVersionCheck to docs

---------

Co-authored-by: Grzegorz Zdunek <grzegorz.zdunek@goteleport.com>
2025-03-03 16:29:50 +00:00
rosstimothy 967053bb94 Use b.Loop in benchmark tests (#52520)
Prefer using b.Loop instead of b.N style benchmarks now that we are
using Go 1.24.

See https://pkg.go.dev/testing#B.Loop for more details.
2025-02-26 19:08:05 +00:00
Vadym Popov 206d1bc50b Fix Windows permission error with self remove (#52316)
* Fix windows permission error with self replace

* Aggregate errors

* Update comments
2025-02-25 22:34:07 +00:00
rosstimothy 5f2bd1cb47 Tweak sortcache.SortCache API (#52414)
- Adds (SortCache) Clear to allow resetting an existing cache
- Converts (SortCache) Ascend and (SortCache) Descend to return
  an iter.Seq[T] instead of taking an iteration function
- Removes (SortCache) AscendPaginated and (SortCache) DescendPaginated

Leveraging iterates aligns the API with the direction that Go is
heading in regards to iteration. Removing of the paginated functions
does put the onus on callers to paginate, however, in the only
cases these were used there are now fewer allocations. AscendPaginated
was unused and DescendPaginated was only used in two places - both
of which would benefit from migrating away from using streams in
favor of iter.Seq.

The new Clear API makes it easier for callers to reset an existing
cache. Without this change the only way to reset a cache would be
to replace the entire cache with a new one. This places the burden
on callers to apply locking and handle concurrent read/write/deletes
and swapping out the cache entirely. That all is eliminated by
Clear handling the internal locking to reset the cache state.
2025-02-25 17:56:54 +00:00
Hugo Shaka 2ae8e3c1db Allow prerelease Teleport to install official artifacts (#52444) 2025-02-25 16:02:52 +00:00
8f02eb11df Add tctl plugins install awsic (#51239)
* Adds `tctl plugins install awsic`

Adds a comand-line installation tool for the AWS Identity Center integration.

Co-authored-by: Marek Smoliński <marek@goteleport.com>
Co-authored-by: Trent Clatke <trent@goteleport.com>

* Apply suggestions from code review

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Co-authored-by: Trent Clatke <trent@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2025-02-19 22:29:29 +00:00
Trent Clarke 1364c35d24 Move Identity Center validation tools to OSS (#52239)
In order to provide better validation when installing the IC integration via `tctl`,
this patch moves some IC-specific validation tools from `teleport.e` to
into the OSS repository.
2025-02-19 02:48:35 +00:00
Alan Parra e374c243d4 Move IsFIPSDisabledByEnv to lib/utils/aws/awsfips (#52123) 2025-02-14 12:25:47 +00:00
Roman TkachenkoandErik Tate 047bfb5472 adding ability to read ~/.tsh/environment files as the target user (#52135)
instead of root

Co-authored-by: Erik Tate <erik.tate@goteleport.com>
2025-02-13 19:12:40 +00:00
Alan Parra d3025b2a28 Apply the _DISABLE_AWS_FIPS setting to iam and stscreds (#52065)
* Add the iamutils package

* Add stsutils.NewCredentialsV1()

* Use iamutils.NewFromConfig()

* Use stsutils.NewCredentialsV1()

* Add forbidigo rules
2025-02-12 20:12:44 +00:00
Edoardo Spadolini 1b9c9c9435 Don't rely on SKID and AKID for IsSelfSigned (#52067) 2025-02-12 16:08:52 +00:00
Alan Parra 7f0c4e93bd feat: Allow non-FIPS endpoints on FIPS binaries (#51924)
* Add the dynamodbutils and stsutils packages

* Use stsutils.NewFromConfig()

* Use stsutils.NewV1()

* Use dynamodbutils.IsFIPSEnabled()

* Add forbidigo rules

* Appease linter
2025-02-11 22:45:04 +00:00
Michelle Bergquist cb07b42743 Fetch relevant regions for agents endpoint (#51814) 2025-02-07 21:42:29 +00:00
rosstimothy 591a0853f0 Improve performance of utils.ReplaceRegexp (#51872)
The main changes here are:

- Using an LRU cache to store compiled regular expressions.
- Removing stack traces captured by trace.NotFound/trace.Wrap
  when there are no matches.

This was heavily inspired by
https://github.com/gravitational/teleport/pull/23534 which made
similar changes to improve the performance of utils.MatchString.

The main beneficiaries of this change are services.MapRoles and
services.TraitsToRoles which rely heavily on
utils.ReplaceRegexp, utils.RegexpWithConfig, or ReplaceRegexpWith.

BenchmarkReplaceRegexp was added to validate the improvements in
this change and prevent regressions in the future. Results from
before and after this change:

benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/gravitational/teleport/lib/utils
cpu: Apple M2 Pro
                                    │    old.txt    │               new.txt               │
                                    │    sec/op     │   sec/op     vs base                │
ReplaceRegexp/same_expression-12      29.527µ ± 12%   6.837µ ± 1%  -76.84% (p=0.000 n=10)
ReplaceRegexp/unique_expressions-12    22.94µ ±  1%   25.10µ ± 1%   +9.41% (p=0.002 n=10)
ReplaceRegexp/no_matches-12           24.692µ ±  3%   2.861µ ± 1%  -88.41% (p=0.000 n=10)
geomean                                25.57µ         7.889µ       -69.15%

                                    │    old.txt    │               new.txt                │
                                    │     B/op      │     B/op      vs base                │
ReplaceRegexp/same_expression-12       22071.5 ± 1%     164.0 ± 0%  -99.26% (p=0.000 n=10)
ReplaceRegexp/unique_expressions-12    12.90Ki ± 1%   12.87Ki ± 0%        ~ (p=0.165 n=10)
ReplaceRegexp/no_matches-12           14257.00 ± 1%     15.00 ± 0%  -99.89% (p=0.000 n=10)
geomean                                15.70Ki          318.8       -98.02%

                                    │   old.txt   │                 new.txt                 │
                                    │  allocs/op  │ allocs/op   vs base                     │
ReplaceRegexp/same_expression-12      58.000 ± 0%   6.000 ± 0%   -89.66% (p=0.000 n=10)
ReplaceRegexp/unique_expressions-12    55.00 ± 0%   55.00 ± 0%         ~ (p=1.000 n=10) ¹
ReplaceRegexp/no_matches-12            58.00 ± 0%    0.00 ± 0%  -100.00% (p=0.000 n=10)
geomean                                56.98                    ?                       ² ³
¹ all samples are equal
² summaries must be >0 to compute geomean
³ ratios must be >0 to compute geomean
2025-02-06 20:34:56 +00:00
rosstimothy 2cced62805 Fix violations of non-constant format strings linter (#51812)
Depends on https://github.com/gravitational/teleport.e/pull/6006.
Now that we are compliant, the ignore rule was removed from the
golangci-lint config to prevent future regressions.
2025-02-04 16:43:35 +00:00
STeve (Xin) Huang 7b160600b8 Fix misaligned command usage for 'help' commands of Teleport binaries (#51660)
* Fix an issue command help is not aligned for help command

* align when unknown command/subcommand
2025-01-31 15:35:31 +00:00
Gavin Frazar b69d49b2a2 Simplify lib/utils/aws (#51627)
This eliminates the SigningService in favor of a free function
SignRequest, which eliminates AWS credential loading and simplifies the
AWS utils package.
In the process of doing this refactor, the AWS app handler has been
changed to use AWS SDK v2 to load its credentials as well.
2025-01-30 20:14:45 +00:00
Gabriel CoradoandSTeve Huang ad2774d6c5 Migrate AWS OpenSearch requests signing credential generation to AWS SDK V2 (#51149)
* refactor(opensearch): use aws config provider for signing service

* test(opensearch): cleanup unused code

* fix: accept a base role on the signing service

* feat(aws): provide a way to use different external id for role

* add external ID

---------

Co-authored-by: STeve Huang <xin.huang@goteleport.com>
2025-01-28 19:17:13 +00:00
Zac Bergquist d71293f964 Replace usages of x/exp/maps with stdlib maps package (#51448) 2025-01-28 14:54:40 +00:00
rosstimothy 63537e3da5 Prevent race creating test logger (#51469)
Avoids parsing flags of the go test command more than
once to prevent the following race:

```
 ==================
WARNING: DATA RACE
Write at 0x00c0006c401f by goroutine 57:
  flag.(*boolValue).Set()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/flag/flag.go:138 +0x26b
  flag.(*FlagSet).parseOne()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/flag/flag.go:1124 +0x781
  flag.(*FlagSet).Parse()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/flag/flag.go:1157 +0xa4
  flag.Parse()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/flag/flag.go:1188 +0x8e
  github.com/gravitational/teleport/lib/utils.NewLoggerForTests.InitLoggerForTests.func1()
      /code/teleport/lib/utils/cli.go:164 +0x2b
  sync.(*Once).doSlow()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/sync/once.go:74 +0xf0
  sync.(*Once).Do()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/sync/once.go:65 +0x44
  github.com/gravitational/teleport/lib/utils.InitLoggerForTests()
      /code/teleport/lib/utils/cli.go:162 +0x2b
  github.com/gravitational/teleport/lib/utils.NewLoggerForTests()
      /code/teleport/lib/utils/cli.go:185 +0x18
  github.com/gravitational/teleport/lib/kube/proxy.TestGetKubeCreds()
      /code/teleport/lib/kube/proxy/auth_test.go:143 +0x497
  testing.tRunner()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1742 +0x44
Previous read at 0x00c0006c401f by goroutine 1156:
  testing.shouldFailFast()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2408 +0x12b
  testing.(*T).Run()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1710 +0xfd
  github.com/gravitational/teleport/lib/kube/proxy.Test_DynamicKubeCreds()
      /code/teleport/lib/kube/proxy/kube_creds_test.go:296 +0x26b4
  testing.tRunner()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1742 +0x44
Goroutine 57 (running) created at:
  testing.(*T).Run()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1742 +0x825
  testing.runTests.func1()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2161 +0x85
  testing.tRunner()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1689 +0x21e
  testing.runTests()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2159 +0x8be
  testing.(*M).Run()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2027 +0xf17
  github.com/gravitational/teleport/lib/kube/proxy.TestMain()
      /code/teleport/lib/kube/proxy/forwarder_test.go:100 +0x30
  main.main()
      _testmain.go:129 +0x2d4
Goroutine 1156 (finished) created at:
  testing.(*T).Run()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1742 +0x825
  testing.runTests.func1()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2161 +0x85
  testing.tRunner()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:1689 +0x21e
  testing.runTests()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2159 +0x8be
  testing.(*M).Run()
      /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.11.linux-amd64/src/testing/testing.go:2027 +0xf17
  github.com/gravitational/teleport/lib/kube/proxy.TestMain()
      /code/teleport/lib/kube/proxy/forwarder_test.go:100 +0x30
  main.main()
      _testmain.go:129 +0x2d4
==================
```
2025-01-24 19:59:10 +00:00
Alan Parra 108d736eec chore: Bump github.com/jonboulle/clockwork to v0.5.0 (#51434)
* Update e/ reference

* chore: Bump github.com/jonboulle/clockwork to v0.5.0

* Rewrite clockwork.FakeClock to *clockwork.FakeClock

* Fix lib/srv/app/gcp/handler_test.go

* Add a linter exception for FakeClock.BlockUntil

* Change AppTestOptions.Clock to clockwork.Clock
2025-01-24 15:22:13 +00:00
Alan Parra 1f7b09f589 Prepare for clockwork v0.5.0 (#51292)
* Introduce the clocki package

* Do root module fixes so e/ can be built

* Use clocki in lib/backend tests

* Genericfy test.Constructor and related methods
2025-01-23 19:38:24 +00:00
Matt BrockandTiago Silva f7ea540782 Adding Azure sync functionality which can be used by the Azure Fetcher (#50367)
* Protobuf and configuration for Access Graph Azure Discovery

* Adding the Azure sync module functions along with new cloud client functionality

* Moving reconciliation to the upstream azure sync PR

* Moving reconciliation test to the upstream azure sync PR

* Fixing rebase after protobuf gen

* Updating to use existing msgraph client

* PR feedback

* Using variadic options

* Removing memberOf expansion

* Expanding memberships by calling memberOf on each user

* PR feedback

* Rebase go.sum stuff

* Go mod tidy

* Fixing go.mod

* Update lib/msgraph/paginated.go

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* e ref update

* Adding the Azure sync module functions along with new cloud client functionality

* Protobuf and configuration for Access Graph Azure Discovery

* Adding Azure sync functionality which can be called by the Azure fetcher

* Protobuf update

* Update sync process to use msgraph client

* Conformant package name

* Invoking membership expansion

* Setting principals before expansion

* Removing msgraphclient

* Update e ref

* Linting

* PR feedback

* Adding test names to reconciliation tests

* Adding channel buffer

* Going back to just reading from channel

* Linting

* PR feedback

* PR feedback

* PR feedback

* Apply suggestions from code review

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>

* PR feedback

* Fixing flaky test

* Lint

* Fix imports

---------

Co-authored-by: Tiago Silva <tiago.silva@goteleport.com>
2025-01-22 20:27:15 +00:00
Paul Gottschling 70d70a2d60 Fix outdated docs URLs (#50923)
- Web UI source
- README
- lib
- api

Do not touch docs URLs in test case names or test data where we don't
expect users to navigate to the URLs.
2025-01-16 18:17:35 +00:00
Marco Dinis dd044f1c4f Teleport Install scripts: use /etc/apt/keyrings/ when adding Teleport's public key for DEB packages (#50273)
* Teleport Install scripts: use `/etc/apt/trusted.gpg.d/` for DEB packages

* use etc apt keyrings for storing the keys
2025-01-15 15:14:51 +00:00
Gavin Frazar cf294752b6 Fix AWS SigV4 parsing (#50973)
* Fix AWS SigV4 parsing

Parsing the AWS SigV4 Authorization header no longer requires spaces
between the components - only the comma delimiter is required.

* add test case for empty signed header list
2025-01-14 19:21:05 +00:00
rosstimothy 883c53a53c Remove logrus dependency (#50930)
This is the _last_ step required to migrate from logrus to slog.
All components in the repository have been migrated to use slog
allowing the logrus formatter to be deleted.

The slog handler tests that validate the output have been updated
to assert the format directly instead of comparing it to the output
from the logrus formatter.
2025-01-10 16:58:56 +00:00
rosstimothy cca83feb66 Convert integrations to use slog (#50921) 2025-01-10 16:08:42 +00:00
rosstimothy 2aed5bf6da Remove logrus (#50829)
* Remove all direct logrus usage from teleport module

The only remaining use of logrus is from integrations, which is
unfortunately imported by teleport.e, and prevents logrus from
being moved to an indirect dependency. The logrus formatter and
initialization of the logrus logger will remain in place until
integrations is using slog. To prevent any accidental inclusions
of logrus within the teleport module the depguard rules have been
updated to prohibit importing logrus. The rules also include
prohibit a few common log packages that tools like gopls might
automatically import.

* Refactor logger initialization

Consolidates configuring of global loggers to a single function.
This is mainly to facilitate configuring the logger for
teleport scp, but will also allow us to remove the copy of logger
initialization that currently exists in integrations/lib/logger.

* fix: document ValidateFields

* fix: remove copied yaml tags

* fix: update file path comment
2025-01-09 16:41:28 +00:00
Steven Martin b90c1f6e24 Fix spelling for log and help (#50860) 2025-01-08 13:43:50 +00:00
Forrest c6ad9b221e add emptiness testutils (#50655)
* add emtiness testutils

* move golden to testutils
2025-01-07 16:36:01 +00:00
rosstimothy 9e34cc9523 Prevent quoting debug reports (#50781)
The refactoring done in #50451 caused the trace.Error debug report
to be quoted in log output. This updates the quoting bypass used
for log level to also consider trace.Errors in order to restore
the previous output.
2025-01-07 15:48:00 +00:00
Marco Dinis b6ffcee621 DiscoveryConfigStatus: update even when no resource is found (#50433)
* DiscoveryConfigStatus: update even when no resource is found

During Auto Discover, when using a DiscoveryConfig, if no resources are
found, the DiscoveryConfigStatus is not updated accordingly.

This PR ensures that, even when no resources are found, the status will
report so.

* use comparable instead of any for generic method

* remove useless un-named function on PreFetchHooks

* prevent call to ssm:SendCommand with 0 instances

* rename var from ok to found
2025-01-06 10:51:36 +00:00
Matt BrockandZac Bergquist cd8aee09bb Consolidating slice to pointer slice functions (#50651)
* Consolidating slice to pointer slice functions

* PR feedback

* Linting

* Shortening names

* Update lib/utils/slices/slices.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

* Fix import issues

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2025-01-02 16:49:18 +00:00
Steven Martin d0463ec931 update log messages (#50673) 2025-01-01 15:27:05 +00:00
rosstimothy 6061a8887b Fix: prevent race in slog text handler group handling (#50451)
Closes https://github.com/gravitational/teleport/issues/50450.

This updates our custom slog text handler to take heavier
inspiration from the slog.TextHandler. A variant of handleState
used by the slog.TextHandler has been vendored and modified to
produce the same output as our custom logrus formatter. Offloading
formatting from the SlogTextHandler directly to handleState prevents
the race caused in #50450.

Additionally, some quality of life improvements were added by
moving some code around to reduce file sizes and better define
what belongs in a file.

Benchmarks indicate that the changes here don't move the needle
much.

```
goos: darwin
goarch: arm64
pkg: github.com/gravitational/teleport/lib/utils/log
cpu: Apple M2 Pro
                               │   old.txt    │              new.txt               │
                               │    sec/op    │   sec/op     vs base               │
Formatter/logrus/text-12         8.665µ ± 16%   8.187µ ± 9%       ~ (p=0.280 n=10)
Formatter/logrus/json-12         8.879µ ±  2%   8.820µ ± 1%       ~ (p=0.089 n=10)
Formatter/slog/default_text-12   3.936µ ±  3%   3.946µ ± 4%       ~ (p=0.839 n=10)
Formatter/slog/text-12           3.789µ ±  2%   3.431µ ± 1%  -9.45% (p=0.000 n=10)
Formatter/slog/default_json-12   3.005µ ±  4%   3.032µ ± 3%       ~ (p=0.739 n=10)
Formatter/slog/json-12           3.029µ ±  6%   3.022µ ± 1%       ~ (p=0.381 n=10)
geomean                          4.675µ         4.557µ       -2.52%

                               │   old.txt    │                new.txt                │
                               │     B/op     │     B/op      vs base                 │
Formatter/logrus/text-12         5.936Ki ± 0%   5.936Ki ± 0%       ~ (p=0.752 n=10)
Formatter/logrus/json-12         6.212Ki ± 0%   6.211Ki ± 0%       ~ (p=0.752 n=10)
Formatter/slog/default_text-12   2.534Ki ± 0%   2.534Ki ± 0%       ~ (p=1.000 n=10) ¹
Formatter/slog/text-12           2.144Ki ± 0%   2.167Ki ± 0%  +1.09% (p=0.000 n=10)
Formatter/slog/default_json-12   2.448Ki ± 0%   2.448Ki ± 0%       ~ (p=1.000 n=10) ¹
Formatter/slog/json-12           2.318Ki ± 0%   2.318Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                          3.231Ki        3.236Ki       +0.18%
¹ all samples are equal

                               │  old.txt   │               new.txt                │
                               │ allocs/op  │ allocs/op   vs base                  │
Formatter/logrus/text-12         54.00 ± 0%   54.00 ± 0%        ~ (p=1.000 n=10) ¹
Formatter/logrus/json-12         76.00 ± 0%   76.00 ± 0%        ~ (p=1.000 n=10) ¹
Formatter/slog/default_text-12   41.00 ± 0%   41.00 ± 0%        ~ (p=1.000 n=10) ¹
Formatter/slog/text-12           52.00 ± 0%   33.00 ± 0%  -36.54% (p=0.000 n=10)
Formatter/slog/default_json-12   41.00 ± 0%   41.00 ± 0%        ~ (p=1.000 n=10) ¹
Formatter/slog/json-12           42.00 ± 0%   42.00 ± 0%        ~ (p=1.000 n=10) ¹
geomean                          49.70        46.07        -7.30%
¹ all samples are equal

```
2024-12-20 17:31:06 +00:00
rosstimothy 05be924ae0 Convert lib/utils to slog (#50340)
This only converts the places in the utils package that were
logging with logrus, but it does not fully remove the logrus
package as a dependency. The package is home to the logrus text
formatter which needs to exist until slog is the only logging
mechanism in use.
2024-12-19 15:08:04 +00:00
Marco Dinis b79b1206ef DiscoveryConfig Status: update even when no resources are found (#49588)
* DiscoveryConfig Status: update even when no resources are found

The DiscoveryService was not updating the DiscoveryConfigStatus when its
matchers didn't discovered any resource.

This would lead the user to think that there the DiscoveryConfig was not
being processed, when in fact it was.

* rename to FilterMapUnique

* rename to DiscoveryConfigName and GetDiscoveryConfigName

* fix var name
2024-12-16 17:58:02 +00:00
Gavin Frazar 518d4e787b migrate lib/srv/alpnproxy to AWS SDK v2 (#49973) 2024-12-11 22:23:21 +00:00
Gavin Frazar 3208c3d338 migrate tsh common to aws sdk v2 (#49449)
* add AWS SDK v2 migration utils package

* migrate tool/tsh/common to AWS SDK v2

* adapt AWSAccessMiddleware to AWS SDK v2
2024-12-09 17:42:23 +00:00
rosstimothy 17f493a13a Convert lib/srv/regular to use slog (#49792)
This starts the transition of our SSH servers to use slog. The
regular.Server has been converted to use slog, though there
are still various logs emitted via the srv.ServerContext from the
server which use logrus.
2024-12-06 18:35:42 +00:00
Russell Jones ad5afda688 Added actionable errors for network issues. (#49246)
Added actionable errors for common network issues. Updated Application
Access to use actionable errors.
2024-12-04 19:29:58 +00:00