Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Lisa/minor fixes #123

Merged
merged 5 commits into from
Jul 15, 2020
Merged

Lisa/minor fixes #123

merged 5 commits into from
Jul 15, 2020

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Jul 14, 2020

fixes gravitational/teleport#4008
fixes gravitational/teleport#4013
fixes gravitational/teleport#4044

Description

  • Open new tab when clicking on active sessions icon
  • Simplify QuickLaunch regex to just check for white spaces
  • Remove using ServerId as fallback in place of empty hostname when displaying inform (this is now handled from webapi server)
  • Use serverID's to start session instead of hostname

Dependent PR

gravitational/teleport#4027

@kimlisa kimlisa requested a review from alex-kovoy July 14, 2020 05:44
const check = value => {
const match = SSH_STR_REGEX.exec(value);
return match !== null;
const hasWhiteSpace = /\s/.test(value);
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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

* 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
@kimlisa kimlisa force-pushed the lisa/minor-fixes branch from c9acdc2 to 615efaa Compare July 15, 2020 01:45
@kimlisa kimlisa force-pushed the lisa/minor-fixes branch from f58d60e to 4a06b68 Compare July 15, 2020 17:53
@kimlisa kimlisa merged commit 35b7560 into master Jul 15, 2020
@kimlisa kimlisa deleted the lisa/minor-fixes branch July 15, 2020 18:15
russjones pushed a commit that referenced this pull request Jul 20, 2021
russjones pushed a commit that referenced this pull request Jul 20, 2021
zmb3 added a commit to gravitational/teleport that referenced this pull request Feb 8, 2022
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.
zmb3 added a commit to gravitational/teleport that referenced this pull request Feb 8, 2022
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.
zmb3 added a commit to gravitational/teleport that referenced this pull request Feb 8, 2022
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants