Skip to content

Commit

Permalink
GCP CLI support: API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tener committed Jan 3, 2023
1 parent b6dbf7a commit ff5eceb
Show file tree
Hide file tree
Showing 8 changed files with 2,707 additions and 2,380 deletions.
1,552 changes: 829 additions & 723 deletions api/client/proto/authservice.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions api/proto/teleport/legacy/client/proto/authservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ message RouteToApp {
string AWSRoleARN = 5 [(gogoproto.jsontag) = "aws_role_arn,omitempty"];
// AzureIdentity is the Azure identity to assume when accessing Azure API.
string AzureIdentity = 6 [(gogoproto.jsontag) = "azure_identity,omitempty"];
// GCPServiceAccount is the GCP service account to assume when accessing GCP API.
string GCPServiceAccount = 7 [(gogoproto.jsontag) = "gcp_service_account,omitempty"];
}

// GetUserRequest specifies parameters for the GetUser method.
Expand Down Expand Up @@ -706,6 +708,8 @@ message CreateAppSessionRequest {
string AWSRoleARN = 5 [(gogoproto.jsontag) = "aws_role_arn"];
// AzureIdentity is Azure identity the user wants to assume.
string AzureIdentity = 6 [(gogoproto.jsontag) = "azure_identity"];
// GCPServiceAccount is the GCP service account the user wants to assume.
string GCPServiceAccount = 7 [(gogoproto.jsontag) = "gcp_service_account"];
}

// CreateAppSessionResponse contains the requested application web session.
Expand Down
13 changes: 10 additions & 3 deletions api/proto/teleport/legacy/types/events/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ message UserMetadata {
// AWSRoleARN is AWS IAM role user assumes when accessing AWS console.
string AWSRoleARN = 4 [(gogoproto.jsontag) = "aws_role_arn,omitempty"];

// AzureIdentity is the Azure identity to assume when accessing Azure API.
string AzureIdentity = 6 [(gogoproto.jsontag) = "azure_identity,omitempty"];

// AccessRequests are the IDs of access requests created by the user
repeated string AccessRequests = 5 [(gogoproto.jsontag) = "access_requests,omitempty"];

// AzureIdentity is the Azure identity user assumes when accessing Azure API.
string AzureIdentity = 6 [(gogoproto.jsontag) = "azure_identity,omitempty"];

// GCPServiceAccount is the GCP service account user assumes when accessing GCP API.
string GCPServiceAccount = 7 [(gogoproto.jsontag) = "gcp_service_account,omitempty"];
}

// Server is a server metadata
Expand Down Expand Up @@ -3287,6 +3290,8 @@ message Identity {
];
// AzureIdentities is a list of allowed Azure identities user can assume.
repeated string AzureIdentities = 24 [(gogoproto.jsontag) = "azure_identities,omitempty"];
// GCPServiceAccounts is a list of allowed GCP service accounts user can assume.
repeated string GCPServiceAccounts = 25 [(gogoproto.jsontag) = "gcp_service_accounts,omitempty"];
}

// RouteToApp contains parameters for application access certificate requests.
Expand All @@ -3303,6 +3308,8 @@ message RouteToApp {
string AWSRoleARN = 5 [(gogoproto.jsontag) = "aws_role_arn,omitempty"];
// AzureIdentity is the Azure identity ot assume when accessing Azure API.
string AzureIdentity = 6 [(gogoproto.jsontag) = "azure_identity,omitempty"];
// GCPServiceAccount is the GCP service account to assume when accessing GCP API.
string GCPServiceAccount = 7 [(gogoproto.jsontag) = "gcp_service_account,omitempty"];
}

// RouteToDatabase combines parameters for database service routing information.
Expand Down
2 changes: 2 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,8 @@ message RoleConditions {

// AzureIdentities is a list of Azure identities this role is allowed to assume.
repeated string AzureIdentities = 23 [(gogoproto.jsontag) = "azure_identities,omitempty"];
// GCPServiceAccounts is a list of GCP service accounts this role is allowed to assume.
repeated string GCPServiceAccounts = 24 [(gogoproto.jsontag) = "gcp_service_accounts,omitempty"];
}

// SessionRequirePolicy a requirement policy that needs to be fulfilled to grant access.
Expand Down
7 changes: 7 additions & 0 deletions api/types/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type Application interface {
IsAWSConsole() bool
// IsAzureCloud returns true if this app represents Azure Cloud instance.
IsAzureCloud() bool
// IsGCP returns true if this app represents GCP instance.
IsGCP() bool
// IsTCP returns true if this app represents a TCP endpoint.
IsTCP() bool
// GetProtocol returns the application protocol.
Expand Down Expand Up @@ -242,6 +244,11 @@ func (a *AppV3) IsAzureCloud() bool {
return a.Spec.Cloud == CloudAzure
}

// IsGCP returns true if this app is GCP instance.
func (a *AppV3) IsGCP() bool {
return a.Spec.Cloud == CloudGCP
}

// IsTCP returns true if this app represents a TCP endpoint.
func (a *AppV3) IsTCP() bool {
return strings.HasPrefix(a.Spec.URI, "tcp://")
Expand Down
1,386 changes: 766 additions & 620 deletions api/types/events/events.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/types/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ type CreateAppSessionRequest struct {
AWSRoleARN string `json:"aws_role_arn"`
// AzureIdentity is Azure identity this the user wants to assume.
AzureIdentity string `json:"azure_identity"`
// GCPServiceAccount is GCP service account this the user wants to assume.
GCPServiceAccount string `json:"gcp_service_account"`
}

// Check validates the request.
Expand Down
Loading

0 comments on commit ff5eceb

Please # to comment.