Skip to content

Commit

Permalink
document resolution request functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy committed Dec 16, 2024
1 parent 84d6013 commit fb2bd26
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
9 changes: 8 additions & 1 deletion api/client/proto/authservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion api/proto/teleport/legacy/client/proto/authservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,15 @@ message ListResourcesRequest {
}

// ResolveSSHTargetRequest provides details about a server to be resolved in
// an equivalent manner to a ssh dial request.
// an equivalent manner to a ssh dial request.
//
// Resolution can happen in two modes:
// 1) searching for hosts based on labels, a predicate expression, or keywords
// 2) searching based on hostname
//
// If a Host is provided, resolution will only operate in the second mode and
// will not perform any resolution based on labels. In order to resolve via
// labels the Host must not be populated.
message ResolveSSHTargetRequest {
// Host is the target host as would be sent to the proxy during a dial request.
string Host = 1;
Expand Down
4 changes: 4 additions & 0 deletions lib/auth/auth_with_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,10 @@ func (a *ServerWithRoles) ResolveSSHTarget(ctx context.Context, req *proto.Resol
var servers []*types.ServerV2
switch {
case req.Host != "":
if len(req.Labels) > 0 || req.PredicateExpression != "" || len(req.SearchKeywords) > 0 {
a.authServer.logger.WarnContext(ctx, "ssh target resolution request contained both host and label information - ignoring labels")
}

resp, err := a.GetSSHTargets(ctx, &proto.GetSSHTargetsRequest{
Host: req.Host,
Port: req.Port,
Expand Down

0 comments on commit fb2bd26

Please sign in to comment.