Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into tigrato/fix-search-events
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato authored May 22, 2024
2 parents 56e1614 + f2e0f56 commit 625c55b
Show file tree
Hide file tree
Showing 27 changed files with 5,181 additions and 4,361 deletions.
2 changes: 1 addition & 1 deletion access/discord/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-discord
Expand Down
2 changes: 1 addition & 1 deletion access/email/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-email
Expand Down
2 changes: 1 addition & 1 deletion access/jira/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-jira
Expand Down
2 changes: 1 addition & 1 deletion access/mattermost/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-mattermost
Expand Down
2 changes: 1 addition & 1 deletion access/msteams/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-msteams
Expand Down
2 changes: 1 addition & 1 deletion access/pagerduty/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-pagerduty
Expand Down
2 changes: 1 addition & 1 deletion access/slack/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

BUILDDIR ?= build
BINARY = $(BUILDDIR)/teleport-slack
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
# enterprise version, but has to be available on cdn.teleport.dev
RELEASE ?= teleport-ent-v14.0.0-linux-amd64-bin

RUNTIME ?= go1.21.9
RUNTIME ?= go1.21.10
BBOX ?= public.ecr.aws/gravitational/teleport-buildbox:$(RUNTIME)

# Teleport CLI and plugins CLI flags to pass to them on start
Expand Down
2 changes: 1 addition & 1 deletion docker/plugins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Defines Teleport Slack image, based on Teleport OSS image.
ARG RUNTIME="go1.21.9"
ARG RUNTIME="go1.21.10"
ARG BBOX="public.ecr.aws/gravitational/teleport-buildbox"
FROM $BBOX:$RUNTIME

Expand Down
2 changes: 1 addition & 1 deletion event-handler/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION?=15.3.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10

GITTAG=v$(VERSION)

