Skip to content

Commit

Permalink
generating terraform and operator resources from proto
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktate committed Nov 18, 2024
1 parent 28e9439 commit 68c65e0
Show file tree
Hide file tree
Showing 13 changed files with 235 additions and 33 deletions.
4 changes: 2 additions & 2 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2883,7 +2883,7 @@ message RoleOptions {
(gogoproto.casttype) = "Duration"
];

// Deprecated: Use PortForwardMode instead
// Deprecated: Use PortForwardConfig instead
BoolValue PortForwarding = 3 [
(gogoproto.nullable) = true,
(gogoproto.jsontag) = "port_forwarding,omitempty",
Expand Down Expand Up @@ -3052,7 +3052,7 @@ message RoleOptions {
// CreateHostUserDefaultShell is used to configure the default shell for newly provisioned host users.
string CreateHostUserDefaultShell = 31 [(gogoproto.jsontag) = "create_host_user_default_shell,omitempty"];

// PortForwardConfig
// PortForwardConfig defines which types of port forwarding are permitted, if any.
PortForwardConfig PortForwardConfig = 32 [
(gogoproto.nullable) = true,
(gogoproto.jsontag) = "port_forward_config,omitempty"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|mfa_verification_interval|string|MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.|
|permit_x11_forwarding|boolean|PermitX11Forwarding authorizes use of X11 forwarding.|
|pin_source_ip|boolean|PinSourceIP forces the same client IP for certificate generation and usage|
|port_forwarding|boolean|PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer|
|port_forward_config|[object](#specoptionsport_forward_config)|PortForwardConfig|
|port_forwarding|boolean|Deprecated: Use PortForwardMode instead|
|record_session|[object](#specoptionsrecord_session)|RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false.|
|request_access|string|RequestAccess defines the request strategy (optional|note|always) where optional is the default.|
|request_prompt|string|RequestPrompt is an optional message which tells users what they aught to request.|
Expand Down Expand Up @@ -416,6 +417,13 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|---|---|---|
|enabled|boolean|Enabled is set to true if this option allows access to the Teleport SAML IdP.|

### spec.options.port_forward_config

|Field|Type|Description|
|---|---|---|
|local|boolean||
|remote|boolean||

### spec.options.record_session

|Field|Type|Description|
Expand Down Expand Up @@ -801,7 +809,8 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|mfa_verification_interval|string|MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.|
|permit_x11_forwarding|boolean|PermitX11Forwarding authorizes use of X11 forwarding.|
|pin_source_ip|boolean|PinSourceIP forces the same client IP for certificate generation and usage|
|port_forwarding|boolean|PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer|
|port_forward_config|[object](#specoptionsport_forward_config)|PortForwardConfig|
|port_forwarding|boolean|Deprecated: Use PortForwardMode instead|
|record_session|[object](#specoptionsrecord_session)|RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false.|
|request_access|string|RequestAccess defines the request strategy (optional|note|always) where optional is the default.|
|request_prompt|string|RequestPrompt is an optional message which tells users what they aught to request.|
Expand Down Expand Up @@ -829,6 +838,13 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|---|---|---|
|enabled|boolean|Enabled is set to true if this option allows access to the Teleport SAML IdP.|

### spec.options.port_forward_config

|Field|Type|Description|
|---|---|---|
|local|boolean||
|remote|boolean||

### spec.options.record_session

|Field|Type|Description|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|mfa_verification_interval|string|MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.|
|permit_x11_forwarding|boolean|PermitX11Forwarding authorizes use of X11 forwarding.|
|pin_source_ip|boolean|PinSourceIP forces the same client IP for certificate generation and usage|
|port_forwarding|boolean|PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer|
|port_forward_config|[object](#specoptionsport_forward_config)|PortForwardConfig|
|port_forwarding|boolean|Deprecated: Use PortForwardMode instead|
|record_session|[object](#specoptionsrecord_session)|RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false.|
|request_access|string|RequestAccess defines the request strategy (optional|note|always) where optional is the default.|
|request_prompt|string|RequestPrompt is an optional message which tells users what they aught to request.|
Expand Down Expand Up @@ -416,6 +417,13 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|---|---|---|
|enabled|boolean|Enabled is set to true if this option allows access to the Teleport SAML IdP.|

### spec.options.port_forward_config

|Field|Type|Description|
|---|---|---|
|local|boolean||
|remote|boolean||

### spec.options.record_session

|Field|Type|Description|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|mfa_verification_interval|string|MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.|
|permit_x11_forwarding|boolean|PermitX11Forwarding authorizes use of X11 forwarding.|
|pin_source_ip|boolean|PinSourceIP forces the same client IP for certificate generation and usage|
|port_forwarding|boolean|PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer|
|port_forward_config|[object](#specoptionsport_forward_config)|PortForwardConfig|
|port_forwarding|boolean|Deprecated: Use PortForwardMode instead|
|record_session|[object](#specoptionsrecord_session)|RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false.|
|request_access|string|RequestAccess defines the request strategy (optional|note|always) where optional is the default.|
|request_prompt|string|RequestPrompt is an optional message which tells users what they aught to request.|
Expand Down Expand Up @@ -416,6 +417,13 @@ resource, which you can apply after installing the Teleport Kubernetes operator.
|---|---|---|
|enabled|boolean|Enabled is set to true if this option allows access to the Teleport SAML IdP.|

### spec.options.port_forward_config

|Field|Type|Description|
|---|---|---|
|local|boolean||
|remote|boolean||

### spec.options.record_session

|Field|Type|Description|
Expand Down
11 changes: 10 additions & 1 deletion docs/pages/reference/terraform-provider/data-sources/role.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ Optional:
- `mfa_verification_interval` (String) MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.
- `permit_x11_forwarding` (Boolean) PermitX11Forwarding authorizes use of X11 forwarding.
- `pin_source_ip` (Boolean) PinSourceIP forces the same client IP for certificate generation and usage
- `port_forwarding` (Boolean) PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer
- `port_forward_config` (Attributes) PortForwardConfig (see [below for nested schema](#nested-schema-for-specoptionsport_forward_config))
- `port_forwarding` (Boolean) Deprecated: Use PortForwardMode instead
- `record_session` (Attributes) RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false. (see [below for nested schema](#nested-schema-for-specoptionsrecord_session))
- `request_access` (String) RequestAccess defines the request strategy (optional|note|always) where optional is the default.
- `request_prompt` (String) RequestPrompt is an optional message which tells users what they aught to request.
Expand Down Expand Up @@ -463,6 +464,14 @@ Optional:



### Nested Schema for `spec.options.port_forward_config`

Optional:

- `local` (Boolean)
- `remote` (Boolean)


### Nested Schema for `spec.options.record_session`

Optional:
Expand Down
11 changes: 10 additions & 1 deletion docs/pages/reference/terraform-provider/resources/role.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ Optional:
- `mfa_verification_interval` (String) MFAVerificationInterval optionally defines the maximum duration that can elapse between successive MFA verifications. This variable is used to ensure that users are periodically prompted to verify their identity, enhancing security by preventing prolonged sessions without re-authentication when using tsh proxy * derivatives. It's only effective if the session requires MFA. If not set, defaults to `max_session_ttl`.
- `permit_x11_forwarding` (Boolean) PermitX11Forwarding authorizes use of X11 forwarding.
- `pin_source_ip` (Boolean) PinSourceIP forces the same client IP for certificate generation and usage
- `port_forwarding` (Boolean) PortForwarding defines if the certificate will have "permit-port-forwarding" in the certificate. PortForwarding is "yes" if not set, that's why this is a pointer
- `port_forward_config` (Attributes) PortForwardConfig (see [below for nested schema](#nested-schema-for-specoptionsport_forward_config))
- `port_forwarding` (Boolean) Deprecated: Use PortForwardMode instead
- `record_session` (Attributes) RecordDesktopSession indicates whether desktop access sessions should be recorded. It defaults to true unless explicitly set to false. (see [below for nested schema](#nested-schema-for-specoptionsrecord_session))
- `request_access` (String) RequestAccess defines the request strategy (optional|note|always) where optional is the default.
- `request_prompt` (String) RequestPrompt is an optional message which tells users what they aught to request.
Expand Down Expand Up @@ -517,6 +518,14 @@ Optional:



### Nested Schema for `spec.options.port_forward_config`

Optional:

- `local` (Boolean)
- `remote` (Boolean)


### Nested Schema for `spec.options.record_session`

Optional:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1280,10 +1280,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down Expand Up @@ -2661,10 +2668,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1280,10 +1280,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down Expand Up @@ -2661,10 +2668,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,10 +1283,17 @@ spec:
description: PinSourceIP forces the same client IP for certificate
generation and usage
type: boolean
port_forward_config:
description: PortForwardConfig
nullable: true
properties:
local:
type: boolean
remote:
type: boolean
type: object
port_forwarding:
description: PortForwarding defines if the certificate will have
"permit-port-forwarding" in the certificate. PortForwarding
is "yes" if not set, that's why this is a pointer
description: 'Deprecated: Use PortForwardMode instead'
type: boolean
record_session:
description: RecordDesktopSession indicates whether desktop access
Expand Down
Loading

0 comments on commit 68c65e0

Please sign in to comment.