Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add workspace proxies to the backend#7032

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deansheather merged 51 commits intomainfromdreamteam/external_proxy
Apr 17, 2023

Conversation

@Emyrk
Copy link
Member

@EmyrkEmyrk commentedApr 6, 2023
edited
Loading

What this does

This is the initial implementation of workspace proxies. It is missing functionality, and not complete. Stuff that's remaining is listed at the bottom.

This initial implementation implements the basic interface contracts that allow workspace proxies to communicate with coderd. It enables basic workspace proxying! The unit tests are setup and all passing. Token smuggling is implemented, hostname validation is implemented.

This feature is experiment flag gated and not able to be used in any production environment. Currently only unit tests can leverage this code since there's no CLI yet.

More PRs will add functionality. This is the core, and makes PRs more "bite sized".... Ok it is a big bite.

Future Work

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I know this is in draft, but wanted to take a peek! Feel free to take my comments or leave em', all just naming stuff.

@EmyrkEmyrk changed the titledraft: External Workspace Proxieschore: External workspace proxies available in testing.Apr 12, 2023
Comment on lines +372 to +373
// Same as the first but it's optional.
apiKeyMiddlewareOptional:=httpmw.ExtractAPIKeyMW(httpmw.ExtractAPIKeyConfig{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would it be cleaner if we allowedOptional as a separate argument to this function? Then they could share configs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There are a few values that change between the 3 instances of ExtractAPIKeyMW we have like Optional, RedirectToLogin, etc. Do you propose we add all of these as bool params? Seems janky IMO

Comment on lines +65 to +72
-- Validate that the @hostname has been sanitized and is not empty. This
-- doesn't prevent SQL injection (already prevented by using prepared
-- queries), but it does prevent carefully crafted hostnames from matching
-- when they shouldn't.
--
-- Periods don't need to be escaped because they're not special characters
-- in SQL matches unlike regular expressions.
@hostname ::text SIMILAR TO'[a-zA-Z0-9.-]+'AND
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It seems weird to me that we need to do this, and could cause someodd bugs. Why can't we do an exact match for the hostname?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You can't do exact match becauseapp--agent--workspace--username.dev.coder.com is not an exact match fordev.coder.com or*.dev.coder.com.

The specific lines you commented on is to avoid regex escapes in hostnames. It's a preventative measure to make the match more consistent and to avoid security issues.

Comment on lines +24 to +26
// The format of an external proxy token is:
// <proxy id>:<proxy secret>
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't disagree with the ease of telling a difference, it just seems weird to maintain multiple types of secret keys when we already have a standard in the product.

If we need to bump the security of our keys, we'll now have multiple places for that to be done, even though they share the same purpose.

And under this format, it's not explicit when it's a proxy key... we just know it is because of the:, right?

Copy link
Member

@kylecarbskylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

All of my comments were just naming, nothing daunting.

@deansheather feel free to merge once we reconcile the naming stuff!

🥳🥳🥳

@kylecarbs
Copy link
Member

@deansheather before merge lets rename the title to something likefeat: add workspace proxies to the backend or something

@deansheatherdeansheather changed the titlechore: External workspace proxies main codechore: add workspace proxies to the backendApr 17, 2023
@deansheather
Copy link
Member

Keeping it as chore so it doesn't show up in changelog (it's not usable by users yet)

@deansheatherdeansheatherenabled auto-merge (squash)April 17, 2023 19:54
@deansheatherdeansheather merged commit658246d intomainApr 17, 2023
@deansheatherdeansheather deleted the dreamteam/external_proxy branchApril 17, 2023 19:57
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 17, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@deansheatherdeansheatherdeansheather left review comments

@kylecarbskylecarbskylecarbs approved these changes

@sreyasreyaAwaiting requested review from sreya

+1 more reviewer

@coadlercoadlercoadler left review comments

Reviewers whose approvals may not affect merge requirements

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@Emyrk@kylecarbs@deansheather@coadler

[8]ページ先頭

©2009-2025 Movatter.jp