Expand Down
2 changes: 1 addition & 1 deletion event-handler/build.assets/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION=0.0.1
GO_VERSION=1.21.9
GO_VERSION=1.21.10
LOCALDIR := $(dir $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
TOP ?= $(abspath $(LOCALDIR)/../..)
SRCDIR=/go/src/github.com/gravitational/teleport-plugins/event-handler
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/gravitational/teleport-plugins

go 1.21

toolchain go1.21.9
toolchain go1.21.10

require (
github.com/DanielTitkov/go-adaptive-cards v0.2.2 // indirect
Expand Down
13 changes: 12 additions & 1 deletion terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ endif
--terraform_out=config=protoc-gen-terraform-teleport.yaml:./tfschema \
teleport/legacy/types/types.proto

mv ./tfschema/github.com/gravitational/teleport/api/types/types_terraform.go ./tfschema/

@protoc \
-I$(API_MOD_PATH)/proto \
-I=$(PROTOBUF_MOD_PATH) \
--plugin=$(GENTERRAFORMPATH)/protoc-gen-terraform \
--terraform_out=config=protoc-gen-terraform-teleport-token.yaml:./tfschema \
teleport/legacy/types/types.proto

mkdir -p ./tfschema/token
mv ./tfschema/github.com/gravitational/teleport/api/types/types_terraform.go ./tfschema/token/

@protoc \
-I$(API_MOD_PATH)/proto \
-I$(PROTOBUF_MOD_PATH) \
Expand All @@ -87,7 +99,6 @@ endif
--terraform_out=config=protoc-gen-terraform-accesslist.yaml:./tfschema \
teleport/accesslist/v1/accesslist.proto

mv ./tfschema/github.com/gravitational/teleport/api/types/types_terraform.go ./tfschema/
mv ./tfschema/github.com/gravitational/teleport/api/gen/proto/go/teleport/loginrule/v1/loginrule_terraform.go ./tfschema/loginrule/v1/
mv ./tfschema/github.com/gravitational/teleport/api/gen/proto/go/teleport/accesslist/v1/accesslist_terraform.go ./tfschema/accesslist/v1/
mv ./tfschema/github.com/gravitational/teleport/api/types/device_terraform.go ./tfschema/devicetrust/v1/
Expand Down
5 changes: 4 additions & 1 deletion terraform/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
accesslistSchema "github.com/gravitational/teleport-plugins/terraform/tfschema/accesslist/v1"
devicetrustSchema "github.com/gravitational/teleport-plugins/terraform/tfschema/devicetrust/v1"
loginruleSchema "github.com/gravitational/teleport-plugins/terraform/tfschema/loginrule/v1"
tokenSchema "github.com/gravitational/teleport-plugins/terraform/tfschema/token"
)

// payload represents template payload
Expand Down Expand Up @@ -289,6 +290,8 @@ var (
Kind: "token",
HasStaticID: false,
ExtraImports: []string{"strconv"},
SchemaPackage: "token",
SchemaPackagePath: "github.com/gravitational/teleport-plugins/terraform/tfschema/token",
TerraformResourceType: "teleport_provision_token",
HasCheckAndSetDefaults: true,
}
Expand Down Expand Up @@ -564,7 +567,7 @@ var (
"login_rule": loginruleSchema.GenSchemaLoginRule,
"okta_import_rule": tfschema.GenSchemaOktaImportRuleV1,
"oidc_connector": tfschema.GenSchemaOIDCConnectorV3,
"provision_token": tfschema.GenSchemaProvisionTokenV2,
"provision_token": tokenSchema.GenSchemaProvisionTokenV2,
"role": tfschema.GenSchemaRoleV6,
"saml_connector": tfschema.GenSchemaSAMLConnectorV2,
"session_recording_config": tfschema.GenSchemaSessionRecordingConfigV2,
Expand Down
89 changes: 89 additions & 0 deletions terraform/protoc-gen-terraform-teleport-token.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
target_package_name: "token"
default_package_name: "github.com/gravitational/teleport/api/types"
duration_custom_type: Duration
use_state_for_unknown_by_default: true

# Top-level type names to export
types:
- "ProvisionTokenV2"

# These import paths were not being automatically picked up by
# protoc-gen-terraform without these overrides
import_path_overrides:
github_com_gravitational_teleport_plugins_terraform_tfschema: "github.com/gravitational/teleport-plugins/terraform/tfschema"

# id field is required for integration tests. It is not used by provider.
# We have to add it manually (might be removed in the future versions).
injected_fields:
ProvisionTokenV2:
-
name: id
type: github.com/hashicorp/terraform-plugin-framework/types.StringType
computed: true
plan_modifiers:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"

# These fields will be excluded
exclude_fields:
# Metadata (we id resources by name on our side)
- "Metadata.ID"

name_overrides:

# These fields will be marked as Computed: true
computed_fields:
# Metadata
- "Metadata.Namespace"

# Provision token
- "ProvisionTokenV2.Spec.AWSIIDTTL"
- "ProvisionTokenV2.Kind"
- "ProvisionTokenV2.Metadata.Name"

# These fields will be marked as Required: true
required_fields:
# Provision token
- "ProvisionTokenV2.Spec"
- "ProvisionTokenV2.Spec.Options"
- "ProvisionTokenV2.Spec.Roles"
- "ProvisionTokenV2.Version"

# These fields must be marked as sensitive
sensitive_fields:
- "ProvisionTokenV2.Metadata.Name"

# These suffixes for custom methods called when field has custom_type flag. By default they might be weird.
suffixes:
"BoolOption": "BoolOptionNullable"
"Labels": "Labels"
"github.com/gravitational/teleport/api/types/wrappers.Traits": "Traits"
"github.com/gravitational/teleport/api/types/wrappers.Strings": "Strings"

plan_modifiers:
# Force to recreate resource if it's name changes
Metadata.Name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
ProvisionTokenV2.Metadata.Name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"

validators:
# Expires must be in the future
Metadata.Expires:
- github_com_gravitational_teleport_plugins_terraform_tfschema.MustTimeBeInFuture()
ProvisionTokenV2.Version:
- github_com_gravitational_teleport_plugins_terraform_tfschema.UseVersionBetween(2,2)

time_type:
type: "github.com/gravitational/teleport-plugins/terraform/tfschema.TimeType"
value_type: "github.com/gravitational/teleport-plugins/terraform/tfschema.TimeValue"
cast_to_type: "time.Time"
cast_from_type: "time.Time"
type_constructor: "github.com/gravitational/teleport-plugins/terraform/tfschema.UseRFC3339Time()"

duration_type:
type: "github.com/gravitational/teleport-plugins/terraform/tfschema.DurationType"
value_type: "github.com/gravitational/teleport-plugins/terraform/tfschema.DurationValue"
cast_to_type: "time.Duration"
cast_from_type: "time.Duration"
28 changes: 0 additions & 28 deletions terraform/protoc-gen-terraform-teleport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ types:
- "GithubConnectorV3"
- "OIDCConnectorV3"
- "OktaImportRuleV1"
- "ProvisionTokenV2"
- "RoleV6"
- "SAMLConnectorV2"
- "ServerV2"
Expand Down Expand Up @@ -81,13 +80,6 @@ injected_fields:
computed: true
plan_modifiers:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"
ProvisionTokenV2:
-
name: id
type: github.com/hashicorp/terraform-plugin-framework/types.StringType
computed: true
plan_modifiers:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"
RoleV6:
-
name: id
Expand Down Expand Up @@ -164,9 +156,6 @@ exclude_fields:
- "UserSpecV2.CreatedBy"
- "UserSpecV2.Status"

# Temporary fix to release 15.2.2
- "ProvisionTokenV2.Spec.TPM"

name_overrides:

# These fields will be marked as Computed: true
Expand Down Expand Up @@ -201,11 +190,6 @@ computed_fields:
# Github connector
- "GithubConnectorV3.Kind"

# Provision token
- "ProvisionTokenV2.Spec.AWSIIDTTL"
- "ProvisionTokenV2.Kind"
- "ProvisionTokenV2.Metadata.Name"

# OIDC connector
- "OIDCConnectorV3.Kind"

Expand Down Expand Up @@ -314,12 +298,6 @@ required_fields:
- "OktaImportRuleV1.Metadata.Name"
- "OktaImportRuleV1.Version"

# Provision token
- "ProvisionTokenV2.Spec"
- "ProvisionTokenV2.Spec.Options"
- "ProvisionTokenV2.Spec.Roles"
- "ProvisionTokenV2.Version"

# Role
- "RoleV6.Metadata.Name"
- "RoleV6.Version"
Expand Down Expand Up @@ -350,7 +328,6 @@ required_fields:

# These fields must be marked as sensitive
sensitive_fields:
- "ProvisionTokenV2.Metadata.Name"
- "SAMLConnectorV2.Spec.Cert"
- "SAMLConnectorV2.Spec.SigningKeyPair.PrivateKey"
- "SAMLConnectorV2.Spec.EncryptionKeyPair.PrivateKey"
Expand All @@ -371,9 +348,6 @@ plan_modifiers:
# Force to recreate resource if it's name changes
Metadata.Name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
ProvisionTokenV2.Metadata.Name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"
ServerV2.Metadata.Name:
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.UseStateForUnknown()"
- "github.com/hashicorp/terraform-plugin-framework/tfsdk.RequiresReplace()"
Expand Down Expand Up @@ -402,8 +376,6 @@ validators:
- UseVersionBetween(3,3)
OktaImportRuleV1.Version:
- UseVersionBetween(1,1)
ProvisionTokenV2.Version:
- UseVersionBetween(2,2)
RoleV6.Version:
- UseVersionBetween(3,7)
SAMLConnectorV2.Version:
Expand Down
6 changes: 3 additions & 3 deletions terraform/provider/data_source_teleport_provision_token.go

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

Loading

0 comments on commit 625c55b

Please sign in to comment.