-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
packages/teleport/src/console/components/DocumentSsh/useSshSession.ts
Outdated
Show resolved
Hide resolved
const check = value => { | ||
const match = SSH_STR_REGEX.exec(value); | ||
return match !== null; | ||
const hasWhiteSpace = /\s/.test(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why checking it separately from main regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -63,10 +63,14 @@ export default function FieldInputSsh({ | |||
); | |||
} | |||
|
|||
const SSH_STR_REGEX = /(^(\w+-?\w+)+@(\S+)$)/; | |||
// SSH_STR_REGEX is a modified regex from teleport's lib/sshutils/scp/scp.go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scp information here is not relevant (confusing) and this regex can be greater simplified by checking for just 2 conditions: no spaces and no empty values. Doing data validation in here is more of a cosmetic requirement rather than a security concern. If anything, an error, return by the server, will be shown to the user in the terminal tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
const url = cfg.getSshSessionRoute({ sid, clusterId }); | ||
ctx.updateSshDocument(docId, { | ||
title: `${login}@${hostname}`, | ||
// DELETE IN 5.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that this is an upgrade issue similarly to clusterId and not one of the valid use cases (when hostname is not-specified) ? If not, then lets remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted, handled by webapi server: gravitational/teleport#4027
355e3bf
to
c9acdc2
Compare
* use hostname instead of relying on serverId as fallback (handled in backend) * simplified quicklaunch regex to just check for white spaces * encode URL when finding documents by url to handle special characters
c9acdc2
to
615efaa
Compare
f58d60e
to
4a06b68
Compare
The script for updating webassets uses the commit message from webapps as the commit message for the PR to teleport. This commit message is almost always a merged PR, which has the format: do some awesome thing (#123) Where '#123' is the number of the **webapps** PR that was merged. The problem with this is, when the teleport PR is created, it interprets the #123 as the number of a **teleport** PR. And since the Teleport repo has a lot more issues/PRs than webapps, Github ends up linking to an old and completely unrelated PR. Fix this by replacing (#123) with (gravitational/webapps#123), which Github correctly renders as a link to the webapps PR in question.
The script for updating webassets uses the commit message from webapps as the commit message for the PR to teleport. This commit message is almost always a merged PR, which has the format: do some awesome thing (#123) Where '#123' is the number of the **webapps** PR that was merged. The problem with this is, when the teleport PR is created, it interprets the #123 as the number of a **teleport** PR. And since the Teleport repo has a lot more issues/PRs than webapps, Github ends up linking to an old and completely unrelated PR. Fix this by replacing (#123) with (gravitational/webapps#123), which Github correctly renders as a link to the webapps PR in question.
The script for updating webassets uses the commit message from webapps as the commit message for the PR to teleport. This commit message is almost always a merged PR, which has the format: do some awesome thing (#123) Where '#123' is the number of the **webapps** PR that was merged. The problem with this is, when the teleport PR is created, it interprets the #123 as the number of a **teleport** PR. And since the Teleport repo has a lot more issues/PRs than webapps, Github ends up linking to an old and completely unrelated PR. Fix this by replacing (#123) with (gravitational/webapps#123), which Github correctly renders as a link to the webapps PR in question.
fixes gravitational/teleport#4008
fixes gravitational/teleport#4013
fixes gravitational/teleport#4044
Description
Dependent PR
gravitational/teleport#4027