Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v15] Do not replace AccessDenied error messages with generic "access denied" #39720

Merged
merged 2 commits into from Mar 25, 2024

Conversation

gzdunek
Copy link
Contributor

@gzdunek gzdunek commented Mar 22, 2024

Backport #39229 and #39558 to branch/v15.

Manual backport due to differences in protos.

Changelog: Teleport Connect now shows specific error messages instead of generic "access denied"

gzdunek and others added 2 commits March 22, 2024 11:25
* Add functions to clone every gRPC method, so they can be passed over the context bridge

* Replace `@grpc/grpc-js` interceptors with `@protobuf-ts/runtime-rpc` ones

* Replace string check with check on metadata, add missing `AddMetadataToRetryableError`

* Add `pin` to sensitive properties

It's needed because now we also log a passwordless login stream call.

* Add `cloneClient` method to clone the entire gRPC client

* Switch tests to `TshdRetryableError`

* Improve comments

* Move `cloneClient` and `cloneAbortSignal` to the top of the file

* Simplify condition

* Lowercase logs

* Check if the error is `RpcError` using `instanceof`

* Log error object instead of `[object Object]`

* Do not export call specific types

* Wrap gRPC calls in `createClient` to allow passing the errors over the context bridge (#39230)

* Regenerate protos with the `protobuf-ts` client

* Enable `strictBindCallApply` so `.bind()` results have correct types (instead of `any`)

This is needed for wrapping calls in `createClient`.

* Use `protobuf-ts` client instead of `grpc-js` one

* Convert `createClient` to use `protobuf-ts` response style, clone each call

* Switch callsites to `cloneAbortSignal`

* Replace `error.message` checks with a proper check on the error status code

* Clone the entire client instead of each method separately

* Correct the error `cause` in `ResourceSearchError`

* Remove `params.sortBy` defaults, always set `startKey` to string

* Use a simpler type for `reportUsageEvent`

* Fix interceptor test

* Ignore TS error in `highbar.ts`

(cherry picked from commit 784d7ac)
…ied" (#39558)

* Do not replace `AccessDenied` error messages with generic "access denied"

* Replace `error.code` checks with `isTshdRpcError(error, code)`

* Add `ABORTED` and `UNAUTHENTICATED` codes

* Improve `isTshdRpcError` documentation

* Do not catch `retryWithRelogin` errors in `Setup.tsx`

(cherry picked from commit 48c05b6)
@gzdunek
Copy link
Contributor Author

gzdunek commented Mar 22, 2024

size/sm :)

@gzdunek gzdunek added this pull request to the merge queue Mar 25, 2024
Merged via the queue into branch/v15 with commit 9c7ce09 Mar 25, 2024
41 checks passed
@gzdunek gzdunek deleted the gzdunek/backport-39229-39558/v15 branch March 25, 2024 10:12
@tcsc tcsc mentioned this pull request Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants