Skip to content

Return logins from the unified resources endpoint for scoped nodes - #69617

Open
bl-nero wants to merge 1 commit into
masterfrom
bl-nero/scopes-web-ssh
Open

Return logins from the unified resources endpoint for scoped nodes#69617
bl-nero wants to merge 1 commit into
masterfrom
bl-nero/scopes-web-ssh

Conversation

@bl-nero

@bl-nero bl-nero commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

This change returns allowed SSH server logins for scoped nodes to the Web UI. As a result, the user is able to connect to a scoped SSH node using a Web terminal.

Updates https://github.com/gravitational/core/issues/77

Manual Test Plan

Test Environment

Any cluster and a user with a scoped role that allows access to at least one server.

Turn on Scopes globally using TELEPORT_UNSTABLE_SCOPES=yes in the environment.
Using Chrome dev tools, add grv_teleport_use_login_scope_picker=true to the application's local storage.

Test Cases

  • After clicking a Connect dropdown, logins defined by the scoped role are displayed in the dropdown.
  • After clicking a login, the user is connected to the SSH server using a Web terminal.

Comment thread api/types/server.go
GetImmutableLabels() map[string]string
}

type serverOpt func(*ServerV2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type serverOpt func(*ServerV2)
type ServerOpt func(*ServerV2)

Comment thread api/types/server.go

type serverOpt func(*ServerV2)

func ServerWithScope(scope string) serverOpt {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
func ServerWithScope(scope string) serverOpt {
func WithScope(scope string) serverOpt {

Comment on lines +1990 to +1994
resourceLister := &unifiedResourceLister{}
resourceLister.accessChecker = &scopedResourceChecker{
ctx: ctx,
scopedContext: *a.scopedContext,
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
resourceLister := &unifiedResourceLister{}
resourceLister.accessChecker = &scopedResourceChecker{
ctx: ctx,
scopedContext: *a.scopedContext,
}
resourceLister := &unifiedResourceLister{
accessChecker: &scopedResourceChecker{
ctx: ctx,
scopedContext: *a.scopedContext,
},
}

Comment on lines +2701 to +2704
serverScope := scopes.Root
if server.Scope != "" {
serverScope = server.Scope
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here and below:

Suggested change
serverScope := scopes.Root
if server.Scope != "" {
serverScope = server.Scope
}
serverScope := cmp.Or(server.Scope, scopes.Root)

@rosstimothy rosstimothy added the scopes Work related to scoped access (RFD 229). label Aug 13, 2026
Comment thread api/types/server.go
// NewServer creates an instance of Server.
func NewServer(name, kind string, spec ServerSpecV2) (Server, error) {
return NewServerWithLabels(name, kind, spec, map[string]string{})
func NewServer(name, kind string, spec ServerSpecV2, opts ...serverOpt) (Server, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also consider scope ...string instead of serverOpt here if the intent is to limit the blast radius in this PR, then just follow up and update all call sites to either pass in the scope or empty string later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/branch/v18 scopes Work related to scoped access (RFD 229). size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants