Commit graph

61 commits

Author SHA1 Message Date
Yassine Bounekhla 33cfd9dc5f
add usage events for eice discover (#32617) 2023-09-29 21:13:58 +00:00
Lisa Kim a2d788d698
Add promoted access list title to teleterm access request (#32708) 2023-09-28 06:13:12 +00:00
Tiago Silva ab0cbbbdf9
Add posthog events for discovered Kubernetes Apps (#32289)
This PR emits PostHog events when Kubernetes Apps are discovered and
created.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2023-09-22 08:36:00 +00:00
Grzegorz Zdunek 81c352c413
Connect My Computer: Keeping compatibility promise (#31951)
* Add server version to cluster

* Add components to display compatibility promise

* Show compatibility promise on status page

* Show compatibility promise on setup page

* Rename `serverVersion` -> `proxyVersion`, make all places to use `makeRootCluster`/`makeLeafCluster`

* Move `UpgradeAgentSuggestion` to a new file, make it stateless

* Return `isAgentCompatible` instead of `isNonCompatibleAgent` from context

* Add // DELETE IN comments

* Improve copies

* Add a story for too old client in Setup

* Extract CONNECT_MY_COMPUTER_RELEASE_MAJOR_VERSION

* Run prettier

* Fix license

* Show an error on the CMC icon when the agent is not compatible

* Always say "version" before the version number

* Adjust tests

* Drop "if you wish" from the copies
2023-09-21 13:54:36 +00:00
Michael Wilson 49e4c96e4e
Add Access List usage events, emit event for userloginstate Generator. (#32196)
Access List usage events have been added, counting create and delete for
Access Lists and Access List members. Additionally, an event for granting
Access List access to users has been added to the userloginstate Generator
and is now tested for.
2023-09-21 13:15:36 +00:00
Grzegorz Zdunek 027566a8cb
Connect My Computer: Remove the agent (#31020)
* Add RPCs for removing the node and reading its name

* Extract `isAccessDeniedError`

* Add a function to remove agent directory

* Add methods in Connect My Computer service to remove node, agent directory and connections

* Do not print warning when there is no agent to kill. The agent could not be started or even configured, so there is no point in showing that warning.

* Remove agent by clicking a button in the status document

* Remove agent by logging out

* Improve comments and error message

* `getConnectMyComputerNodeName` should return `string`, not `ServerUri`

* Move `removeConnections` method from `ConnectMyComputerService` to `ConnectMyComputerContext`

* Simplify integration test

* Document that connections have to be removed before removing agent dir

* Ignore NOT_FOUND errors

* Show a notification after removing the agent and close the tab

* `readUUid` -> `readUUID`

* Run prettier

* Extract a function that renders `useConnectMyComputerContext` hook to avoid duplicating the setup

* Move showing notification outside `catch` block, add tests

* Use `connection.kind` instead of parsing the resource URI

* Add `assertUnreachable`

* Pass `closeDocument` function to the status component instead of a document object

* Post-rebase fixes
2023-09-21 13:07:58 +00:00
Rafał Cieślak 847a1b1167
Implement waiting for Connect My Computer node to join cluster (#30905)
* Add daemon.Service.ResolveClusterURI

* Accept agents dir through command line flag

tshd needs to know this out of band, so that when the Electron app tells
it to watch for host UUID file for a specific cluster, the Electron app
can send just the profile name of the cluster instead of an arbitrary path
on the computer.

* Implement WaitForConnectMyComputerNodeJoin in tsh daemon

* wait: Use addEventListener instead of onabort

* Make TshAbortController emit abort event only once

This aligns it with a regular AbortController, which also emits the event
only once.

* Refactor how types are imported in tshd fixtures

* Implement WaitForConnectMyComputerNodeJoin in Electron app

* createAbortController: Add signal.aborted, use emitter.once

* Improve wait function based on Deno implementation

72d6e6641e/async/delay.ts (L39)

* Add a comment about the events package
2023-09-21 11:43:10 +00:00
Sakshyam Shah daa818fe81
add device enroll and license limit event to prehog (#31450)
* tp.device.enroll event

* add device origin to enroll event

* tp.license.limit event

* LicenseLimitEvent comment

* remove LicenseLimitEvent message from usageevents.proto:
directly use AnonymizeAndSubmit instead of SubmitUsageEvent

* update proto comment
2023-09-12 22:07:15 +00:00
Marco André Dinis 0baf6c3175
UsageEvents: add OpenSSH EC2 Instance Connect Endpoint Nodes (#31139) 2023-08-30 21:00:55 +00:00
Jakub Nyckowski a2afac8c6a
[Assist] Add AssistAction and AssistAccessRequest PostHog event reporting (#30513)
* Add AssistAction and AssistAccessRequest PostHog event reporting

This commit introduced new usage tracking for Assist features. AssistAction event is emitted when user triggers an action like SSH command generation or output explaining. AssistAccessRequest event is fired when user requests access to a resource. The events capture anonymized username, resource type or action triggered, and a breakdown of tokens used for generating command summaries or completion responses.

* "Removed userName in AssistAccessRequest and AssistAction"

Both "AssistAccessRequest" and "AssistAction" messages in usageevents.proto file and their corresponding Go structures were modified to remove the "userName" field.

* Add GoDoc
2023-08-21 18:07:41 +00:00
Sakshyam Shah c584138b49
Add FeatureRecommendationEvent to Prehog (#30526)
* add FeatureRecommendationEvent to prehog

* udpate name captureFeatureRecommendation to captureFeatureRecommendation(Event) for consistency
2023-08-19 00:37:48 +00:00
Sakshyam Shah 703fa8d6a1
Add device authentication event to prehog (#30082)
* device authentication event reporter

* run make grpc
2023-08-10 19:54:03 +00:00
Andrew Burke 0c55fe92cf
Emit event for auto-discovered VMs (#29285)
This change adds the ability for Teleport to emit `ResourceCreateEvent`s
when an SSH node, database, or kube cluster is auto-discovered.
2023-08-10 18:48:10 +00:00
Grzegorz Zdunek 1d2244f2b9
Connect My Computer: Add usage events (#30033)
* Add Connect My Computer usage events

* Switch the logic in a comment

* Do not pass boolean to `failedStep`
2023-08-07 16:39:07 +00:00
Rafał Cieślak cd000accaa
Ensure Connect shows Connect My Computer only to local users (#29804)
* Make sure Connect My Computer is not shown to SSO users

* Improve user type check in RoleSetup

* Reexport UserType

* Fix protos

* Add makeLoggedInUser test helper and use it in tests
2023-07-31 14:37:20 +00:00
Hugo Shaka 915299a04b
assist: add classification code and emit even on execution (#28492) 2023-07-26 15:35:24 +00:00
Grzegorz Zdunek 9a8d19b67f
Connect My Computer: Generate the config file (#29010)
* Add methods to create and remove tokens

* Add a function to create agent config file

* Integrate token generation and config file creation

* Move response formatting to the handler

* Remove doc links

* Declare struct before its methods

* Remove `useRetryWithRelogin` usage

* Hold a clock in `TokenProvisionerConfig`, add a function that creates `TokenProvisioner`

* Do not use `EmptyResponse` in proto

* Create a specialized struct to return token and labels

* Add an integration test

* Uncomment `runGenerateConfigFileAttempt` step

* Run prettier

* Remove duplicated assertion and use more meaningful name

* Fix lint issue
2023-07-25 16:32:51 +00:00
Rafał Cieślak fc49acb722
Add role setup for Connect My Computer in tshd (#28891)
* Ignore specific teleterm proto file rather than whole package

* clusters.Storage: Avoid unnecessary casting of URI back to string

* Storage.fromProfile: Move loading profile status to separate function

* Return client.TeleportClient together with clusters.Cluster

This is a stopgap to make clusters.Cluster a regular struct with no extra
behavior and a much smaller interface.

At the moment, almost all RPCs go through layers like these:

gRPC handler → daemon.Service → clusters.Storage → clusters.Cluster →
→ TeleportClient

As a result, clusters.Cluster has a gigantic interface that's hard to test.

Instead, we want to make it hold basic information about the cluster.
The real work will be done by collaborator structs which take clusters.Cluster
and TeleportClient as args. This way we can mock them out more easily in tests.

See the issue linked in the comment of clusters.Storage.GetByResourceURI
for more details.

* Make AddMetadataToRetryableError public

Since we're moving away from doing everything in clusters.Cluster, we'll
need to use this function from within the daemon package.

* Add IsRoot and IsLeaf methods to uri.ResourceURI

These methods will be used to return early if someone tries to set up
roles for a leaf cluster. Connect My Computer works with root clusters only.

* Add handler for creating Connect My Computer role

* Add test for calling GenerateUserCerts with bogus request ID

* Fix checking logins of existing role

* Remove commented out argument to ReissueUserCerts

* Add a stopgap comment to Storage.GetByURI

* Remove invalid doc links

* Ensure owner node label has expected value if role already exists

* Add unit test which checks RoleSetup.Run idempotency

* Add godoc for Resolver

* Simplify watcher equality check, add a comment

* Expand the comment for DropAccessRequests

* Fix position of Connect My Computer popover

* Integrate role setup with setup document

* Add temporary action to additional actions

This will be removed once the parent PR is approved. I just wanted to give
reviewers a shortcut to triggering the endpoint from the actual app.

* Add return type to createRole

* Add useRetryWithRelogin

* Wrap role setup in retryWithRelogin

* Remove useRetryWithRelogin in favor of retryWithRelogin & useCallback

* Remove CMC role setup from AdditionalActions

* Prettier fix

* Fix eslint
2023-07-20 11:42:22 +00:00
Brian Joerger 2099ccc746
Teleport Connect headless watcher (#28844)
* Implement headless watcher backend for Teleport Connect.

* Add headless watcher to tshd daemon service.

* Add SendPendingHeadlessAuthentication rpc to tshd events service.

* Add UpdateHeadlessAuthenticationState rpc to the daemon service.

* Address comments.
2023-07-19 02:56:24 +00:00
Forrest a84681a8e4
upgrader monitoring and alerts (#28951)
* add rate limit stream helper

* upgrader metrics & alert

* add docs for discovering upgrade enroll prospects

* update prehod protos

* Update docs/pages/management/operations/enroll-agent-into-automatic-updates.mdx

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

---------

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2023-07-17 14:42:27 +00:00
Marek Smoliński d4805cc428
Extend DatabaseSessionStart posthog event (#28931) 2023-07-14 07:15:02 +00:00
Noah Stride 6122933e68
Machine ID: Add guides to the Enroll Integration page (#28646)
* First pass at adding buttons to the integrations page

* Add analytics events for clicking Machine ID enrollment tiles

* Run prettier

* Fix eslint complaints

* Push fixed icons

* Flatten the styling for the Jenkins logo

* Rearrange machine ID title code

* Remove logs from event processing

* Switch to coloured gitLab icon

* Use GitLabs proper name for CI/Cd

* Fix imports

* Further adjustments from PR

---------

Co-authored-by: Ryan Clark <ryan.clark@goteleport.com>
2023-07-10 13:27:52 +00:00
Grzegorz Zdunek 3c4ed44a09
Connect My Computer: check permissions before showing in the UI (#28346)
* Move CMC icon and setup document to common `ConnectMyComputer` directory

* Add permissions to show CMC

* Use `cluster.leaf` to check if a cluster is a root cluster

* Rename `isConnectMyComputerPermittedForRootCluster` to `canUseConnectMyComputer`

* Add licenses

* Rename `DocumentSetup` to `DocumentConnectMyComputerSetup`

* Check `cluster.leaf` flag to verify if the cluster is a root cluster

* Do not throw in `canUseConnectMyComputer`

* Add comments

* Use the same field name in a documentation comment

* Use relative import
2023-07-03 08:14:11 +00:00
Lisa Kim f6906f330e
Discover: Add deployed method field to deploy service event (#28336)
* Define a  deployed_method field to discover deploy event

* Add deployed_method field to expected events

* Add deployed method type and define its field when emitting event from web UI

* Address CR and add another field

* Address CR
2023-06-29 23:36:28 +00:00
Noah Stride 0d3d88156b
Machine ID: Add support for BotJoin analytics event (#28293)
* Add support for BotJoin analytics event

* `provision_token_name` -> `join_token_name`
2023-06-28 15:11:07 +00:00
Grzegorz Zdunek bcf6e8fd30
Connect My Computer: Add ACL (#28131)
* Add ACL to Connect

* Apply Zac's suggestions

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

* Rename `convertToApiResourceAccess`

* Use `recorded_sessions` and `active_sessions` instead of `sessions` to avoid confusion.

Web has two fields for "sessions", and we should have too.

* Reserve "sessions" too

* Rename `ACL` to `acl`

---------

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2023-06-28 07:34:06 +00:00
Noah Stride ac9054cb6a
Machine ID: Add usage event for bot creation (#28279)
* Add usage event for bot creation

* Update for latest protos from cloud

* Add BotName field to BotCreate event

* Update protos from cloud master

* import order

* Use `ClientUsername`

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-06-27 14:29:01 +00:00
Yassine Bounekhla 6be5d884e4
add saml wizard to ui (#27518) 2023-06-16 13:50:46 +00:00
Michael Wilson 1b3201a97c
Add the notion of friendly names to access request details. (#27495)
* At the notion of friendly names to access request details.

Access request details can now return friendly names. This will help display
access request resources in a way that allows easier reviewing of Okta apps
and user groups, where the names are not human readable.

* Use friendly name for nodes, tune variable names.

* Add in DetailsID helper function for use by the enterprise UI.

* Request apps instead of app servers, remove DetailsID as its no longer needed.

* Push friendly name into app and usergroup UI objects.

* Fix apps test.

* Linting.

* [Connect] Add FriendlyName to AccessRequest (#27694)

---------

Co-authored-by: Michael <michael.myers@goteleport.com>
2023-06-13 14:02:16 +00:00
Michelle Bergquist 5c3c84ab73
add new CTA event property (#27216) 2023-06-06 22:03:54 +00:00
Rafał Cieślak 53b0118cff
Document lack of stability of lib/teleterm gRPC API (#27275) 2023-06-06 08:19:06 +00:00
Edoardo Spadolini 571477fe5a
protobuf changes in preparation for buf breaking (#26792)
* Use WIRE_JSON in buf breaking

* Add some field reservations for backwards compat
2023-05-26 13:53:07 +00:00
Lisa Kim 4d8f2d20e7
Add integration enroll usage event (#26880)
* Add integration enroll usage event

* Add new events to the frontend
2023-05-25 16:51:04 +00:00
Rafał Cieślak daca5bf29b
Preserve backwards compatibility of teleport.lib.teleterm.v1.Gateway (#26705) 2023-05-23 12:08:38 +00:00
Rafał Cieślak 2d9a75537a
Spawn gateway CLI client directly (#26441)
* Return os.exec.Cmd as gateway CLI command

* Remove separate Props type from DocumentTerminal

* Refactor Kind type exported from documentsService

* Export makeRuntimeSettings from MainProcess mock

* PtyProcess: Join args in logger name

* ptyHostService: Pass ptyOptions explicitly instead of using spread

I noticed that we pass both argsList and args to the PtyProcess constructor.
While TypeScript allows that, it is a bit confusing when inspecting the
actual values received in the constructor.

* Add empty DocumentGatewayCliClient

* Start terminal from DocumentGatewayCliClient

* Add waiting state for DocumentGatewayCliClient

* Remove targetSubresourceName from DocumentGatewayCliClient title
2023-05-22 08:40:33 +00:00
Edoardo Spadolini 64ed94f602
Split ssh_port into ssh_port_v2, k8s_port (#25987)
Same goes for foo_sessions in UserActivityReport.
2023-05-11 10:36:39 +00:00
Jakub Nyckowski ae8f2fa929
Assist - Configuration and usage (#25953)
* Assist - Configuration and usage

* Add network config test

* Add config test

* Run GCI

* Address review comments
2023-05-11 01:56:55 +00:00
matheus 0697011eaa
Add events to cta clicks (#25325)
* (wip) add unlock feature button to support page

* Fix typo

* (wip) add locked feature join session

* Improve session join style

* Add session join lock button

* Remove hover on locked join menu

* Update copy

* Only show `join as...` when appropriate

* (wip)

* Make ButtonLockedFeature theme sensitive

* Remove debug stuff

* Adjust feature button height

* Fix session join button on locked

* Remove unused import

* typo

* Add link to cta button

* Remove teams flag

* Add cta service

* Update snapshots

* Lock button style

* Add cta to context

* Rename cta to ctaService

* Stories and tests

* Add comments clarifying that ctas are not used currently

* add showActiveSessionsCTA to useSessions

* Licenses

* Lint license

* Remove commented out code

* Add missing types

* Replace cta service for an object with cta on context

* Fix menu hack

* small refactor in styled stuff

* Update SessionJoinBtn to use master code

* Snapshot update

* Add events to cta clicks

* rebase

* revert e ref update

* Revert e change

* Update proto message to start at 1

* Use enum from proto files instead of rewriting

* Improve comments on usageevents.proto cta enum

* Fix import

* Fix type errs

* Add comments

* Rename CtaEvents > CtaEvent

* Copy the CtaEvent enum instead of importing from proto

* Add back blank line

* Fix import order

* Update proto files

* Add TODO comment
2023-05-05 18:53:02 +00:00
Edoardo Spadolini 2966be6a57
Tweak protogen to not change protos from cloud (#24688)
* Tweak protogen to not change protos from cloud

* Use strategy: all whenever possible
2023-04-18 14:22:12 +00:00
Lisa Kim ab1206a133
Discover: Add new usage reporting events (#24567)
* Add aws connect account and enroll rds dbs event

* Update FE types to reflect backend changes

* Rename

* Add missing convert usager
2023-04-14 18:23:18 +00:00
Edoardo Spadolini 851cb6598e
Fix package names for v1 protos, misc proto changes (#24183)
* Delete teleterm's ptyHost/v1, added by mistake

* Add package name to protos conforming to PACKAGE_VERSION_SUFFIX

* use go run in buf-connect-go.gen.yaml directly

* Run protogen in place

* Run the buf-go generation off of go run

This also adds protoc-gen-go-grpc to go.mod
2023-04-06 22:53:31 +00:00
Edoardo Spadolini c296b77734
usagereporter: on-prem dial home (#23916)
* Fix prehog protos package name

* sync prehog/v1alpha/teleport.proto from cloud

* AggregatingUsageReporter

* graceful stopping

* alerts WIP

* Split reporter and submitter

* batch_uuid

* Naming

* more naming

* Move backend stuff in a "service" object

* Return the correct err from gracefulstop

* Tweak alert link

* Better field comments

* payloadContext rather than a manual type assertion

* Rework reporter logic

* Close the base context at the end of run

* Use the count parameter in listUserActivityReports

* Use ttl parameter in createUserActivityReportsLock

* service tests

* submitter test

* reporter test

* Document GracefulStopper.GracefulStop

* Fix errorf/warnf that don't need formatting

* Add debug line on a successful report

* fix license

* sync prehog proto from cloud

* Only send non-nil events through test channel

This fixes a hang/data race, as we effectively "send" a nil event
whenever the ticker hits

* Docs and variable names

* Add some debug info to the lock and the alert

* Sync prehog protos from cloud

This includes a move to prehog.v1 for the new rpc and messages

* mechanical: rename imports of prehog/v1alpha

This renames imports of ".../prehog/v1alpha" from prehogv1a to prehogv1,
and imports of ".../prehog/v1alpha/prehogv1alphaconnect" from prehogv1c
to prehogv1ac, to avoid confusion with imports of the newly added
".../prehog/v1" and ".../prehog/v1/prehogv1connect".

* Merge remote-tracking branch 'origin/master' into espadolini/usagereporter-onprem
2023-04-05 19:24:32 +00:00
Lisa Kim 877f1e1018
Discover: Add more database type event names (#23742)
* Add unguided database event names

* Add database doc event names
2023-04-04 21:00:38 +00:00
Grzegorz Zdunek 057ff52f89
Connect: Collect protocol origin (#23898)
* Add `origin` field to protocol event

* Capture protocol event origin

* Use positional arguments

* Missing rename
2023-04-04 12:51:02 +00:00
Marco André Dinis c55586a85e
Metrics: add IsSSO to Discover Events (#23791)
* Metrics: add IsSSO to Discover Events

* review pt1

* use services.UserGetter interface

* godocs, renamings

* add isSSO to user identity

* remove ctx from convert

* add godocs to usermetadata fields

* add UserType enum
2023-03-31 15:17:07 +00:00
Edoardo Spadolini 779c8be19d
usagereporter: resource heartbeats (#23093)
* sync prehog/v1alpha/teleport.proto from cloud

* AnonymizeAndSubmit does not need to be fallible

* DELETE IN: 5.1.0

* Add AnonymizeNonEmpty method to HMACAnonymizer

* Add usagereporter encoding for ResourceHeartbeatEvent

* Emit ResourceHeartbeatEvent on heartbeats

* Use "static" field to ResourceHeartbeatEvent

* KeepAlive's Name field should never be empty

* Use the kube cluster name

* launch submitEvents in a goroutine in AddEventsToQueue

* Handle the OpenSSH node resources

* Skip unknown heartbeats

* Add better docs for KeepAliveType
2023-03-24 18:47:58 +00:00
Zac Bergquist 2519f40d8d
Add anonymized device ID to tp.user.login event (#22994)
Updates gravitational/teleport.e#829
2023-03-14 16:06:15 +00:00
Edoardo Spadolini acdf61d931
usagereporter: Use the batched event ingest RPC (#22739)
* Sync prehog/v1alpha/teleport.proto

* Use the new SubmitEvents rpc

* Remove leftover file

* Warn against changing usageReporterMaxBatchSize
2023-03-14 08:58:03 +00:00
Vitor Enes 6a1d1aedc3
Emit new AgentMetadataEvent (#22068)
* Emit new `AgentMetadataEvent`

Part of https://github.com/gravitational/cloud/issues/3550.

This commits adds a new `UpstreamInventoryAgentMetadata` that is sent
from a Teleport agent to an auth server.
Once received, it is transformed into an `AgentMetadataEvent` and sent
to PreHog.

Most `UpstreamInventoryAgentMetadata` fields are intentionally kept as
empty in this PR. Follow up PRs will be opened with the mechanisms
required to fill them (as described in #21337).

* server_id -> host_id

* compute OS and host architecture

* Compute OS version and container runtime

* Close stream if agent receives an agent metadata message

* cmd -> exec ; file -> read

* implement fetchOSVersion for linux

* Remove unused import

* Add note about `agentMetadataCh`

* Allow commands with args

* Remove parseFun abstraction

* fetch glibc version

* fetch container orchestrator

* Fix lint

* Fix TODO

* Add note about glibc version

* cmd -> command

* fetch cloud environment

* fetch install methods

* GLibCVersion -> GlibcVersion

* Use `http.NewRequestWithContext`

* Add missing comment

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* GLibCVersion -> GlibcVersion

* Fix lint

* Fix helm unit tests

* Add missing comments

* 5 second timeout on http requests

* Spawn gorountine that fetches metadata on each new stream

* Use `defaults.HTTPClient()`

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Add missing import

* Handle error

* Revert "Spawn gorountine that fetches metadata on each new stream"

This reverts commit fe4f2790be.

* Send agent metadata to auth server once per stream

* Improve note about agentMetadataDone

* Don't process command output & file content on the agent

Since agents cannot be trusted, regex validation and sanitization should
happen in PreHog anyways. So this commit removes such logic in favor of
moving it to PreHog.

* Fix lint

* Trim space

* Move handling of `AgentMetadataEvent` to `handleControlStream`

* Use cached hello message

* Move metadata files to lib/inventory/metadata

* make sending of agent metadata more self contained

* Minimize diff

* Send all system roles to PreHog

* Remove unused import

* Add parsing of command output / file content back

* Usage reporter refactor

* Usage reporter refactor

* Add missing handling of inventory agent metadata msg

* Fix ICS usage reporter

* Improve comments

* Add cached `metadata.Get*` methods

* Use systemctl status instead of is-active

* Add `Metadata` struct

* return pointer in `FetchMetadata`

* Pass context to `GetMetadata`

* metadataFetchConfig -> fetchConfig

* GetMetadata -> Get

* Add note about `Get` result

* Ensure install methods are non-nil

* Exit `metadata.Get` if context is closed

* Replace sync.Once with atomic.Bool.Swap

* Initialize channel

* Fix lint

* Fix lint

* Make `metadata.Get` return an error instead of bool

* Allow multiple true/false values for env vars

* Use `strings.Cut`

* Use /etc/os-release ID instead of NAME

* Improve `autoEmitMetadata`

* Use `gnu_get_libc_version`

* Ubuntu -> ubuntu

* Use GOARCH

* gofmt

* Move import C up

* Variables may include quotes

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Default values for ID and VERSION_ID

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Blank lines are permitted

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>

* Anonymize host id

---------

Co-authored-by: Edoardo Spadolini <edoardo.spadolini@goteleport.com>
2023-03-10 12:45:29 +00:00
Rafał Cieślak f43297f56a
Connect: Remove leftovers from resource cache removal (#22772)
* Connect: Remove leftovers from resource cache removal

* GetAll* RPCs were used in the resource cache and are no longer used.
* ListApps was pretty much never actually used as we didn't ever list apps
  in Connect.
* ClusterContext.state.searchValue ceased to be used after we moved to
  fetching resources from the backend.

* Remove remaining leftovers from tshd client mock

* Remove unused imports
2023-03-10 10:05:18 +00:00