Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions api/proto/teleport/componentfeatures/v1/component_features.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2025 Gravitational, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package teleport.componentfeatures.v1;

option go_package = "github.com/gravitational/teleport/api/gen/proto/go/teleport/componentfeatures/v1;componentfeaturesv1";

// ComponentFeatureID is an identifier for a specific feature supported by a Teleport component.
enum ComponentFeatureID {
COMPONENT_FEATURE_ID_UNSPECIFIED = 0;
// ResourceConstraintsV1 indicates support for Resource Constraints and ResourceAccessIDs, as defined in RFD 228.
COMPONENT_FEATURE_ID_RESOURCE_CONSTRAINTS_V1 = 1;
}

// ComponentFeatures represents a set of features supported by a given Teleport component.
message ComponentFeatures {
// features is a list of supported feature identifiers.
repeated ComponentFeatureID features = 1;
}
7 changes: 7 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "teleport/attestation/v1/attestation.proto";
import "teleport/componentfeatures/v1/component_features.proto";
import "teleport/legacy/types/trusted_device_requirement.proto";
import "teleport/legacy/types/wrappers/wrappers.proto";

Expand Down Expand Up @@ -972,6 +973,9 @@ message ServerSpecV2 {
// the list of Relay host IDs that the server is connected to
repeated string relay_ids = 17;

// component_features represents features supported by this server
teleport.componentfeatures.v1.ComponentFeatures component_features = 18;

reserved 8;
reserved 10;
reserved "KubernetesClusters";
Expand Down Expand Up @@ -1060,6 +1064,9 @@ message AppServerSpecV3 {
string relay_group = 7;
// the list of Relay host IDs that the server is connected to
repeated string relay_ids = 8;

// component_features contains features supported by this app server.
teleport.componentfeatures.v1.ComponentFeatures component_features = 9;
}

// AppV3List represents a list of app resources.
Expand Down
15 changes: 15 additions & 0 deletions api/types/appserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

"github.com/gravitational/teleport/api"
"github.com/gravitational/teleport/api/constants"
componentfeaturesv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/componentfeatures/v1"
"github.com/gravitational/teleport/api/utils"
"github.com/gravitational/teleport/api/utils/iterutils"
)
Expand Down Expand Up @@ -70,6 +71,10 @@ type AppServer interface {
GetRelayIDs() []string
// GetScope returns the scope this server belongs to.
GetScope() string
// GetComponentFeatures returns the ComponentFeatures supported by this AppServer.
GetComponentFeatures() *componentfeaturesv1.ComponentFeatures
// SetComponentFeatures sets the ComponentFeatures supported by this AppServer.
SetComponentFeatures(*componentfeaturesv1.ComponentFeatures)
}

// NewAppServerV3 creates a new app server instance.
Expand Down Expand Up @@ -114,6 +119,16 @@ func NewAppServerForAWSOIDCIntegration(integrationName, hostID, publicAddr strin
})
}

// GetComponentFeatures returns the ComponentFeatures supported by this AppServer.
func (s *AppServerV3) GetComponentFeatures() *componentfeaturesv1.ComponentFeatures {
return s.Spec.ComponentFeatures
}

// SetComponentFeatures sets the ComponentFeatures supported by this AppServer.
func (s *AppServerV3) SetComponentFeatures(cf *componentfeaturesv1.ComponentFeatures) {
s.Spec.ComponentFeatures = cf
}

// GetVersion returns the database server resource version.
func (s *AppServerV3) GetVersion() string {
return s.Version
Expand Down
16 changes: 16 additions & 0 deletions api/types/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/google/uuid"
"github.com/gravitational/trace"

componentfeaturesv1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/componentfeatures/v1"
"github.com/gravitational/teleport/api/utils"
"github.com/gravitational/teleport/api/utils/aws"
)
Expand Down Expand Up @@ -114,6 +115,11 @@ type Server interface {
GetGitHub() *GitHubServerMetadata
// GetScope returns the scope this server belongs to.
GetScope() string

// GetComponentFeatures returns the supported features for the server.
GetComponentFeatures() *componentfeaturesv1.ComponentFeatures
// SetComponentFeatures sets the supported features for the server.
SetComponentFeatures(*componentfeaturesv1.ComponentFeatures)
}

// NewServer creates an instance of Server.
Expand Down Expand Up @@ -195,6 +201,16 @@ func NewGitHubServerWithName(name string, githubSpec GitHubServerMetadata) (Serv
return server, nil
}

// GetComponentFeatures returns the supported features for the server.
func (s *ServerV2) GetComponentFeatures() *componentfeaturesv1.ComponentFeatures {
return s.Spec.ComponentFeatures
}

// SetComponentFeatures sets the supported features for the server.
func (s *ServerV2) SetComponentFeatures(features *componentfeaturesv1.ComponentFeatures) {
s.Spec.ComponentFeatures = features
}

// GetVersion returns resource version
func (s *ServerV2) GetVersion() string {
return s.Version
Expand Down
Loading
Loading