@@ -32,6 +32,41 @@ func TestAccResourceAuthorization_basic(t *testing.T) {
32
32
})
33
33
}
34
34
35
+ func TestAccResourceAuthorization_sessionSharing (t * testing.T ) {
36
+ resource .Test (t , resource.TestCase {
37
+ PreCheck : func () { testAccPreCheck (t ) },
38
+ Providers : testAccProviders ,
39
+ Steps : []resource.TestStep {
40
+ {
41
+ Config : testAccResourceAuthorizationSessionSharingViewOnly (),
42
+ Check : resource .ComposeTestCheckFunc (
43
+ resource .TestCheckResourceAttrSet (
44
+ "wallix-bastion_authorization.testacc_Authorization_sharing" ,
45
+ "id" ),
46
+ resource .TestCheckResourceAttr (
47
+ "wallix-bastion_authorization.testacc_Authorization_sharing" ,
48
+ "authorize_session_sharing" , "true" ),
49
+ resource .TestCheckResourceAttr (
50
+ "wallix-bastion_authorization.testacc_Authorization_sharing" ,
51
+ "session_sharing_mode" , "view_only" ),
52
+ ),
53
+ },
54
+ {
55
+ Config : testAccResourceAuthorizationSessionSharingViewControl (),
56
+ Check : resource .ComposeTestCheckFunc (
57
+ resource .TestCheckResourceAttr (
58
+ "wallix-bastion_authorization.testacc_Authorization_sharing" ,
59
+ "authorize_session_sharing" , "true" ),
60
+ resource .TestCheckResourceAttr (
61
+ "wallix-bastion_authorization.testacc_Authorization_sharing" ,
62
+ "session_sharing_mode" , "view_control" ),
63
+ ),
64
+ },
65
+ },
66
+ PreventPostDestroyRefresh : true ,
67
+ })
68
+ }
69
+
35
70
// nolint: lll, nolintlint
36
71
func testAccResourceAuthorizationCreate () string {
37
72
return `
@@ -41,8 +76,22 @@ resource "wallix-bastion_authorization" "testacc_Authorization" {
41
76
target_group = wallix-bastion_targetgroup.testacc_Authorization.group_name
42
77
authorize_sessions = true
43
78
subprotocols = [
44
- "RDP_CLIPBOARD_UP", "RDP_CLIPBOARD_DOWN", "RDP_PRINTER", "RDP_COM_PORT", "RDP_DRIVE", "RDP_SMARTCARD", "RDP_CLIPBOARD_FILE", "RDP_AUDIO_OUTPUT",
45
- "SSH_SHELL_SESSION", "SSH_REMOTE_COMMAND", "SSH_SCP_UP", "SSH_SCP_DOWN", "SSH_X11", "SSH_DIRECT_TCPIP", "SSH_REVERSE_TCPIP", "SSH_AUTH_AGENT",
79
+ "RDP_CLIPBOARD_UP",
80
+ "RDP_CLIPBOARD_DOWN",
81
+ "RDP_PRINTER",
82
+ "RDP_COM_PORT",
83
+ "RDP_DRIVE",
84
+ "RDP_SMARTCARD",
85
+ "RDP_CLIPBOARD_FILE",
86
+ "RDP_AUDIO_OUTPUT",
87
+ "SSH_SHELL_SESSION",
88
+ "SSH_REMOTE_COMMAND",
89
+ "SSH_SCP_UP",
90
+ "SSH_SCP_DOWN",
91
+ "SSH_X11",
92
+ "SSH_DIRECT_TCPIP",
93
+ "SSH_REVERSE_TCPIP",
94
+ "SSH_AUTH_AGENT",
46
95
"SFTP_SESSION",
47
96
"RDP",
48
97
"VNC",
@@ -51,10 +100,12 @@ resource "wallix-bastion_authorization" "testacc_Authorization" {
51
100
"RAWTCPIP",
52
101
]
53
102
}
103
+
54
104
resource "wallix-bastion_usergroup" "testacc_Authorization" {
55
105
group_name = "testacc_Authorization"
56
106
timeframes = ["allthetime"]
57
107
}
108
+
58
109
resource "wallix-bastion_targetgroup" "testacc_Authorization" {
59
110
group_name = "testacc_Authorization"
60
111
}
@@ -70,9 +121,25 @@ resource "wallix-bastion_authorization" "testacc_Authorization" {
70
121
target_group = wallix-bastion_targetgroup.testacc_Authorization.group_name
71
122
authorize_password_retrieval = true
72
123
authorize_sessions = true
124
+ authorize_session_sharing = true
125
+ session_sharing_mode = "view_control"
73
126
subprotocols = [
74
- "RDP_CLIPBOARD_UP", "RDP_CLIPBOARD_DOWN", "RDP_PRINTER", "RDP_COM_PORT", "RDP_DRIVE", "RDP_SMARTCARD", "RDP_CLIPBOARD_FILE", "RDP_AUDIO_OUTPUT",
75
- "SSH_SHELL_SESSION", "SSH_REMOTE_COMMAND", "SSH_SCP_UP", "SSH_SCP_DOWN", "SSH_X11", "SSH_DIRECT_TCPIP", "SSH_REVERSE_TCPIP", "SSH_AUTH_AGENT",
127
+ "RDP_CLIPBOARD_UP",
128
+ "RDP_CLIPBOARD_DOWN",
129
+ "RDP_PRINTER",
130
+ "RDP_COM_PORT",
131
+ "RDP_DRIVE",
132
+ "RDP_SMARTCARD",
133
+ "RDP_CLIPBOARD_FILE",
134
+ "RDP_AUDIO_OUTPUT",
135
+ "SSH_SHELL_SESSION",
136
+ "SSH_REMOTE_COMMAND",
137
+ "SSH_SCP_UP",
138
+ "SSH_SCP_DOWN",
139
+ "SSH_X11",
140
+ "SSH_DIRECT_TCPIP",
141
+ "SSH_REVERSE_TCPIP",
142
+ "SSH_AUTH_AGENT",
76
143
"SFTP_SESSION",
77
144
"RDP",
78
145
"VNC",
@@ -93,16 +160,73 @@ resource "wallix-bastion_authorization" "testacc_Authorization" {
93
160
mandatory_ticket = true
94
161
single_connection = true
95
162
}
163
+
96
164
resource "wallix-bastion_usergroup" "testacc_Authorization" {
97
165
group_name = "testacc_Authorization"
98
166
timeframes = ["allthetime"]
99
167
}
168
+
100
169
resource "wallix-bastion_usergroup" "testacc_Authorization2" {
101
170
group_name = "testacc_Authorization2"
102
171
timeframes = ["allthetime"]
103
172
}
173
+
104
174
resource "wallix-bastion_targetgroup" "testacc_Authorization" {
105
175
group_name = "testacc_Authorization"
106
176
}
107
177
`
108
178
}
179
+
180
+ // nolint: lll, nolintlint
181
+ func testAccResourceAuthorizationSessionSharingViewOnly () string {
182
+ return `
183
+ resource "wallix-bastion_authorization" "testacc_Authorization_sharing" {
184
+ authorization_name = "testacc_Authorization_sharing"
185
+ user_group = wallix-bastion_usergroup.testacc_Authorization_sharing.group_name
186
+ target_group = wallix-bastion_targetgroup.testacc_Authorization_sharing.group_name
187
+ authorize_sessions = true
188
+ authorize_session_sharing = true
189
+ session_sharing_mode = "view_only"
190
+ subprotocols = [
191
+ "RDP",
192
+ "SSH_SHELL_SESSION",
193
+ ]
194
+ }
195
+
196
+ resource "wallix-bastion_usergroup" "testacc_Authorization_sharing" {
197
+ group_name = "testacc_Authorization_sharing"
198
+ timeframes = ["allthetime"]
199
+ }
200
+
201
+ resource "wallix-bastion_targetgroup" "testacc_Authorization_sharing" {
202
+ group_name = "testacc_Authorization_sharing"
203
+ }
204
+ `
205
+ }
206
+
207
+ // nolint: lll, nolintlint
208
+ func testAccResourceAuthorizationSessionSharingViewControl () string {
209
+ return `
210
+ resource "wallix-bastion_authorization" "testacc_Authorization_sharing" {
211
+ authorization_name = "testacc_Authorization_sharing"
212
+ user_group = wallix-bastion_usergroup.testacc_Authorization_sharing.group_name
213
+ target_group = wallix-bastion_targetgroup.testacc_Authorization_sharing.group_name
214
+ authorize_sessions = true
215
+ authorize_session_sharing = true
216
+ session_sharing_mode = "view_control"
217
+ subprotocols = [
218
+ "RDP",
219
+ "SSH_SHELL_SESSION",
220
+ ]
221
+ }
222
+
223
+ resource "wallix-bastion_usergroup" "testacc_Authorization_sharing" {
224
+ group_name = "testacc_Authorization_sharing"
225
+ timeframes = ["allthetime"]
226
+ }
227
+
228
+ resource "wallix-bastion_targetgroup" "testacc_Authorization_sharing" {
229
+ group_name = "testacc_Authorization_sharing"
230
+ }
231
+ `
232
+ }
0 commit comments